James Brown - Software Engineer
Art Work by Kayla Woods
Engine: Unity 2018.1.0f2
Language Used: C#
Primary Role: Level Editor Programmer
Tiki Trials was was initially launched by Last Minute Entertainment in April 2019.
During my second year at the Academy of Interactive Entertainment, I took on a part-time internship role with them from April to August. I was the only programmer on a team of 4, and was tasked with creating a custom in-game level editor that was released post launch as a free content update, which enabled users to create their own trials.
The level editor was completed on time and above spec, and was a hit at AVCon.
Placement System
I developed a system to place standard and unique objects onto a grid that span across multiple levels, as trails in Tiki Trials can span up to ten levels. At the end of each level, the completed level fades into the grid and pushes out the next. This system can handle the placement of unique block types ranging from rotating, moving, shrinking and spike blocks and their unique variant types such as different speeds, movement direction, scale and orientation. Due to being brought on after development had completed on the main game, with no experienced coder on the team throughout development, I had to make a system that utilizes functions that could handle the unique behaviour and prefabbed layout the designers had already created, in order to prevent breaking the core game. For example, the PlaceMovingBlock function found on line 214 requires me to get its MonoBehaviour component from its child object as they attached the actual block to an empty GameObject and were using the parent and another empty game object as in and out positions for the blocks movement. Had I written this myself, I would have made the block a single GameObject, and calculated an in and out position on startup, such as the out position being the blocks current position on startup, and the in position being the current position plus the objects scale and desired direction.
Code Sample - Placement
In addition I developed a system for determining whether an object meets the conditions for being placed onto the current level. Such conditions are: Is an object obstructing its position? If the current bock selected/highlighted is a coin and is colliding with a certain block? (i.e. crate), allow placement.
This script is attached to both in game preview cursors, the standard one and rotation block one, which gets enabled and disabled depending on which block is selected. In reflection, this script could no doubt be improved by providing reference to the mesh renders on startup instead of in the update loop and put in a function that takes in a color parameter and handle the changing of the materials color as seen between line 57 and 125. Both these changes would clean up the update area and remove unnecessary repetitive code.
Code Sample - PreviewObjectProperties
Grid Navigation System
A simple system that handles the navigation of the preview cursor on the grid. Due to nature of the grid already being set up in the scene by the designers, I utilized a simple struct that contains a list of transforms of the grid cells in the current row of the grid and then created a list of the structs data type in order to assign the grid in the inspector in a two dimensional array like fashion. Additionally, it allows easy iteration and navigation through the grid with the use of game pad. However, this method is only utilized for when using a game pad as a raycast from the mouse is utilized to snap the preview cursor the current cell it is over.
Code Sample - Grid Nav
Serialization System
A system that utilizes StreamWriter and StreamReader classes to write the current level data to a file via a JSON string. The save and load functions created are only utilized in game when the save or load buttons are selected. Additionally, to avoid duplicating code, this system is hooked up to the placement system to utilize its functions for placing unique block types back into the level.
Code Sample - Save/Load
A data struct that contains references to the current level the block is on, the blocks current position, rotation and scale. Additionally holds data for unique blocks such as moving blocks and rotation blocks speed and the amount icons that is needed to display the speed of the moving block (i.e. 2 means fast speed, 3 means super fast, etc..). This method enables passing in the struct in its entirety to be converted and written in JSON instead of passing in individual data.