
James Brown - Software Engineer

Engine: Unity 2017.3.0f
Language Used: C#
Primary Role: AI and Gameplay Programmer
Additional Role: Animations Implementation
Project Alice is a short cyberpunk fps where players play as a cyber enhanced human named Alice who is tasked with exploring recent mysterious activity surrounding an urban warehouse. It was a project I developed as part of my first year major assessment during my first year of study at the Academy of Interactive Entertainment. It was the first project i developed as part of team which included one other programmer, two designers and three artists and I was primarily responsible for the Doom inspired gameplay and endgame multi-phase boss battle.

FPS Player Controller
The main goal of Project Alice's gameplay aesthetic was to replicate the gameplay design that was presented in the beloved Doom 2016 reboot which allowed players to translate the environment in a fast-paced manner with numerous special abilities at their disposal, such as double jumping, crouching and dashing. For this project we decided to adopt this style of gameplay and borrow the abilities listed above to present intense fast-paced gameplay during the endgame boss battle sequence. This was accomplished through the use of a rigidbody component with continuous dynamic collision detection enabled in order to prevent clipping through other colliders in the world, while also granting access to the translate, rotate and add force functions which were utilized to move and rotate the player around the environment. Additionally, the standard Unity input axis system was utilized as it enabled easy manipulation of the acceleration value by multiplying it based on the current input that is currently being held (i.e. Horizontal Axis: A equals negative one, D equals one).
Furthermore, a physics box cast was utilized to test whether the player met the conditions of being grounded which was required for the player to utilize the jump and double jump abilities. Initially a standard raycast was utilized over the box cast but was soon abandoned as found in testing sessions it never fully detected if the player met the conditions of being grounded, specifically while standing on a ledge or translating up a steep ramp. Continuing, the dash ability was simply accomplished by accessing the rigidbody's current velocity and increasing it for a short period of time before resetting it at the end of the dash period while the crouch ability was crafted by simply re-scaling the player object while detaching and reattaching all child objects to prevent them scaling with the body.

Code Sample - Player Controller

AI System
This project was my first attempt at designing a complex AI system that was capable of executing a series of actions based on a series of predefined conditions being met. I decided upon utilizing abstract classes for the system as it enabled me to establish a base data type and the necessary functions each behaviour required to utilize. Additionally, each behaviour requires the use of the execution function that is defined in the base class that must return an enumeration result being failure, success or running in order for the sequence system to determine whether to keep running the behaviour being checked. For instance, the action behaviour will only run if the condition behaviour before it returns success, if not, the sequence system will skip over the action and begin checking the conditions of the next behaviour.
​
However, upon reflection of this system, it could've been drastically improved through the use of Unity's scriptable objects system as it would have made the system more data driven as the behaviours could have become prefabbed assets that could be attached to a list of behaviours directly instead of having them act as generic MonoBehaviour components. Additionally, the sequence execution system could be drastically improved as it relies on the behaviours being added to the sequences known behaviours list in a specific order, for instance, each behaviour must utilize a condition script before an action script as it will skip over the action behaviour should the conditions not be met. This execution system is highly prone to logic errors should newly created behaviours not get arranged correctly. These flaws could easily of been resolved by utilizing a list of data structs that contain a list of behaviours, that way the storage of behaviours could mimic a behaviour tree/branch like format. For instance if a behaviour in one branch returns fail, it could exit and proceed to the next without having the check the results of any further behaviours which makes the system more modular as a condition behaviour is no longer required to be directly tied to an action behaviour.

Code Sample - Behaviour System

For this project, we as a team decided the overall behaviour of the endgame boss needed to be special, it needed to keep the player moving and on the edge of their seat, but remain challenging enough for players to still enjoy. This was accomplished by changing the way the boss behaves slightly each phase which was determined by how much health the boss had left. This behaviour was carried out through a phase manager system that utilized enumeration values to keep track of what the current phase the boss was in. Each phase was designed to have an initialization period, an update period and exit period in order to carry out certain instructions during each state. For example, in phase two the initialization period unlocks a new behaviour and enables the boss to now perform random attacks during each cool down period of the main gun while the update period checks whether its health has crossed the threshold to move into phase three while finally the exit period will carry out the transition into the next phase.

Code Sample - Boss Phase Manager

Animations Implementations
Through the utilization of avatar masking I was able to implement and blend animations fairly easily that appear natural and switch seamlessly. This technique was also utilized to make it easier on the artists by saving enormous amounts of time on not animating repetitive animations. For instance, the rig utilizes a lower body mask for leg movement animations, an upper body mask for combat animations such as firing the main gun, dispensing drones and firing rockets while a whole body mask is utilized for special animations that involve the use of the whole body such as the stomp and defeat animations.
​
Additionally, animation events were heavily utilized to perform actions at correct points during an animation to make them appear more natural, for instance i was able to modify the combat system written by the other programmer to heavily utilize animation events for the gun behaviours. For example, the magazine gameobject attached to the rifle is removed from its slot when an event is called when the hand grabs the magazine and is inserted back in when an event is called when it reaches its slot again.

Code Sample




AI Missile System
To achieve the curvature of the missile trajectory i utilized an animation curve that enabled the designers to visually plot out in a graph how the missile will translate towards its target, which they played around with extensively. The animation curves evaluate method is called and added to the rocket's and an empty game objects y position which is positioned slightly in front of the rocket in order to call the Vector3.LookAt method in which the empty is passed in to keep the rocket pointing in the correct direction.

Code Sample
