Updating the Save System and the Stamina Component


Devlog author: Alex

Afternoon everyone. For this devlog I wanted to delve a bit into some of the work I made to the stamina component and additions to what the save system, well, saves.

First, I will talk about what I have done to the sprint logic. I may have mentioned the issue I was having before, but long story short, there is a weird and very specific bug I encountered when sprinting during energy regeneration. Essentially, once you sprint, wait for the energy to start regenerating, then sprint for two seconds, you will see that the previous regeneration logic is still running. While I haven't been able to get rid of that bug, I did take the time to clean up and refactor the code, and ended up with the functions seen in the images.  Doing this has enabled me to better debug the code, and hopefully bring me closer to figuring out how to prevent this bug from happening.

Now, I want to focus a bit on how my save system was updated. Before, saves happened when you pressed New Game, which allowed the player to close the game, open it up, and press continue, which would load them into the character select level. In order to fix this, I moved the actual saving logic to the continue button tied in the continue button found in the character select HUD. Secondly, since I followed a Youtube tutorial for the save system, I found the blueprint I followed contained logic not necessary for this game, which allowed for cleaner logic. On top of that, it now takes more values into consideration when saving and loading the game.

Get Lustrat Somnia

Leave a comment

Log in with itch.io to leave a comment.