Forum rules - please read before posting.

How can I tell what save file is furthest along in my game? (for cloud sync)

Hi,

Is there a way to determine the progress that has been made in a game through the save file itself?

I'm working on an iOS game and need to use cloud saves along with game progress synchronization. It compares save files in the cloud and on device and tries to determine which save file has the most progress and will use the one where the player is furthest along in the game. I can't use the date of the file since someone could play offline and create a save at the beginning of the game. Any suggestions would be much appreciated!

Thanks

Comments

  • A bit tricky. Off the top of my head, you have a couple of options, but both would require custom scripting and essentially involve checking each save file in turn to compare.

    1. If you are setting custom save labels, you could set the progress within the label itself. Custom save labels can be set through script, or by using the Save: Save or load Action. To get a save file's label, call:

      AC.SaveSystem.GetSaveSlotLabel (0, X, true);

    Where "X" is the ID number of the save slot. You'd have to iterate through each available to get all labels.

    This may be problematic when using cloud saves, however, because these labels are actually stored in the PlayerPrefs, as part of the user's profile data. It may be that these could become de-coupled during the cloud save process.

    1. Alternatively, you could open up each save file and read the value of a Global Variable which is reserved for denoting this progress. AC already does something similar for its "save importing" feature, whereby save files from another project can be loaded in provided that a particular Global Boolean Variable has a saved value of "true".

    See the SaveSystem script's DoImportCheck function for this example, which takes a file's raw data, deserializes it, and checks the value of a given variable.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.