Save files being erased

Discussion and help for Easy Save 3
Post Reply
bobby
Posts: 2
Joined: Sun May 22, 2022 8:15 pm

Save files being erased

Post by bobby »

Hi there, I am having users report that their save files are being lost randomly. It seems to happen randomly when upgrading to a new version of the game, or just if the game doesn't load right all of their progress is lost.

When my game loads I do a load of the save file, and save periodically through the game and when the game closes. I'm thinking that sometimes if the game crashes it saves a blank version of the save file over the existing one.

Could you please share the best practices around loading and saving data to make sure I don't overwrite existing data with a new save file?

---

Second question, could you please clarify how to save the save file as text so I can post it to a web URL and have it saved in REDIS as a string?

I saw the example on it but I'm still confused how to get my existing save file as a string and then how to replace current values with values from a string if the player loads their data from my server?

Thanks
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save files being erased

Post by Joel »

Hi there,

If data is being lost when performing an update it would indicate that the app has been given a different identifier, meaning the operating system considers it a different app and has allocated a different persistent data path. If you wish to keep data when updating the OS requires that the identifier remains the same.

For cases of data corruption, I recommend using backups (see https://docs.moodkie.com/easy-save-3/es ... s/backups/ ) and restoring if an exception occurs. I also recommend ensuring that you’re using the latest version of Easy Save as we have added checks which man that some forms of corruption or failure can be handled without extra effort for yourself.

Regarding saving and loading as text: you use ES3.SaveRaw to save a string as a file and ES3.LoadRawString to load a file as a string.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
bobby
Posts: 2
Joined: Sun May 22, 2022 8:15 pm

Re: Save files being erased

Post by bobby »

Thanks for your help, I'll implement your ideas.

When updating versions I never change the bundle ID, is that what you mean?
User avatar
Joel
Moodkie Staff
Posts: 4826
Joined: Wed Nov 07, 2012 10:32 pm

Re: Save files being erased

Post by Joel »

bobby wrote: Wed May 25, 2022 3:39 amWhen updating versions I never change the bundle ID, is that what you mean?
That’s correct. If you bundle ID definitely isn’t changing, then this won’t be the issue. If it’s not happening for all users this is also a sign this isn’t the issue.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started
Post Reply