Where do NWjs Save Games and Local Storage reside? (for Steam's auto-cloud)

0 favourites
  • 12 posts
From the Asset Store
"Easy Local Notifications" enhances games with customizable local notifications.
  • I'm trying to setup auto-cloud on Steam.

    Valve backend is pretty clumsy and patched together. However, it is what it is!

    That said, I'm finding it difficult to set up a newer feature called auto-cloud to allow players to switch computers and have all their save games and local storage transferred over.

    afaik we have no control over where local storage is saved to and the same goes for game state saves. but I'm wondering if I can point to the location from Steamworks, if I can find that location!

    Here is the interface. I don't see how I can set a directory to make Local Storage save to.

    any suggestions would be helpful. Thanks!

  • That directory is pointing to where the game is installed via Steam.

    [SteamInstall]/SteamApps/common/GameName/SaveDir

    I can change it to any path I want.

    but when I navigate to that folder all I see is:

  • oosyrag

    Thanks, I couldn't find what they were talking about in that post I think because it was iOS, but I tried out these...

    NWjs.AppFolder tells me where the .exe is

    NWjs.ProjectFilesFolder points to a temp folder (this could be it)

    NWjs.ChosenPath&newline this is blank!

    NWjs.UserFolder this is just the user folder

    however, Andre on Discord mentioned

    /AppData/Local/{GameName}/User Data

    which has many folders and files and they told me this was it... but I can't tell what "it" is.

    I need to point Steamworks to a location where the save data is and the fact that is outside of the steam install I don't know how to reference it. So I need to make my own folder inside the install folder.

    but I don't know if I can do that. Andre mentioned potentially using Write Binary and using a Binary Data object?

  • oh I just found out how to reference through Steamworks the WinAppDataLocal directory... so if that is in fact the save game and local storage it should work!

  • Sorry I wasn't really familiar with the details myself, I just found that and it seemed like a good place to start looking.

  • For my game, if they're on Windows, I make a folder with my game's name and put it in their user's documents folder. Then I save in that folder.

    I think most games seem to save in the player's documents folder.

    I use the NWJS extension to do this.

    I'm guessing Steam cloud could then use that save folder to keep synced?

  • alastair

    do you write to Local Storage and use the Save Game state in your game?

    How do you get it to save to this folder? Or are you saying you "write to binary" and load form it as well?

  • I don't recommended saving the local storage directory directly.

    It contains lots of files and they are user/browser based and possibly won't work well for syncing.

    I write the save data to the "current user document directory\gamename"

    You can get the url to that with the NWjs plugin.

    I simply write it with the "write text" action of the NWjs plugin, never had any issues (my save files are usually under 1mb).

    Though that was before the binary plugin was released, so it's probably safer to use that (especially if your save data can get very big).

  • Ashley says that saving to the game's directory is not good practice because of permissions issues.

    Therefore, I do what normal games do and save to user's documents folder.

    Yeah I just use the "write text" action too for saving files.

  • ah okay good to know!

    I wonder what the best way to transition over, since the game is now released and I don't want users complaining of losing progress.

    I suppose I could look for local storage items and if found transfer them to a new save location, then remove the local storage items.

    System>Save Game though, not sure how I get around that. This is less to do with overall progress and just a way for a user to pick up where they left off mid-game. So maybe its okay?

    However I would love for a user to be able to quit the game on Boss 4 on their desktop, go away for the weekend with their laptop, open it up and hit continue and they continue from their game from boss 1. I probably can do without System>Save Game since its a turn based game, I could probably remember the and setup the same state, but Sys>Save is just easy.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It really depends on your game.

    If you just need to save some variables to restore the state, use a dictionary/json/array and save that to file.

    If your layouts changes dynamically with lots of objects changing states, use the save system.

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