We think ES2 is fantastic. We’ve come across something curious which might be down to our programming and we’re not quite using ES2 correctly.
When we try out our game on a iOS device, we can manage to wipe the save data by quickly closing down the game (instead of suspending the game). In our code we are saving 15 pieces of data e.g
Code: Select all
lifeTime = ES2.Load<float>("rghsaves.txt?tag=lifeTimeSV");
Our theory was that the game was removed from memory quicker than ES2 could save, however that seems odd as the file is only 2kB! We haven’t replicated it on an Android device but it’s a slightly slower process to exit a game, which is maybe enough time to save.
So rather than being a ES2 issue, we thought perhaps we should be saving 2 save files. One for when you change scenes, pass a level, OnApplicationPause etc and the second for only OnApplicationQuit(). That way, there’s good chance if one file corrupts, the other may be up-to-date or slightly behind.
So our long winded question is have you heard of this issue and is our suggestion unnecessary and daft?
Kind regards
Richard@Option 4 Studios