When I released my fist Steam game, I wanted to add cloud save support, so you’d be able to pick up the game and continue playing on any platform. Googling for how-to guides only turned up forum posts from gamers talking about it from a user perspective, and most of the Steamworks guides I watched on Youtube glossed over this feature. Eventually I did find the cloud save section in the Steamworks documentation (shoulda looked at that first maybe, huh), but still, like most things about Steamworks, their explanation was a bit more complicated than I feel like it needs to be.
My save system in Unity writes savedata files to the Application.persistentDataPath shorthand, which means on Windows the files will be stored in:
And on Mac they’re in:
For this guide I’m going to assume that is your situation too (and I’m going to assume that you even have a save system implemented in the first place!). If that is the case, you don’t have to do anything further in Unity to get this working.
Here’s a quick breakdown of what you’ll need to do:
- Log into your Steamworks account, then in your list of games, click App Admin.
- Then click Steam Cloud (it’s under the Application dropdown in the top left).
- For Byte quota per user, enter 10000000 (= 10 mb, enough for most save files probably).
- For Number of files per user, enter 10 (again, seems like plenty).
- Scroll down to the Steam Auto Cloud Configuration heading, and add two new Auto Cloud paths.
- Click Edit on each of them, and set the first one to WinAppDataLocalLow, and the second one to MacAppSupport.
- In the Subdirectory field, enter the <CompanyName>/<GameName>/ part of the full savedata path I mentioned earlier. This will of course depend on what your company and game are called. These variables are set in the Unity project settings. For me it was Hedgefield/The House On Holland Hill/. If you do it right the preview below the field should display the full savedata path (again, for me it reads Preview: %USERPROFILE%/AppData/LocalLow/Hedgefield/The House On Holland Hill/)
- In the Pattern field, enter the file extension you gave your save files. I used .save for mine.
- For OS, set the first one to Windows and the second one to MacOS.
- Click Update on both, then Save at the bottom of the page, then move over to the Publish tab to publish these changes.
If all went well you should now have support for Steam cloud saves! If you have a build uploaded to Steam already, open an close it one time to trigger the first savedata upload, then to test, and you should be able to load the same save data on a different machine too.