• Hey! Guest! The 39th GMC Jam will take place between November 26th, 12:00 UTC and November 30th, 12:00 UTC. Why not join in! Click here to find out more!

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.
 

Ariak

Member
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.
 
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