Trial of the Aisles
Defeat grocery-themed bosses in this boss rush game submitted for the Boss Rush Jam 2024.
Defeat grocery-themed bosses in this boss rush game submitted for the Boss Rush Jam 2024.
Create a boss and design/develop a behaviour tree to make the AI fight against a player character. I already created another Kirby boss in the past, so I decided to make another boss since I already have the player character logic.Β
π΅ Roles: Programmer, in-engine developer, AI Programmer, Tools Programmer
π΅ Collaborators: Ashton McKenzie, Kien Ho, Sarah Chambers
π΅ Year: 2024
π΅ Timeline: 1 month
Make future expansion quick by programming a tool to simply create new bosses. The Finite State Machines should seamlessly incorporate this tool with as little steps as possible on the designer's end.
Make it visually appealing for the designers to enjoy tuning values!
Have all shared boss behaviour data be displayed in the tool
Since we were creating a boss rush game in a limited time, I proposed creating an inspector tool for the team that would allow us to quickly add new bosses and adjust their parameters. Thus, the Boss Profiler tool was born! Below are 3 of our game's bosses, each with their unique attacks, phases, throwable projectiles, and more! This is a tool that stores data, and the Finite State Machine (seen below) is where the Boss Profiler is referenced and its values used. This way, by simply changing the referenced Boss Profiler Scriptable Object I can completely change how the boss behaves! This allows for quick iteration and play-mode testing as the values don't reset on edit mode.
Here's a closer look at the boss phase data! Desigenrs can add a new phase with the "+" button at the bottom right. Designers can also adjust the health percent slider to when the phase will occur, and adjust the universal parameters for every boss such as throw speed, attack delays, and set an event on the phase when it happens. Since the event is a scriptable object, any command can be given, such as making the boss have an invincibility shield. Adjusting the "Health Percent" slider adjusts the coloured bar associated with it in the neat visual created! I also display any event that happens on a specific phase in the visual so designers can quickly understand the information.
As seen in the screenshot below, or in the Boss Profiler screenshots above, each boss' Scriptable Object has a custom preview icon. I achieve this by using the override Texture2D RenderStaticPreview() function with Unity Editor Scripting. I create a new Texture2D for the dimensions, then grab the target's Profile Picture field and use that as the icon. This is the only way to have a Scriptable Object display different icons despite sharing the same script.
Each boss has their own FSM, however the states are very similar across the board.Β
All of our bosses share similar patterns of throwing projectiles, so all the states except for the ones underlined in red are shared behaviours. This streamlines the boss creation process as we can copy over this FSM template and then program in the unique attacks.
Each FSM takes in a Boss Profile scriptable object (top right variable) and we use the values the designer inputted to the tool as the input parameters of the boss. This makes iteration efficient as we don't need to exit play mode.Β
It is best practice to use "Serialized Properties" when using editor scripting to set variable values instead of public getters and setters and referencing the base script. With Serialized Properties, accessing its value demands extra steps, so in the OnEnable function I first Find the associated variable in the base script and assign it.
I learned how to position custom shapes and labels in the inspector screen. The function Screen.width() is used to get the current width of the inspector even if it scales. For the y position of the rect I use GUILayoutUtility.GetLastRect() to get the y position after the "Boss Phases" title text, and then add an amount to set the position.