--------- Sections ---------

<Index> - >DevDiary< - <Characters> - <Lore>

ichi rss

--- DevDiary ---

<Back>

- 2023/04/15 -

This week, I worked on logistical systems of Sunrise Doll R.

The goal is to wrap the existing gameplay logic with less exciting but nonetheless vital mechanics. SDR is supposed to have a menu system, both as a buffer between launching the game and starting a level, and as a tool to navigate between various game modes.


Creating menus is what killed most of my old game projects. A lot of them never made it beyond the core gameplay phase, others were abandoned midway through development of the menu system, and SD2020 was lucky enough to reach a working menu, but the mess that was its code untimately discouraged me from continuing to expand on it.


The main menu of SD2020.


The first step was to code a function that properly terminates the gameplay process without terminating the program itself. That means despawning Pawn, removing all enemies, all projectiles, all souls, hitboxes - everything that is a part of the gameplay logic. The second step was to code a function that properly starts the gameplay process again. That means that the previous step should keep the necessary objects to bring Pawn and enemies back into existence. This is all accomplished through a single variable that controls the current game state, a function that changes the state and immediately swaps objects around, and additional clean-up code within certain objects to pick up potential stragglers that make it through the state change.


The other thing I did was a combination of the two previous steps: a function that goes from the gameplay state back into itself, effectively an instant level restart. This had more unforeseen bugs, like Pawn leaking her current pose into the new level, but ultimately they have been ironed out, and the game now supports a clean level restart.


Because of the way SDR handles level transitions, I also had to add a way to load a level without hard-resetting the previous one. Visually, it is supposed to look as if each subsequent level is a new wave of enemies that come onto the current level. The level transition is supposed to freeze Pawn in place until the level actually starts, and this prompted me to introduce some rudimentary code for non-player control over Pawn.


The last vital gameplay feature that SDR absolutely needs is a pause. While not a part of the menu system itself, pause is synonymous enough with it to be bundled with it. Now every game object only runs its step function if the global pause flag is not set, effectively making SDR's pause into a total screen freeze.


For now, the menu graphics themselves are not done, but all the logic necessary to split the menu mode from the gameplay mode on a whim has been implemented. Which leaves me with a task of coding the menus in isolation from Pawn and others. This feels like putting the development of SDR on pause and starting the development of another game, which just happens to be the menu system of SDR.