Hi Chris and others,
I'm using Unity 1.82.2 and Unity 6. (I know there are AC updates available, but am at the end of this game's development and don't want to break what's mostly working at this stage).
Am getting my game ready for Steam. Managed somehow with a lot of trial and error to get Steam Achievements working (I think). Next thing is trying to set up Steam Cloud Saves so someone could save their game on eg a PC, and load up the save to carry on playing on a Steam Deck.
From what I gather I need to specify the root and save file extension of the saved games in Steam's backend. However, I can't figure out where the saved games are being created and read from.
I've installed a Mac build from Steam, played it and saved the game, but when I browse local files from the Steam install and check inside the Mac package, there's no saved files there I can find.
Similarly, I checked in the Mac user's 'Application Support' relevant games folder but there's only an old save from something else.
I do remember that it can be a little confusing, that saved games seem to reside on the local machine somewhere, so it can seem during testing that old saved games are being bundled in the new builds, but it's just local saved games that are rearing their heads.
I've read the manual's part about saved games a couple times, and perused these forums, but am still not sure where exactly these saved games files are being stored? Any help would be great here, please.
Another question - I'm guessing cross-platform saved games would work? Ie a saved game on Mac should load up fine on Windows? I'd just need to tell Steam where to look for each platform's saved game folder.
Looking forward to hopefully cracking this nut.
Thanks,
m
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Hmm... I see when Cloud Saving is enabled for a game, Steam creates a 'SavesDir' in the local folder when it downloads the game files. I wonder if the question should be more, if I should be telling AC to rather save files in this newly-created Steam saves directory, or if I should be telling Steam where to look rather.
I tried the game on Steam PC Windows 10, and it looks like saved games are created in:
Users>[Name]>AppData>LocalLow(a hidden folder)>[game company name]>[Game name]
I couldn't find where the saved games are kept on Mac.
By default, save-game files are stored in
Application.persistentDataPath
- a Unity property that changes based on platform.Details of where each platform stores this can be found here:
https://docs.unity3d.com/6000.1/Documentation/ScriptReference/Application-persistentDataPath.html
The other aspect you'll need to deal with is that of the game's Options data - which stores data related to the player's preferences including volume levels as well as save-game labels.
By default, such data is stored in Unity's PlayerPrefs, which is not included in Steam's Cloud Save feature. What you'd need to do is have this data also be a physical file that Steam can sync with.
It's possible to modify how/where AC stores both save-game and options data by specifing a FileHandler. AC includes an alternative OptionsFileHandler that causes Options data to be stored in Application.persistentDataPath as well. You can enable this with the following code:
If you haven't seen it already, the Manual's "Custom save formats and handling" has more details on this topic.
Thanks Chris, I'll keep trying, thanks for this useful info.
Hi Chris - thanks again, this is useful. A question about this please, if I just set up the save-game files to be cloud synced and not the playerprefs/options data, that should work too? I really only have volume as an option, so if that isn't synced, I don't think that's really an issue. Then, the volume will remain unique to the local device, but saved games should work?
For anyone else interested, this in the Steamworks docs look relevant:

Without synced options data, you won't have correct save labels (they'll revert back to their default values), nor be able to switch Profile if you've enabled this setting. But for the default Profile, yes, you should still be able to access the raw list of save-game files.
Hi Chris - thanks. I had another look at the manual - save labels would only be if someone's able to type in their own saved game name? Because I don't use that, I think this should work ok / not a risk of reverting to default values?

Also looking at the manual,and your first comment, it seems like saving options and playerprefs in the persistent path as an actual file is as simple as adding that one line of code?
Options.OptionsFileHandler = new OptionsFileHandler_SystemFile ();
May I ask where/what script that code would be added to please, and I'm curious what new Options files would it create - would they also be .save files, or would the info be saved into the saved game files?
They also include timestamp data. If your save labels embed the time or date that the save was created, then they'll revert back to the current time without the Options data.
Place this in your game's first scene:
They'll use the same extention as your save files - so yes, .save by default.
They'll be placed in the same folder as save files, but separate. One file for each Profile, and a separate file that records which Profile is active.
Thanks Chris.
So, looks like I've got Steam Cloud Saves working cross-platform between PC and Mac.
I first got PC cloud saves working, but what was tripping me up was the Mac save path.
I used an app called 'Find Any File' to search all and hidden files to see where the bbsave_[number].save files were saving to on Mac. They were being saved to a weird folder:
/Users/[name]/Library/Application Support/com.DefaultCompany.2D-URP
So, anyway, I used that in the Steamworks Cloud settings [edit: I think that / should be a backslash \ in the Windows directory, but it works]:

And made sure to check 'Replace Path'. So now whenever the game's played through Steam on either PC or Mac, the saved files get uploaded to the cloud and downloaded next time they're played on either machine. Nice.
Will probably try get a Linux OS working (maybe as a virtual machine) to test that and get that hopefully set up too.
Looks like Linux Steam Cloud Sync also working. Way I did it was to play the game on Linux (Windows installed on a Macbook Pro with BootCamp, and Ubuntu/Linux as a VirtualBox that can run in the MacOS, each with their own installs of Steam), save the game, then use the finder to search for the name of the saved game filename, and point Steam Cloud Sync to look in that folder.

All good tips, thanks for sharing.
Hi Chris, hope all well. I'm finding some odd behaviour when launching the game from Steam - it could be a Steam issue. On start, the game almost always starts with a black screen, and sometimes freezes. I need to Alt-Tab out and back before it runs. This could be Steam Cloud doing its thing, I have quite a lot of conflicts from testing I suppose.
However, I noticed something, that the game only creates a save file for the options, after playing for some time. I'd like that options file to be created when the game starts, in case it's looking for something in the ActionList game start, that's not there. I have the game check in the StartGame ActionList if it's the demo or the full game with a global variable that's saved to the Options file, but if there isn't one that exists, it might be getting stuck.
May I ask please how to add an Action maybe before the Global Variable Check when the game starts, that would make sure that Options file is first saved/created before it looks for it?
Actually, please ignore the previous comment. I see the option file is being created properly at launch. Wasn't able to delete the comment.
I'm almost certain it's a problem with my SteamCloud settings. Having a time trying to get the demo cloud saves to be cross-platform, the main game saves to be cross-platform, AND the saves from the demo cloud syncing and working in the full game. Contacting Steam support for help.
Good luck! It certainly is a lot to tackle in one go, but if you get any tips I'm sure others would find them welcome.
Thanks! I think I eventually got the Mac and Windows demo and full game Options file and Saved Games files all syncing. The way I did it, and I may need to write a full guide to implementing Steamworks Achievements and Cloud Saves, was to edit the company name in the Unity Player info in Unity Project Settings to be more identifiable, as well as calling both the demo and full game the same project name.
Windows seems to insist on creating a sub-folder in its persistent path of the Company name, that's based on the Unity project name.
So, I was getting 'Mikdog/bb_ep1_demo' and 'Mikdog/bb_ep1' folders that the demo and full game was saving into, and struggled to get both those files synced across folders.
Mac seems very happy just using the company name in its Application Support folder, uses the company name (Mikdog) and doesn't create a sub-folder based on the Unity Project Name, so getting Cloud Sync to work between demo and full game on Mac was pretty straightforward.
Basically, by giving both the demo and full game the same name in Unity, I'm forcing Windows to only create one sub-folder to save saved games and options data into between demo and full game, I didn't use Steam's Shared option thing (intended to help with demo to full game saves) as that had some issues (the downside is a person could theoretically copy a saved game from their full game to the demo folder and play the game, but that's ok, would be a weird edge case). Btw I tried leaving out some rooms from the demo build but it caused weird issues with players being teleported to incorrect locations when loading a demo save in the full game, I suspect because it was using numbers for rooms instead of absolute naming links, so suddenly room 9 became room 5. In Steam's backend I map both the Mac and Windows paths to sync with each other. I overdid it here, I think I need just one path for Root and one for Override.
On launching the game from Steam, I'd look in the relevant platform folder and see the Steam_autocloud.vdf and AC ProfileData files being created. Because Steam Cloud would be turned on, it made it a bit of a challenge to remove those files from Steam during testing as Steam kept wanting to put deleted files back in their folders, so there's a process of turning Steam Cloud off for a game, deleting the local saved files etc., relaunching the game from Steam, closing it, and then turning on Steam Cloud again so Steam thinks that it shouldn't download the old saved game files and options data from the cloud.
There's also a way to reset Steam Achievements for a game, useful when testing:
In a browser, type in the search bar:
steam://nav/console
That'll open the console in Steam. In the Steam console, type in:
reset_all_stats [SteamAppID of the game]
Restart Steam client to be sure.
That Steam Achievements script on the AC Wiki page is great btw, makes it a pleasure adding a Steam Achievement unlock in an ActionList as a regular custom action.
Anyways, been keeping notes for all of this.
To make life easier, in the Unity build I literally change one global variable between the demo and the full game, in the ActionList that plays on the game's start in the Settings menu, I SET the variable to full game or not - if it's the full game, then a bunch of global variables (those variables would have been saved to the Options data and not saved game data) are checked to see if a player has earned any of the 14 Steam Achievements that they may have earned during the demo, by earning them in the demo they would have switched the variable switch to ON but they wouldn't have actually earned the Achievement, that only happens in the full game, and if so, they unlock that achievement when the full game starts. There's no risk to repeating this procedure every time the game starts, as an achievement can only be unlocked once on Steam's end. The reason for this is so the player can load up their saved game from the demo, into the full game (which would happen automatically with Steam Cloud Sync as both the demo and full game saved their saved games and options data into the same folder), and reclaim all those Steam Achievements that they did but didn't get in the demo.
And at the end of the demo, during an unskippable cutscene, the actionlist that plays checks if it's the full game or not - if not, it goes to an end screen for the demo, where I use another great script from the ACWiki to put clickable links on the screen to Wishlist episode 1 or 2. The link's as simple as adding this link in the script's custom action in the actionlist:
steam://store/[appid]
And it opens up the game's store page in the Steam client.
I may want to at some point add another global variable, Steam or Not, to more easily make a non-Steam game build for eg itch.io. Someone on these forums suggested something similar. But I think even removing the SteamManager from the Persistent Engine Prefab might be enough to stop the game from trying to open Steam every time it plays, and prevent the game not running when it can't do so.
Anyways, getting closer to a demo release, thanks so much for your valuable time and help on all of this!
If anything, a guide will help me remember all these steps, as much for my own sake as I'm sure I may forget a lot of this for the next one.