A prototype inspired by Deltarune after the release of chapters 3 and 4. The prototype remakes the turn-based battle system it has. Additionally, the prototype is an experiment for more advanced UI setup and implementation as a deep dive into what Unity's tools offer for it.
Engine: Unity
Team Size: Solo
Project Length: 1 week
Role: Programmer
Focus: UI Implementation, Turn-based Battle
Like in Pandora's Party Box, one of the first scripts made are the Game Manager and Game Handler. The Game Manager is in charge of handling overarching events and the game's big picture. The Game Handler focuses specifically on individual turns. Methods in the manager control the health of both the player and the enemy. Other scripts invoke events the manager has, which either updates the player's health, updates the enemy's health, or activates any required UI elements depending on which party is attacking currently.
The handler listens for callbacks signaling turns. Depending on the boolean passed, it sets up the appropriate objects either for the player or the enemy. When it's the player's turn, it turns on the player's UI and updates the flavor text to hint at the upcoming attack. When it's the enemy's turn, it activates the battle box and triggers the attack.
The only controls the script needed to worry about was moving the soul whenever the player needs to dodge attacks. Other than that, it sends out an event call whenever the player uses the click input to interact with the beginning dialogue. Every other input from the player is handled through the UI elements.
For building attack patterns, each one starts from a parent class. The parent holds generic values that all attacks would need and focuses on disabling itself after the allotted time of its turn passes. When it's enabled, it begins a countdown, and when that reaches zero, it triggers the Game Manager's turn-swapping event and disables itself.
The child class focuses on that attack's specific behavior. For example, the simple firing attack loops through an object pool of available bullets. It randomly sets their position along the right side of the battle box and then pushes them to the left. After a pause, it repeats the process for the next object in the pool's list. This carries on until the parent class's countdown disables the object.
Since Unity's event system does not automatically snap the player's control to the first available selectable object in a scene, the placement of the selection cursor had to be manually controlled through code. Usually, the player would have to use their mouse to focus on UI elements or click buttons, but the original Deltarune's UI is controlled only through keyboard inputs. Whenever a section with interactable UI appeared on the screen, the first script (left) sets the intended first button the player hovers over. Afterwards, the player can scroll through the options like normal. The second script (right) is for remembering which button the player last pressed if they are taken to a new set of options. When they exit out instead of selecting another option, instead of snapping to the first button like the previous script would do, it remembers that the player specifically selected this menu and has them hover over that button instead.
The dialogue system used in the exposition of the battle, fully shown in the above video, is the system created in this original game demo. Details, scripts, and explanation of the system can be found on the linked page.
Additionally, another focus during this project was animation states using the animator panel. Triggers are set up to activate each state the player or enemy needs to be in, which are called within relevant scripts. The video goes through and manually triggers each state to demonstrate how they flow.