I am trying to set up cloud saves in order to release my game on steam, but in order to allow multiple different users to have their own save work properly with steams cloud system, i need to be able to differentiate the saves. The only way to do this is to place the saves into a subdirectory named to the current users ID.
I have looked around, and short of a few 5-year-old posts with no responses, and one that requires me to edit the source (which i’m absolutely not comfortable doing), there is basically no information on what I can only assume would be such a simple thing to be able to edit…
Can anyone help me out here? Is it possible for a pure blueprint user like myself?
That is how i have been doing it, but then if two users each have a save game, there is no way to choose the correct one on steam cloud system without them being inside a subdirectory using the users ID
Unfortunately not. You are able to get the users ID and use it in the directory ,but not the actual file name its self, which is why id like to be able to place each users save into a directory named after their ID.
ok so in my game, i have 3 save objects per user. They are named steamid[profile] , steamid[Replays] and steamid[settings]. By default, they get dumped into the same folder as any other user who also plays the game. When setting up steam cloud services, you have to select path of the save game files and the name of the save game files. I could use a file name of “*.sav” to pick up all files of type .sav in a directory, but steam does NOT allow you to use the users ID in a file name search. They allow you to use {64bitsteamid} as a directory, but not in the file name. So in order to pick up the correct users saves, i would need to save the files into a directory with the name as the users ID so that i can use a path directory something like: %USERPROFILE%/AppData/Local/GameName/Saved/SaveGames/{64bitsteamid}
I have a game on Steam. I have configured it for cloud saves. My save game files are named after the slot in the engine. I have several just for one user, but I could name them anything I want, like the playername for example.
Is your problem because you named them [steamid]*?
Ah… when I say player name, I mean a name that has been selected in game. I think that’s the source of confusion…
How do you specify the files for your saves on the steam cloud setup if the file name can be saved as anything?
My issue is that i use the players steam id in the save slot name, so if multiple steam users play the game, then there is no way to specifically pick the correct users save file because steam doesnt allow you to use the players steam id as a variable when choosing the save file in the settings.
Only the directory path can use the {64bitsteamid} special variable…
So if 2 steam users decide to play your game, you are essentially screwed because steamcloud will just choose the first save it finds in the folder… which is the problem i have been trying to explain for the past 5 posts… xD
In order to actually specify which users save to pick up, you cant simply save the file to %USERPROFILE%/AppData/Local/[Gamename]/Saved/SaveGames and expect it to pick the correct users save because there is no way of specifying the users ID in the file pattern.
In order to allow multiple steam users to play the game on the same PC, and also allow their saves to use the cloud services, the saves must be stored in a subdirectory with the users ID as the folder name so that the {64bitsteamid} can be used in the directory string like %USERPROFILE%/AppData/Local/[Gamename]/Saved/SaveGames/{64bitsteamid}
Each steam user has their own cloud, it’s not one big cloud…
We’re really not communicating here, eh?
I know, for sure, with what I have, I can store different save games for each player. As long as they choose a username through a widget ( or whatever ), we’re set. All on the same PC.
Say I use my PC and choose username Clockwork, and you use my PC, and choose username Hairy. Then the code can use slot names:
Clockwork.save
Clockwork.extra
Clockwork.config
etc ( and, externally, Clockwork.config will be stored in Clockwork.config.sav ).
and you will automatically get assigned slot names:
Hairy.save
Hairy.extra
Hairy.config
All files in the same folder, no confusion. I can load the right stuff for the right user. Everything gets copied to the cloud.
If the different Steam users user different Windows usernames, it’s a bit better, but if doesn’t really matter. If they use the same Windows username, it just means that you can see my save games…
so what you are saying is, if i play a game and create the save file Save1.sav, and then my friend logs into his steam account on the same PC, and creates the save Save2.sav, I should just use *.sav and accept that each user will also be carrying around other peoples save files in their users cloud?
Steam requires you specify the number of save files permitted and size allocation per user. Am i just supposed to make up a random number to account for an unknown number of extra player save files just to ensure that the correct save file is also picked up for any given user on a single PC?
I have a replay save file that can get pretty bulky. Am i supposed to just carry around an unknown number of other peoples replay data that i then have to upload and download each time i launch the game?
The point im making here is yes, i could have just used *.sav and called it a day, but that will almost certainly result in a cloud save failure for at least one user, and thats not acceptable to me…
Which takes me to why i posed the original question the way i did. Adding a subdirectory into the savegame folder using the players steam ID, i can be absolutely certain that i am getting the exact files (and ONLY the exact files) i need 100% of the time. And this also allows me to set the allocations correctly ,since i know exactly how many save files there are per user, and i have an idea of how large a single users save files will become.
I DO NOT know how many files to allocate when i have X number of users on a PC and i have to pick up everyones save files…
Sigh… I thought we had already established that i am ALREADY using the steam ID in my slot name file, and i have mentioned on multiple occasions now that you CAN NOT used the {64bitsteamid} variable inside of the file pattern when setting up the cloud saves. you can only use it in the directory.
About the 3rd or 4th time i have said this in my past posts…
Yeah sorry I did miss the correction. I think if there isn’t an easy solution to this, which there doesn’t seem to be, then I may end up just having to use the catch-all method. Not overly happy about it but its not the end of the world i guess
I think in this scenario you would need to handle this in C++. I know thats not the ideal solution you’re looking for, but it could be done exactly like what you are needing, using that approach.
I am trying to implement same thing in my project, and I just noticed in 4.27.2, when you call SaveGameToSlot node in blueprint, if you embed path of the subfolder to the parameter ‘SlotName’, the system would take care the rest for you.
For example, if your save file name is ‘PlayerProgress.sav’, normally you would put ‘PlayerProgress’ to the SlotName parameter, and the ‘PlayerProgress.sav’ file will be generated in the default save game folder.
But if you put ‘\steamID\PlayerProgress’ to the SlotName parameter, the system will create a subfolder named ‘steamID’ under the default save game folder and save the ‘PlayerProgress.sav’ file in there for you.
Haven’t tried this in 4.25, so not sure if this is supported in 4.25, but worth a shot.