Hi Tony,
We're trying to understand how to set up Steam cloud saves, but we're having trouble understanding where exactly our game saves save files. We see a game path at 'C:\Users\Me\AppData\LocalLow\Company\Game' but all that we've found in that folder is a 'Unity' folder, a 'Player.txt', and a 'Player-prev.txt'.
We use the PlayerPrefsSavedGameDataStorer and the Save System components on our DialogueManager gameObject, and we use SaveSystemMethods.SaveSlot(0) to save Dialogue Database values to slot (we only have 1 save slot).
On the Steam cloud setup I need to put in a location on a user's pc where the game files would save, so I was curious where the DialogueSystem serializes and saves the data on disk.
Thanks!
-Nik
Steam Cloud Saves
Re: Steam Cloud Saves
Hi Nik,
PlayerPrefsSavedGameDataStorer stores saved games in PlayerPrefs, not directly in disk files. On Windows, for example, Unity stored PlayerPrefs data in the Windows Registry.
Remove the PlayerPrefsSavedGameDataStorer, and add a DiskSavedGameDataStorer in its place. You can change the "Store Save Files In" dropdown to set a custom path where it stores files. I really should add a "Steam Cloud Save Folder" option in the dropdown. I'll try to get that into a future version.
If you want to migrate players' existing saved games from PlayerPrefs to disk:
1. Add a PlayerPrefsSavedGameDataStorer component to a separate GameObject -- not the GameObject with the SaveSystem component.
2. At runtime, call this PlayerPrefsSavedGameDataStorer's RetrieveSavedGameData(slot#) method to get the saved game data from PlayerPrefs.
3. Then call the DiskSavedGameDataStorer.StoreSavedGameData(slot#, savedGameData) to save that data to a disk file. Since the DiskSavedGameDataStorer will be on the same GameObject as the SaveSystem, you can use PixelCrushers.SaveSystem.storer.StoreSavedGameData(slot#, savedGameData).
Here are some other links that aren't exactly related but might be helpful:
PlayerPrefsSavedGameDataStorer stores saved games in PlayerPrefs, not directly in disk files. On Windows, for example, Unity stored PlayerPrefs data in the Windows Registry.
Remove the PlayerPrefsSavedGameDataStorer, and add a DiskSavedGameDataStorer in its place. You can change the "Store Save Files In" dropdown to set a custom path where it stores files. I really should add a "Steam Cloud Save Folder" option in the dropdown. I'll try to get that into a future version.
If you want to migrate players' existing saved games from PlayerPrefs to disk:
1. Add a PlayerPrefsSavedGameDataStorer component to a separate GameObject -- not the GameObject with the SaveSystem component.
2. At runtime, call this PlayerPrefsSavedGameDataStorer's RetrieveSavedGameData(slot#) method to get the saved game data from PlayerPrefs.
3. Then call the DiskSavedGameDataStorer.StoreSavedGameData(slot#, savedGameData) to save that data to a disk file. Since the DiskSavedGameDataStorer will be on the same GameObject as the SaveSystem, you can use PixelCrushers.SaveSystem.storer.StoreSavedGameData(slot#, savedGameData).
Here are some other links that aren't exactly related but might be helpful:
- How To: Handle Saved Game Versions
- A linkback to a thread we had a couple of weeks ago: Porting Game to Nintendo Switch. If you go multi-console and want to do cloud saves, consider making your own subclass of SavedGameDataStorer as discussed in that thread.