New File System: Sync Saves via Steam-Cloud

0 favourites
  • 10 posts
From the Asset Store
Kids Game
$49 USD
New Sounds Added Update: 115 new sound effects added for no additional cost!
  • Hey everyone,

    I've been working on save game system that works with Windows WebView 2 Export. Instead of saving everything to a single file, I thought it'd be smarter to use 3 files:

    • save1
    • save2
    • save3

    Each time a player saves, the game cycles through these files. This way, if something goes wrong -like the player gets stuck or a save file gets corrupted — they have 2 others saves.

    It works fine during gameplay, but I need to figure out which of the three saves is the most recent when I sync and load the game across different devices using Steam Cloud.

    Is there a way to identify the latest save file? Is there a method to sort these files by their last modified date within Construct 3?

    Any advice or suggestions would be greatly appreciated!

    I have prepared a file where you can check my code:

    https://drive.google.com/file/d/1pTDrkZZD7mdk1mPnu6Bb0YDQRQ1krTEN/view?usp=sharing

  • A simple solution would be to store the last used save slot in Local Storage, and make sure the one stored there is shown first.

  • Thanks for this, Ashley, that is simpler and more elegant. However, this solution only works on my PC. If I play on my Windows PC and then switch to Steam Deck, it won’t work because Local Storage is device-specific. So I need a way to determine the latest save if I use Steam Cloud to save game across devices.

  • I think you could argue that's minor enough to not worry about - there are only three save slots after all - but you could still support that by saving a fourth file to store the last used save slot, and Steam Cloud will sync that too.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I usually have a user settings save file with stuff like keybinds, volume settings etc. as that type of data should persist across different saves and across deleting saves. It would be a good place to store the last used save too.

  • Hi guys, thanks for the directions! Yeah it is a good idea storing the information in a separate file that can be synced between devices. I have checked with Steam Cloud and it works. Thanks, that was super helpful :)

    Here’s the file for everyone to see how I did it:

    https://drive.google.com/file/d/1pTDrkZZD7mdk1mPnu6Bb0YDQRQ1krTEN/view

  • I thought this picture might be helpful for anyone trying to configure Steam Cloud between a Windows PC and a Steam Deck:

    It is working fine together with the code of my sample file above.

  • Thanks for sharing, so to use Steam Cloud we can't use local storage, is the same true for simple save and load? When using save the save goes to the appdata folder, could that be ok?

  • You can save and load to a JSON string, which allows storing it the way you prefer/need. So that way it's easy to integrate built-in save and load with steam cloud.

  • You're welcome! And yes, that seems to be the way to do it. As fedca said, it works like this: you can save to a JSON string, and then you can save that JSON string to a file on the computer. That file will then be synced via cloud save.

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