Saving: World Object States


The Beginning

I wasn't sure what I was going to work on today. I had a few different systems that need my attention, the player character skin, the playerstats manager skin data, the world object states, etc. By the title of this post, I'm sure you can guess what I decided to work on. Actually, I started on it yesterday, after my normal game development session. 

I couldn't stop thinking about the game, so I started talking to Gemini to brainstorm ideas. I was positing ideas about world object states and the best approach to handling them. I actually even did a small amount of programming last night, just added a simple variable definition and signal for later. I also added new constants to track my game and save versions, but they don't do anything yet.

The Work

After looking back at my notes I was prepared to start working on world object states. And it was a lot easier than I expected, especially since I had already laid out the logic ahead of time. So I added two new functions, one to set and one to get world object state data. They're each only a single line, very simple stuff. Then came something a little more complicated, but still a lot easier than I was expecting.

It was time to implement the functions to save and load that world object state data. Luckily, it was as simple as copying code from my quest manager and modifying it to the specifics of this new situation. Just a simple change of a couple of variable names. I also made sure to include signal emission when the data is loaded. Keep in mind, none of this is actually connected to anything. My buildings and world objects aren't set to actually get/set the data or respond to the signal.

What's Next?

That is where tomorrow comes in! My next step is going to be actually making this system work. But to do that I will be forced to update my templates. I have to change my buildings, my interactables, maybe even my NPCs! It really shouldn't be too difficult, but anything new is going to be a challenge. Then there's all the rest of the work, the changes to my player's skin handling, the updates to the savegame manager, and everything else that makes a game! I haven't even dug too deep into building out my world! I still need to paint a pretty picture for the player to run around in. . . 

Leave a comment

Log in with itch.io to leave a comment.