• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Simple (& Advanced) DS Map based Save System

J

Joshua Allen

Guest
Boss 101 used this method for saving but our saved game data was prone to becoming corrupted. Ever since we moved over to using an ini file with a ds_map as a cache, there hasn't been any issue with corrupted saves.

I’m not saying that using a map to save your data is bad, just some care needs to be taken when using them.
 
J

Joshua Allen

Guest
This was about a year ago so I might not be remembering this correctly but I think it was loading some keys with garbage data and the rest of the keys were missing.

It was a really good lesson in debugging because I assumed that the map was always saving and loading correctly. It took about a month for me to pin the bug on the map because it was never the same error twice.

I do want to do some testing to see if we can move away from the ini file before launch but it’s hard to find time for it given that what we have now works so well.
 
A

Ariak

Guest
Just as a little warning about ds_map_secure_load. It will only work on your pc!
Imagine releasing your game on Steam. Your player decides to get a brand new PC - we're all used to the games + saves porting over, right?
However, if your player now tries to load his old save files they do not load correctly into the game.
 
  • Like
Reactions: Mut
Just as a little warning about ds_map_secure_load. It will only work on your pc!
Very good point. To avoid this, instead of using ds_map_secure_save and load, just use ds_map_write and read. This will convert the ds_map to a single string that can be written to a simple text or ini file. The data is still fairly obscured and not easily editable, and that's the only change needed to the system to support cloud saves, I believe.
 
After getting lots of questions about how to save dynamically generated objects and multiple properties. So check out the new video to take your save system to the next level.
 
Top