How do I make one save/load procedure that can work for all platforms ?

0 favourites
  • 7 posts
From the Asset Store
A pack of 76 platform designs for a platformer game with a mushroom/jungle theme
  • Hi Guys,

    I would like to know if there a one specific save/load process that can work on browser, steam, android and app store versions ? My game only need storing a couple of global variables and to be able to clear saves from within the game.

    As I understand from documentation I can either use a simple save/load commands for store full state of the game or use local storage commands to store specific entities. Since I am unable to clear the game saves from within the game I feel like using local storage is better as I only have to store few global variables. But before I implement I would like to ask your wisdom to guide me to a procedure that can work for all types of game publishes.

    This could be a total noob question as it might not be possible due to architectural differences between each platforms, but wanted to put it out there just in case I am missing something.

    Thanks a mil for the support.

    Tagged:

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • For storing a few values definitely go with Local Storage, it works on any platform. I have a simple example:

    howtoconstructdemos.com/easily-save-multiple-values-in-local-storage

    Note, that it's local, which means that the save will be lost if players uninstall your game or clear browser data in a browser version.

  • Thanks for your reply dop2000.

    You had mentioned that the save data will be deleted if players uninstall your game or clear browser data in a browser version. Is there any alternate way to be able to preserve the saves if user choose to ?

    I am currently using the save/load feature which is working fine, except that I am unable to clear or include a new save. Using the 'no save' behavior I can optimize what gets saved but unable to clear the save data from within the game doesn't help. Also I realized that if I publish new version of game with a different name for the save, then the user playing this new version of the game will not be able to access previous saved data, and will be forced to play the game from the start.

    I will look at your example and see if I can avoid above mentioned issues.

    Thanks

  • Is there any alternate way to be able to preserve the saves if user choose to ?

    In NWJS export you can save game to a disk file. But if you need a cross-platform solution, then I think the only way is to use some cloud service like Playfab or Firebase.

    I am currently using the save/load feature which is working fine, except that I am unable to clear or include a new save.

    It's not possible to delete a saved slot. What you can do is use it in combination with Local Storage. Save a flag in Local Storage - "GameIsSaved=Yes/No". On start of your game load this flag, and if it's "No", then simply ignore the saved slot, don't load it.

    Also I realized that if I publish new version of game with a different name for the save

    Why do you change the save slot name? Unless you've made significant changes to the project, the old saved state should be compatible. With Local Storage you should also use the same key names when publishing a new version.

  • Thanks Dop2000. I tried to use your example c3p file. I couldnt find the 'Storage data' object type in my available object types. I am using r260 version. Not sure if this is a 3rd party plugin.

    By the way thanks for sharing your website link. It has many good tutorials.

  • That's a dictionary. Add a new Dictionary object and rename it to StorageData or some similar name.

  • Oops! Sorry for my noob question. This is my first adventure into making a game :)

    I have implemented the save based on your example file. I was able to save and clear the variables. It worked on windows Chrome browser and on ios Safari. Thanks a mil dop2000.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)