I’ve been developing my game Shard Seekers full time since late 2015. One thing that’s been worrying me more and more over the years is the fact that I need to support my game’s current binary format forever. I need to be able to experiment with new systems / features without committing to them forever for my game to succeed long term; I’m just too hesitant to add new types of content to my game because of this.
Some way to iterate over millions of DataStore keys and process them would be a relief. I’m ready to leave a computer running for months / years and pay for the overheads if I need to. Some way to download a list of all keys in a DataStore, or keep track of a meaningful position when iterating over them would be needed for this to work for mid-size games. Adopt Me sized games would probably need a distributed solution that utilizes game servers.
It might be possible to achieve something like this by storing player user ids with save timestamps in an OrderedDataStore and iterate starting from the oldest saves, but that ship has sailed.
My game’s save system is set up so I can load a save regardless of if a player is present, and migrating a player’s data would look like this:
- Load the data
- Deserialize the data from a string to the game representation
- Serialize the game representation to a new “migrated” string
- Deserialize this new migrated string to a second game representation (to test stability)
- Verify that these strings are the same (to test stability)
- Save the data
I know I can migrate data safely. What’s unsafe is supporting old save formats without doing unit tests on old saves.
I’m okay with having if saveVersion < x
in my code to support changes to the save format; this is fine and makes sense for short term changes. What I’m not okay with is the fact that my codebase will irreversibly grow long-term and become more difficult to maintain every time I increment the game’s save version. I could skip everything except currency purchases and start fresh, but I would feel horrible deleting everything players have created, especially when it could just be possible to migrate that data to a new format.
From a maintainability perspective, my problem is that any mistakes when modifying and maintaining legacy save code would be catastrophic for players who come back to the game after a long time, and save stability is extremely important. I have a huge collection of old saves that I run stability tests on before I publish the game for this reason; These test saves bloat my save file, and this testing process will only get slower as I make more changes and need to add more samples to it.
Here are a few examples of old code that I still need to maintain:
It’s easy to make design mistakes early in development, and right now DataStores are simply unforgiving.