How to maintain save game compatibility with newer game versions?

Hey Guys! I was wondering if there is a “proper” way to make sure that old save files are able to be read by newer game versions. I know that whether you are using custom binary save or SaveGame classes, if you completely change what data is needed to be saved and loaded, you will likely invalidate all save files from previous game versions. Could anyone give any insight on this? Thanks!

1 Like

Bump. Any info?

wow, ok :smiley:

In general, it’s probably best to create a save game structure that doesn’t invalidate old files, and can handle filling in missing information, for when you add new data.

For major changes, I would go with implementing something like what is done for database migrations. When you change your savegame file from v1 to v2, you create a function that converts v1 data to v2 data. When you change your savegame file from v2 to v3, you create another function that converts v2 data to v3 data. Do that for every change in which you cannot reliably read the old data. Then, when a player tries to load data from v2 into v54, you run each function from V2ToV3 consecutively up to V53ToV54, and now you have a current save game data file.

1 Like