Guidance Please - Retaining game files post App Store upgrade releases

W

WorkingSolutions

Guest
Hi All,

I am seeking guidance around the best process to use to ensure game files are not lost (i.e. they are preserved as is) after game updates are built and released via the App Store or Google Play.

My efforts to find / research this haven't been fruitful - hopefully I have just missed and someone can point me to a link.....

For my game, I utilise a file for :
- IAP - status of purchases etc,
- a game configuration file - handling various control states in game and;
- a local high score file.

All files are DS_MAP structures and utilise ds_map_secure_save / load capabilities. All pretty standard.

So how do I ensure game files are not lost by an App Store bundle release?

Thanks
Dan
 

Bingdom

Googledom
"Included files" are packed inside the apk as is.

Be careful though, if one of the included files is saved as ds_map_secure_save, only the device that generated that file would be able to load it (it's non-transferable).
 
W

WorkingSolutions

Guest
Hi Guys - so my original post maybe a "Rookie" one, and I don't specifically have an issue yet as I am still finalising my game for App Store / Google Play. I'm 2 months into the journey.

I just want to ensure that when I need to release updates through those platforms - my players files (IAP/cfgs/highscores) will not be lost / overwritten by future package releases. More importantly that I don't need to do something special in the first release (or my coding now) to avoid a problem down the track.

I followed the documentation for IAPs (which was extremely helpful and clear) - https://help.yoyogames.com/hc/en-us/articles/360002368731-iOS-Setting-Up-IAPs - essentially in summary, user files, here IAPs, are initialised for first time usage ...should the player file not exist then it is created / saved with ds_map_secure_save's. Ongoing updates to these files are managed using ds_map_secure_save.

So, by way of example, if I run a build targeted for IOS, and I do not include my local copies of these save files in the build, then what happens in this use case:

Release 1: Player uses the game, I generate game files using ds_map_secure_save - these are stored on Players device in "Save Area" - all good; then I need to release a revised package (bug fixes etc)
Release 2: Player downloads the new game, and what happens to files generated and stored in the Players "Save Area" from Release 1? Are these files retained? And is there anything special I need to do within a release (or my coding now etc) to ensure they are retained.
Thanks - your insight is appreciated.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Okay, two things:

1) When you include base save files they are stored with the Game bundle on the device. When they are modified by the user, the modified files are stored in the Local Save area for the game. So, updating the game will change the files stored with the game bundle but should NOT change the files in the Local Save area, and GMS2 should always look there first when running the game, before looking in the Game Bundle. So updating your game should not affect any locally saved files.

2) On iOS, it is obligatory to have a button that calls the "iap_ev_restore" function to restore IAPs. In this way, you can re-add any purchases should the user have uninstalled the game and re-installed, or otherwise have lost the save game. So, even if the save file reverts to the default, this function can help you recreate it.

Note that when testing, GMS2 may remove ALL the save files between runs of the game, especially if you clear the compiler cache before building, but when published updating shouldn't do this.
 
W

WorkingSolutions

Guest
Thanks Nocturne - that really helps clarify expected behaviour. Appreciate the heads up on the Restore button too.... Cheers Daniel
 

FrostyCat

Redemption Seeker
What makes you think they are being (or will be) lost?
Because if the runner implements the sandbox improperly, the save files could be put in a place that will shift or clear between updates.

Here's an example with Unity having the identical issue and examples of people trying to work around it: https://forum.unity.com/threads/save-file-gets-deleted-when-updating-on-android.388043/

Unity's default implementation of the save directory (equivalent to working_directory in GML) is causing lost files between updates. Is GMS 1.4 or 2.x's any better? This is a discussion that YoYo needs to have, or disclose if the discussion did take place.

As developers who may be asked questions like this by end users, we need to know how working_directory is implemented in the Android runner. And if it is in a place where data loss can happen between updates, that needs to be reconfigurable and the sandbox needs to be widened accordingly.
 
Top