← sources

Some things I learned when implementing a save & load system

source: reddit (reddit:gamedev)published 2026-11-03 08:21ingested 2026-11-04 02:38

retained text

I [posted this a while ago](https://www.reddit.com/r/godot/s/x3dL2SmKPq) on r/godot. I got a lot of good feedback and many people were thankful about the small writeup, and I think it's relevant to game dev in general so I thought I'd do another post here. So yeah, while most of the learnings are generally applicable, keep in mind that I'm developing on Godot Engine. 

So I spent the last 2 weeks implementing a comprehensive save / load system into my game. I already had something rudimentary going that allowed me to skip some parts when debugging and testing, but it was not sophisticated enough for the growing system complexity of my game. After I realized I hit a border with the existing system I decided to halt development on features and implement a proper save / load system that would allow me to store all current relevant things and also be scalable for the future. I'm not going to talk about the save / load system itself, as it his highly depending on the individual game, but more about the peripheral learnings I had while implementing it:

# JSON

So the first realization I had was that I would not be able to just store all my custom resources as tres files ([I wrote shortly about it here and there's an interesting video describing why it's a bad idea to save resources](https://www.reddit.com/r/godot/s/2TSCpAiyUn)). I'm pretty new to godot and this is the first time I'm acting as a programmer as I'm a solo-dev (I used to work in teams where I usually took over the art / design role and never programming), and honestly I was assuming that the intended way to save things was to use resources. But as you'll see in the comments in my linked post or also in the official documentation (read the official documentation!) you should absolutely use JSON. (spoiler for those that don't want to read up on it: it's a massive security risk you cannot ignore). One nice benefit of JSON is also that the data is human readable, something I enjoy a lot. Coming up with a good structure for storing the data and creating containers for topical data is something I enjoyed a lot.

# Game structure

This one is directly emerging from the JSON formatting - you'll be automatically forced to think a lot about the data categories you have in your game. Questions like where a resource belongs to, and which things can be grouped together topically helped me a lot to think about the design of my game in a way I've not being doing much before. While there were no massive realizations it was nice to go through all existing things and come up with a comprehensive structure, that then became visible in the JSON.

# Game sequence

Probably the thing that broke my brain the most was being forced to really understand the order of how things are happening in the game. For example in my game, I first create a ship, then the rooms in the ship are initialized, then the path network for the ship can be built. Afterwards I can spawn the crew on the path and then initialize their state-machine brains. Lastly I start the world with it's time and day/night system. It sounds simple, but when I first approached this topic I realized how the startup sequence of my game was pretty spaghettied through different systems that would wait for each other, emit signals that others were waiting for etc. Initially I had real problems understanding what drives the startup of my game - even though it worked for the state I was in, I had to understand 100% WHY it worked and while doing so pulled a couple of things straight, removed some globals, changed some signals with direct calls and other things that made it much more readable what followed what when the game starts. Very complicated and painful to tackle, but absolutely worthwhile to do!

# Dictionaries!

This might be trivial for many, but as I said I'm pretty new to being the sole programmer for my game. I did use dictionaries before working on the save / load system, but in all honesty I never 100% understood how they worked. But once you work with JSON you are asbolutely forced to really, really understand how dictionaries work and how they are different to arrays. I now feel much more confident with them, which is a really good improvement to my coding skills.

# Save ... what?

Last but not least, this is probably the biggest topic in terms of a programming feature that forces you to make some game design decisions. What exactly IS saved in my game, and when? Can I save at any time? Or only between levels or at some special points? Being forced to put the foot down in this regard can be extremely healthy to the design of your game, as it is really a fundamental decision that might push your game into a genre that you were initially not anticipating for your game.

document fetched 2026-11-04 00:26 · canonical https://reddit.com/r/gamedev/comments/1xmng6q/some_things_i_learned_when_implementing_a_save