Thursday, 29 November 2018

Maya: Intro tools

Outliner


By experimenting with Maya, I found the button highlighted in the image above which displays the Outliner window. This is a window to show all the objects in the scene which will be extremely useful for any project, especially for the intricate models since you can edit pieces individually, and it is possible to group objects together and create a Layer.

Using layers allows you to treat parts of the model separately. For instance, a gun may contain several layers such as the gun handle, the trigger, and barrel. I could hide all the layers except for the barrel if that was the part of the model I was focusing on.

The two small buttons highlighted in the menu apply the 'dark theme' and the blue outline of the models. This makes it much easier to work in the project when objects are starting to build up. The default grey becomes difficult to differentiate objects from each other.



Renaming objects are as simple as selecting them and typing in the desired name, but it is important to note enter must be pressed to register the renaming.



Backface Culling is extremely useful for working on rooms like in this case. The side of the wall the camera is looking at will be invisible, so we can see inside and work on the inside easily. Once we change the angle, the walls will be visible again. I am sure this will be a useful tool to use in the future.


By going to the menu and selecting Duplicate Special you can select an object and duplicate X amount of the object. Using the Translate which is the XYZ we can set it to duplicate along specified axes, along with various other settings. This is a great tool to know as it could be extremely time-saving in the future.



Using the top right icon to display the Modeling Toolkit we can then access the Vertex Selection tool. With this, we can select vertices, individually or multiple and scale and move them to create new objects.  Using the three-view window accessed using Spacebar allows for precision whilst 3D modeling as we can see all angles and how it is affected at all times.

Maya: Settings

To get an introduction to Maya, I have started watching a beginner tutorial to learn the ropes of Maya before I delve into creating a finalized 3D model for my game.

Through the tutorial, I have learned a few key settings that may save me a huge amount of time and difficulty down the line.

Auto Save


By default, autosave is disabled. According to the guide, Maya has a tendency to crash frequently and this feature allows you to autosave work as often as you like.

Undo


Maya by default allows you to undo the past 50 changes you have made to your project, which sounds extremely restrictive. By selecting infinite, it allows me to undo as many changes as I like, which may be more costly memory-wise but that is worth it for the safety of a project.

Incremental Save


In Maya, there are boxes next to options sometimes, which means there are additional options for the setting.



In this instance, we can access a feature called Incremental Save. This option means that the project will not continuously over-write the same file each time, but instead create a new version each time that we can easily revert back to previous stages. This is far more expensive, but memory is not an issue for me and it ensures the safety of a project regardless of how far into it.

Unreal: Opening a door



Using the door provided in the Starter Pack, I have created a blueprint using the door frame by the selected option in the image above.


In the viewport of the blueprint I have added the door inside the frame, and a box simply acting as a box collider would in Unity. 



In the template tab, it is essentially the same as any other animation timeline. Simply by adding a keyframe on 0, we set the rotating of the door to 0. Then at one second (time taken for the door to complete the animation), we set the rotation to 90 degrees (fully open).



Simply by implementing On Component Begin Overlap, which is essentially the same as using OnTriggerEnter() in Unity and End Overlap being the equivalent of OnTriggerExit() we can enable and disable the Player Controller input when our player is inside the invisible box we created on the door, which is practically the same as a Box Collider in Unity.

With the E key, because this is the most commonly used key in games for interacting, we use the OpenDoor and update the rotation of our door using the Make Rotator node to alter it. It is simple to implement a feature to reverse the opening of the door, but I have intentionally made it open only one way because I hope to implement a feature to open doors for a required amount of points, and once it has been opened it cannot be shut again. It will also open new entrances for zombies to enter, and prevent the player from shutting themselves in one room for the entire game.

Wednesday, 28 November 2018

Unreal: KillCount & Scoring System



I have created a basic heads-up display (HUD) involving two text components for Points and Kills, and two more as placeholders for the quantity.

In the context panel, I have selected a binding for each counter element.



Using the First Person Game Mode I created custom events to set the variable (integer) using a simple integer + integer node.


We can then cast the integer to the First Person Game Mode in text format using the ToText node to convert an int and return a string.



In the AI blueprint, I have extended onto the health system. Once the enemy actor is destroyed (died) I have added to the kill count and points and casting it to the First Person Game Mode. Using the Sequence node makes it possible to execute both almost simultaneously.



Selecting the variable opens the details panel where I have added a value to be added each time the AI is killed. The kill count will increase by 1 each time, whilst the score will be 250.

Currently, the system is basic and for the points in a finalized game would not be ideal because it does not require the player to aim for more specified shots, and if enemies become more difficult or the best weapons require high points for purchase, the number of points should be rewarded should increase with level. In the future, the ideal would be to make the system more complex by implementing a varied score based on body parts hit, and potentially a 'combo' where the player can achieve greater points by having a streak of headshots over 10, for example, rewarding the player with double points until they end their streak.

Unreal: Bug Fixes

Crosshair alignment


The crosshair alignment was very off-target. I discovered how to access the crosshair in the FirstPersonHUD, and managed to figure out which figures represent the X and Y positioning of the crosshair. 



By implementing two float - float nodes after the conversion from integer to float, I was able to adjust the positioning of the crosshair on the X and Y axes accordingly to match up with the ironsight.



The crosshair positioning has improved massively and is relevant to the positioning of the gun. Before, it was almost guessing where the bullet is firing because it was extremely off target, now it is possible to aim and fire in the right direction.



The aiming / crossfire still requires work, and the solution is only part of the fix. The crosshair does not move perfectly with the gun and is not strictly accurate. Currently aiming down is the most significant problem. Part of the problem may be more to do with the camera and player positioning, which I did not think about the effects they may have whilst changing them. For the time being, it is at least in the correct direction.

Removing damage volume after AI is dead


When destroying the zombie (AI) there are child objects that are not being destroyed with it. One child is the damage volume, responsible for dealing damage to the player and the other is the Audio Cue responsible for making zombie noises.

I was unable to destroy the child actors, even though I attempted to add a Sequence node to apply an additional DestroyActor node linked to the child actor (Damage Volume) of the AI. I tried various methods to destroy or disable the child actors and I am unable to figure it out, and there seems to be a lack of support relating this issue online - all the suggestions have failed. I am aware the audio is an Audio Component, and may not be able to be destroyed by the DestroyActor node. I have tried using the DestroyComponent instead, which has not worked either.

This is very problematic because the damage volume still exists, and when the player walks over the exact position where the zombie died, they will still receive damage. Whilst it may not be an issue to begin with, the more zombies that are killed, especially if they enter the building, will be damage spots surrounding the player and cause an unfair death. The audio will also send false feedback to the player since audio is a key element in games for detecting movement.

Unreal: Enemy Health

Bullet Collision
In Unity, a method of detection is by using tags. This is also available in Unreal, but I decided to use another approach which adds a collision to the bullet and will be detected by our AI.



In the physics menu, we can set the constraints to be OverlapOnlyPawn, the pawn being a reference to our Enemy AI. This means we can detect when the bullet hits the AI.

Enemy Collision


In the enemy blueprint file, selecting the mesh brings up the details panel where we can enable 'Generate Overlap Events'.

This is essentially the same process as I would expect to use in Unity with collision detectors. In Unreal objects involved in a collision can be set to respond by blocking, overlapping or ignoring.

Dealing damage to the enemy


By using the Event ActorBeginOverlap we detect when this actor overlaps another - detecting the collision with the bullet in this case. On collision, we use the float - float node to subtract 0.2 / 1 (20%) from the health variable belonging to the enemy AI. Then we check to see if the health variable equals 0, if it does then we destroy the actor using DestroyActor (enemy AI).

This is a very simple way to implement killing enemies, however, the enemy currently vanishes and a death animation would improve the game a huge amount. There are sound effects that the zombie makes which are currently not stopping when the enemy has died and needs to be investigated as this can cause misleading signals to the player. The damage volume that is responsible for dealing damage to the player is not being destroyed either, which is a child actor of the AI which is even more of an issue than the audio.

Unreal: Menus

Main Menu

I created a User Interface widget Blueprint file



In the Blueprint I was able to start designing the main menu user interface. Using two buttons from the UI panel and text to go on top of them.



With the button highlighted I created a new "Events" "OnClicked" to determine what happens upon clicking the button.

This is where I constructed the blueprints to make loading the game possible.



With the OnClicked event for the quit button, it was as simple as linking the "Quit Game" node. Now when the quit button is pressed, the game will quit.

With the Play Button, we have to use 'Remove from Parent' to disable the main menu overlay from the viewport. Once we start the game we must enable the player's movement by activating the player controller and player character. Finally, we set the game pause state to false which activates all actors in the game world.

Game Over
The Game Over menu is extremely simple. I have used the same method as the main menu to create a simplistic game over UI to begin with.





Identical to the other quit button, we use the Quit Game node.
To restart the game, using the "Play Again" button, we use the "Open Level" node and type in the name of the level to load. In my case, the naming of my level is still the default level name from the First Person template "FirstPersonExampleMap".

Pause Menu
 

The Pause Menu UI was created in the same way as the other menus, except for the fact that I am using a border. The User Interfaces are plain and I intend to redesign them at a later stage, and for the time being the functionality is the main purpose.



The reason I have used the Escape key and P key is because the "Escape" key exits the play mode and I would have to build an executable version of the game to test it. For this reason, I have implemented the "P" key to pause the game, and will possibly remove this before the final version.

Using the branch node, I have checked the condition of IsGamePaused, then set the game to be paused or unpaused based, and adjust the boolean variable state based on the condition result.

If the game is paused, we add the PauseMenu user interface widget to the viewport, and if the pause state is false we use "Remove from Parent" to remove the user interface.

Controls Menu


Using the UI elements from Unreal I have created a menu to explain the controls. I used buttons for the backgrounds, which may not have been the wisest choice because they are interactive even though they have no functionality (except Return). I was unable to find a solution to making them non-clickable.



I simply remove the UI from the parent, then activate the Pause Menu widget to the viewport, then set the cursor active. After testing the menu system, I found a problem with the cursor disappearing after the first click or switching between menus.



I was easily able to resolve the issue by going through all the menu systems and ensuring that I am activating the cursor when we change the menu and make sure it is deactivated when we begin playing again.

The implementation of menus is extremely simplistic for the basic features. One issue I encountered was importing an image to use as a background, and it does not seem to be a case of dragging and dropping it in, or importing it as expected. I have lost quite a bit of time looking for the answer because it seems as if many of the solutions are out-dated, and have currently settled for the basic UI for the time being. The other problem I have is that I have included the controls menu on the "Main Menu" and "Pause Menu" and attempted to implement the "Return" button to have two functionalities, returning to the corresponding menu based on the one it was previously on. Unfortunately, I was unable to find a solution to the problem, and the return button currently loads the Main Menu regardless of the previous menu. The menus are practically identical at this stage so the issue is minor.

Maya: Techniques #4

Maya: Techniques #3


Maya: Techniques #2

Maya: Techniques #1

Tuesday, 27 November 2018

Maya: Navigation

https://www.lifewire.com/maya-lesson-1-1-introducing-the-user-interface-2104

Navigating in Maya is very different to Unity or Unreal and can be confusing to begin with.

Basic Controls

  • Alt + Left Mouse Click: "Tumble" allows you to rotate the view 360 degrees around the pivot point.
  • Alt + Right Mouse Click: "Dolly" allows you to zoom in and out, alternatively use the scroll wheel but this method zooms in and out at a specific rate making it difficult to achieve precision.
  • Alt + Middle Mouse Click: Allows you to move the viewport horizontally or vertically whilst keeping the central view a fixed point.
These tools are the main ones that will be used most frequently for basic navigation around the viewport. Getting to learn the basic navigation tools are easy to use and is simply a case of getting used to them. It will be important to learn these and explore the other tools, especially once I am creating a detailed model and precision becomes key.

By using View > Camera Tools there are a wider range of tools available:


Maya: Pivot Point

https://3dtotal.com/tutorials/t/introduction-to-maya-general-tools-jahirul-amin-maya-ui

Each object has a pivot point. It is the point where the object can be rotated around or scaled. By default, the pivot point will always be in the centre of the object. It is possible to readjust the positioning of the pivot point by using hotkeys Insert or D.
  • Movement: Moves the object around with the pivot point 
  • Scale: Scales the size of the object, using the pivot point as a reference point to evenly scale the object on all angles
  • Rotation: The object will be rotated around the pivot point as a central position.
With the use of hotkeys it is possible to adjust the pivot's position and axes
  • Ctrl: Modify the axis orientation
  • Shift: Modify the pivot position
  • Ctrl + Shift: Modify the axis and pivot position

Maya: First Impressions

Maya looks extremely complex upon opening the program for the first time. There are a huge range of tools and there is not an introduction tutorial like I found with Unreal to get me involved immediately.



When hovering over icons to find out more information, they mainly provide names of the tool with no explanation of what it does. There does however appear to be a huge range of content available online, documentation and tutorials.

During college, I was required to use Photoshop a huge amount. Opening Maya reminds me of the first time I opened Photoshop and it appeared to be daunting. However, after learning Photoshop and realising that I do not require nearly half of the tools available, and eventually you define your own tool set, because of this I am not worried about using Maya because I suspect it will be similar in that aspect.

I generally find it quite easy to get used to the navigation of software, and learning the basics of tools. However, to master the use of tools can take a huge amount of experience and learning which tools are most important to me will come over time and experience.


Maya: Introduction

World vs Object Translation

https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Maya-Basics/files/GUID-A63AC5C8-8822-42AC-827E-164B5266DA03-htm.html

World
World space is a coordinated system in the representation of the World space, which has its original at the centre of the scene view. The movement will be based on the X, Y and Z axes. When an object is moved, the World space and axis will be aligned to our previous location.

Object
Object space is a coordinated system based on the object's perspective rather than the entire scene. The origin of the object is the pivot point of that particular object. The axes of the object are rotated with the object itself.

There is also the option to have Local space, which can be used when you have an object containing child objects in the hierarchy. The local space will use the origin and axes of the parent only, but apply to the entire group.


By clicking on the object, then double-clicking the highlighted tool on the left hand panel the Tool Settings can be accessed. Through the menu we can change the axis orientation and various other settings.

Saturday, 3 November 2018

Unity to Unreal

https://docs.unrealengine.com/en-us/GettingStarted/FromUnity

On the UE documentation, there is a section devoted to Unity developers that are using Unreal.


I have used this to learn the basic terminology for Unreal. I have gotten used to Unity, and have found it confusing using Unreal, however, once I learn that an actor, for example, is the same as a gameObject in Unity, I can relate the two and understand easily.

The documentation explains more basics of Blueprint, and the equivalent of Monobehaviour etc. By referring to the documentation, it has saved me a lot of time and made the learning process much smoother.

Friday, 2 November 2018

Projectile: Changing the bullet

  
I found a free bullet asset on TurboSquid by signSTUDIOS. I imported this by dragging and dropping it into the project view.

By creating a Blueprint file called Projectile_Template, I added a Static Mesh and set the imported asset as the Static Mesh in the details panel.

I modified the transform scale and rotated it in order to get a realistic size, and firing out the right way of the gun.


In a Blueprint file named Weapon_Template, I have added a custom event for Fire. This is to set-up a place for the bullet to shoot out of. Using the skeletal mesh (bullet) as a reference, and getting the socket transform "Muzzle" which is a socket on the gun where the bullet is positioned to come out of I have set this as the Spawn Transform.


With this custom event Fire, we will be able to use this in the First Person Character blueprint to enable firing a bullet from the gun muzzle.


In the Project Preferences under Input the Left Mouse Click is assigned to the Fire button by default, which is what I want to keep it as.

Using the nodes, I have implemented a variable that detects whether the player is equipping a weapon. If the player is, and the Fire button is activated (Left Click) then we are able to shoot. 

Unreal: Project Evaluation

Unreal is visually enticing and appears to be extremely user-friendly. In the beginning stages, I found it really nice to use and I was exc...