How do I work with Steam Cloud + Local Storage?

0 favourites
  • 11 posts
From the Asset Store
_______ Huge collection of metal fixtures ________
  • Hello!

    How do I manage the Steam Cloud, using Local Storage on my game? (to be more specific, where's the save data path of C3 Local Storage?)

    I thought that the local storage stored the data in the following path:

    %USERPROFILE%/AppData/Local/MY GAME/User Data/Default/Local Storage

    Resulting on Steamworks:

    Root: WinAppData

    Subfolder: MY GAME/User Data/Default

    Default: *

    But I did some tests with a Pen Drive, and the save is only recovered after passing the entire Default folder.

    Is there a specific folder inside it, which stores only the Save Data, so that I don't pass useless files?

    Thanks!

    Tagged:

  • Local storage is saved in the browser's cache file I believe, which in a steam games case would be the nwjs wrapper cache.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • No, the game is loading the save file on "Default" folder, on this patch. I have tested by oppening on Steam in two computers.

    But the Deafult folder has too many files in it, probably not all related of Save Data.

  • Just a warning, depending on local storage to stay the same in nwjs could cause problems (this is what has happened in the past with nwjs upgrading/changing local storage): construct.net/en/forum/construct-2/general-discussion-17/change-web-storage-directory-108793

    Since you are using nwjs (or something similar), how about saving your data (via JSON or dictionary to text) to a file that you directly control into the users directory under your game name or some other known location which will only have the files you want. You can then point Steam at this directory to backup. You can use the nwjs plugin ACEs to write files to the directory of your choice, you can also create directories, etc.

    construct.net/en/make-games/manuals/construct-3/plugin-reference/nw-js

    (My Greengrinds Steam plugin also has methods to save directly to cloud, but I don't think that's necessary in this case.)

  • That way the save will be a just text file?

    It's the same manner I get a .json file, read, and put this data on a dictionary, but inverse way?

    It's an idea.

    But I think it would cost me a lot of time to make the change, and it would be extremely simple to manipulate a text file with exposed variables.

    I'm using Construct 3, so I believe that if I keep Chromium Exporting in the same version, I don't risk the saving folder change. But I don't know how NWjs is going to work exactly on C3.

    Your plugin has interesting functions. What cloud does he use? I can use it in a mobile game

  • It sounds like it's too much work, but if I was worried about easy/simple manipulation of text files I would do some light encrypt/decrypt in C3 (determined hackers would get around this.)

    My plugin is for Steam, so it saves to Steam cloud, not typically good for mobile (I would use Playfab for mobile, but there are many other options out there.)

  • No problem about "determined hackers", but I don't know how to do this encryption anyway. It's a good idea for a future game, if I can learn that.

    I've been studying about Local Storage, and looks it's works different for each browser (a different local save local for each one). But on NWjs it's a general path. I couldn't locate this yet :(

    In "IndexedDB" folder are located some files related, but idk if this was make by NW.js or just the browser preview...

  • I think it's confirmed. NWjs is saving to the IndexedDB folder. Testing by deleting this only folder in middle of another files.

    I also found this topic that teaches how to make a "copy" of the save in a custom location, but using the default "Save State", not Local Storage.

    construct.net/en/tutorials/save-load-game-specific-1054

    Anyway, it is likely that I can do it in a similar way if necessary, or just save the "array save content" in a file with NW.js plugin.

    Thanks Mikal for your suggestions, I'll probably work on this way and test your plugin on future :)

  • You are welcome, it sounds like you came up with a good solution.

    If you are interested in C3 encryption, check out this C3 project from macube:

    drive.google.com/file/d/1gZczxGAyAcZQMlCFbAQCEggiMKlllozw/view

  • I think it's confirmed. NWjs is saving to the IndexedDB folder. Testing by deleting this only folder in middle of another files.

    I also found this topic that teaches how to make a "copy" of the save in a custom location, but using the default "Save State", not Local Storage.

    https://www.construct.net/en/tutorials/save-load-game-specific-1054

    Anyway, it is likely that I can do it in a similar way if necessary, or just save the "array save content" in a file with NW.js plugin.

    Thanks Mikal for your suggestions, I'll probably work on this way and test your plugin on future :)

    Friend, were you able to use steam cloud together with local storage?

    I've been trying this all day and here he doesn't read the files in the cloud.

    By the way, I would like to give you a tip (I intend to follow her soon)

    2 users of my game, reported problems with the save system not working. Both manual and automatic.

    I was never able to reproduce this bug, but I am studying changing the save system, as I believe that these users may be having problems with the way the local storage works.

    However, I can't do that today, so I would like to make steam cloud work with local storage. Can you tell me how you did it to succeed?

  • xahdy My Steam Cloud it's not working yet, I found some miss configuration on Steamworks today, probably it's working now, but I haven't test on other PC (I looked on Steam game and now there's files uploaded).

    Can you show how you configured?

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