W skrócie
Steam Cloud automatycznie przechowuje pliki z twojej gry na serwerach Steam, by twoi gracze mogli zalogować się do Steam i uzyskać dostęp do swoich zapisanych gier na dowolnym komputerze.Poziom integracji
Wymagana jest konfiguracja ścieżek do plików na stronie Steamworks. Opcjonalnie niektóre wywołania API są wymagane z poziomu kodu gry do Steamworks w celu przesyłania, pobierania, wyliczania i usuwania plików. Wprowadzenie do Steam Cloud
Usługa Steam Cloud zapewnia łatwy i przejrzysty system zdalnego przechowywania plików twojej gry. Pliki określone podczas konfigurowania Auto-Cloud lub zapisane na dysku (utworzone, zmodyfikowane, usunięte itd.) za pomocą API chmury zostaną automatycznie powielone na serwery Steam po opuszczeniu gry.
Jeśli użytkownik skorzysta z innego komputera, pliki zostaną automatycznie pobrane na niego przed uruchomieniem gry. Gra może następnie uzyskać dostęp do plików, odczytując je poprzez API chmury lub bezpośrednio z dysku, tak jak zwykle. Unikaj synchronizowania konfiguracji specyficznych dla danego komputera, np. ustawień wideo.
Klient Steam zapewnia, że pliki są zsynchronizowane na wszystkich komputerach, z których korzysta użytkownik.
Użytkownicy mogą globalnie wyłączyć synchronizację z chmurą w ustawieniach Steam w zakładce „Cloud” poprzez odznaczenie „Włącz synchronizację dla produktów Steam, które ją obsługują”.
Użytkownicy mogą również wyłączyć synchronizację z chmurą dla każdej gry oddzielnie w jej właściwościach.

Uwagi i najlepsze praktyki
Należy pamiętać, iż Steam zsynchronizuje pliki Steam Cloud użytkownika dla twojej gry przed i po każdej sesji. Wszelkie pasujące pliki, które zmienią się podczas sesji, zostaną przesłane do pamięci w chmurze natychmiast po jej zakończeniu. Jeżeli twoja gra zapisuje w Steam Cloud bardzo duże pliki lub wiele małych, to może to wywołać istotny wpływ na przepływność łącza użytkownika i opóźnić możliwość wyłączenia Steam lub kolejnego uruchomienia gry.
Najogólniej lepiej pracować z mniejszymi plikami. Jeżeli zapisany stan gry danego użytkownika można podzielić na kilka kategorii (te, które zmieniają się często i te, które zmieniają się rzadko), to zalecamy skorzystanie z oddzielnych plików dla tych kategorii. W ten sposób pliki z niezmienionym stanem nie będą ponownie przesyłane po każdej sesji.
Limit rozmiarów plików
Bezwzględny limit rozmiarów plików w Steam Cloud może zmienić się po pewnym czasie. Oto obecne limity i granice:
Rozmiar | Ograniczenie |
---|
100 MB | Maksymalny rozmiar do wywołania dla ISteamRemoteStorage::FileWrite lub ISteamRemoteStorage::FileWriteStreamWriteChunk |
256MB | Może poskutkować wyborem nieoptymalnego punktu końcowego pamięci w lokalizacji użytkownika, negatywnie wpływając na wydajność wysyłania/pobierania |
Ścieżki plików z zapisami
Podczas podejmowania decyzji, gdzie zapisać pliki z zapisanym stanem gry, upewnij się, że ścieżka będzie unikalna dla obecnego użytkownika Steam. Jeżeli to konieczne, możesz uzyskać unikalne ID Steam użytkownika za pomocą
ISteamUser::GetSteamID. Dzięki temu możesz uzyskać dostęp do jego ID konta z użyciem funkcji GetAccountID(), umożliwiając ci posiadanie unikalnej zmiennej podczas tworzenia ścieżki zapisu.
Cross-Platform Saves
If your game is supported on multiple platforms - or even if you plan to support this in the future - you should consider this when setting up Steam Cloud for your game.
If you plan to read/write files directly via the
ISteamRemoteStorage
interface, then you can control platform sync via
ISteamRemoteStorage::SetSyncPlatforms. The default for a new file is to sync to
all platforms.
If you plan to use
Steam Auto-Cloud, there are some key things to know. First, the default for new files is to sync to
only the
OS
setting on the associated Auto Cloud Root path. This means that if you set up distinct roots for each OS, all files will be partitioned by platform, and hence there will be no cross-platform save functionality.
To enable cross-platform saves, you should instead define a single Root path (likely for Windows), and then create
Root Overrides
for the other supported platforms. Files matching a given Root path which also has platform Root Overrides will sync to all platforms in both the origianal Root and all Overrides. See the
Steam Auto-Cloud documentation for more details.
Wstępna konfiguracja
To set up Steam Cloud you must set the
Byte quota per user
and
Number of files allowed per user
options on the
Steam Cloud Settings page in the Steamworks App Admin panel.
This quota is enforced on each Cloud-enabled game, on a per-user-per-game basis. It's recommended to set the values to reasonable amounts for your game title.
UWAGA: Don't forget to click Save at the bottom of the page, and Publish your updated settings. Once published the cloud icon will be visible in the Steam client for anyone that owns your game.
If your game has already been released to the public then you can check the box labeled
Enable cloud support for developers only
. If developers-only mode is enabled then only the steam accounts which own a "Developer Comp" license for your title will see the cloud icon and will be able to use the Steam Cloud. This is useful to safely test Steam Cloud integration without breaking the public user experience. This has no effect on unreleased games since no one owns the game yet, they won't be able to see or access any cloud storage for the specific app ID.
You are able to share Cloud storage space between two app IDs by filling out the
Shared cloud APP ID
field. This is most commonly used to share saved games between a demo and a full game. A value of
0 disables this feature.
API Steam Cloud i Steam Auto-Cloud
Steam provides two different methods of utilizing the Steam Cloud, read up on how the two methods differ, and determine which would be the best for your application.
First up is the Steam Cloud API.
The Cloud API provides a series of functions which allows you to directly integrate the Steam Cloud into your game. The Cloud API isolates individual Steam users files from each other and provides a greater level of control over the Steam Cloud.
The Steam Cloud API is exposed via the
ISteamRemoteStorage API interface, and you can find example usage in the
Steamworks API Example Application (SpaceWar) project.
The second is
Steam Auto-Cloud.
Steam Auto-Cloud was designed for games where you choose to not integrate the Steam Cloud API. It provides a quick and easy way to get started but lacks the flexibility that is available with the Steam Cloud API.
If you prefer a deeper integration with Steam Cloud (for example, allowing to choose which save files are stored in the cloud), then you should use the Cloud API. Otherwise you can use Steam Auto-Cloud.
Steam Auto-Cloud
Steam Auto-Cloud is an alternative to the Steam Cloud API that allows apps to use Steam Cloud without writing code or modifying the game in any way. It only requires that you specify the file groups which you want persisted to the Cloud. Steam will automatically sync the groups of files when the application launches and exits. Avoid machine specific configurations such as video quality.
Uwaga: plik steam_autocloud.vdf zostanie utworzony w każdej lokalizacji określonej przez twoje ścieżki chmury w Steamworks. Ten plik jest używany przez Steam i może zostać zignorowany przez twoją grę.
Setup
After completing the
Wstępna konfiguracja the Steam Auto-Cloud configuration section will unlock on the
Steam Cloud Settings page.
Root Paths describe groups of files which will be persisted to the Steam Cloud. Each Root Path can be as specific as a single file or as wide as all files under a given subfolder. Use a new path for each group of files to sync.
A Root Path is composed of 5 parts:
-
Root
Jest to ustalona lista ścieżek, w których zwykle znajdują się zapisywane gry.
Root | Obsługiwane SO | Odpowiadająca ścieżka |
Folder instalacyjny aplikacji | Wszystkie | [Instalacja Steam]\SteamApps\common\[Folder gry]\ |
SteamCloudDocuments | Wszystkie | Ścieżka dla określonej platformy, np. dla systemu Linux: ~/.SteamCloud/[nazwa użytkownika]/[Folder gry]/ |
WinMyDocuments | Windows | %USERPROFILE%\Dokumenty\ |
WinAppDataLocal | Windows | %USERPROFILE%\AppData\Local\ |
WinAppDataLocalLow | Windows | %USERPROFILE%\AppData\LocalLow\ |
WinAppDataRoaming | Windows | %USERPROFILE%\AppData\Roaming\ |
WinSavedGames | Windows | %USERPROFILE%\Zapisane gry\ |
MacHome | macOS | ~/ |
MacAppSupport | macOS | ~/Library/Application Support/ |
MacDocuments | macOS | ~/Documents/ |
LinuxHome | Linux | ~/ |
LinuxXdgDataHome | Linux | $XDG\_DATA\_HOME/ |
A note regarding the Windows %USERPROFILE% paths: The corresponding paths listed above are the default locations. It is now possible for the user to configure their Windows installation so that these folders are in different locations (not necessarily under %USERPROFILE%). Steam uses the necessary Windows APIs to find the current location of these folders, whether they are default or customized.
-
Podkatalog
Ścieżka podkatalogu plików w chmurze względem roota. Użyj „.”, jeśli nie ma podkatalogu.
Wartości specjalne ścieżek w Auto-Cloud
Auto-Cloud pozwala na użycie unikalnych identyfikatorów użytkownika Steam w podkatalogu
ścieżki. Pozwala to na przechowywanie plików zapisanych gier dla każdego użytkownika Steam na jednym komputerze oddzielnie. Możesz użyć ISteamUser::GetSteamID w swojej grze, by uzyskać ID Steam lub ID konta użytkownika i wykorzystać je do zapisywania i odczytywania.
-
{64BitSteamID}
— użyj tej zmiennej w ścieżce Steam, aby wstawić 64-bitowe ID Steam użytkownika. 64-bitowe ID Steam wygląda następująco: 76561198027391269.
-
{Steam3AccountID}
— użyj tej zmiennej w ścieżce Steam, aby wstawić ID konta Steam3 użytkownika. ID konta wygląda następująco: 67125541.
Przykład: SavesDir/{64BitSteamID}
-
Wzorzec
Wzorzec maski pliku do dopasowania. Możesz użyć *
jako dzikiej karty. Jeśli potrzebujesz wszystkich plików w katalogu, użyj *
.
Przykład: *.sav
-
SO
Ustawia systemy operacyjne, z którymi lub do których te pliki będą synchronizowane. Jest to wymagane tylko w przypadku, kiedy pliki są specyficzne dla danego systemu operacyjnego, co, miejmy nadzieję, nie ma miejsca!
-
Cykliczne
Dołącz podkatalogi podczas szukania pasujących plików. Jest to przydatne dla podkatalogów z niedeterministycznymi nazwami, np. nazwy użytkowników niezwiązane ani ze Steam, ani z ID. Jeśli korzystasz z ID Steam, to zaleca się użycie specjalnych wartości ścieżki w polu „Podkatalog”.
Root Overrides
If your application is cross-platform and requires different directories for each OS. You can use the Root Overrides functionality to specify an override the Root Paths that you set above.
The root paths specified above can be overridden to correspond to a different path on another OS. If you use Root Overrides, you must specify [All OSes] in the Root OS drop down above.
A Root Override consists of 5 parts.
-
Oryginalny root
Odpowiada to jednemu z rootów ustawionych powyżej.
-
SO
System operacyjny, do którego zostanie zastosowane obejście.
-
Nowy root
Nowa lokacja, do której oryginalny root będzie przekierowywał na określonym systemie operacyjnym.
-
Dodaj/zastąp ścieżkę
To ustawienie pozwala na opcjonalnie dodanie ścieżki podkatalogu, która jest wstawiana między nowym rootem a oryginalnym podkatalogiem.
-
Zastąp ścieżkę
Włączenie spowoduje, że ścieżka określona w polu „Dodaj/zastąp ścieżkę” całkowicie zastąpi oryginalny podkatalog.
Example: Configuring Auto-Cloud for Unity Applications
The following is an example of setting up Auto-Cloud for use with Unity and the
Application.persistentDataPath
property where the value is different per OS. The Windows version is configured as the Root Path with the company in Unity set to DefaultCompany and the Project called AutocloudSample. On macOS and Linux/SteamOS, the alternate paths from
Application.persistentDataPath
are set in the Add/Replace Path field and Replace Path is enabled.
With these settings, Auto-Cloud files will be synchronized between the three folders as shown in the Preview samples.

Pre-release Testing
If you are adding Steam Auto-Cloud to a game which is already released and you have enabled developer-only mode during the
Wstępna konfiguracja then you must complete some additional steps to test the functionality.
- Zaloguj się do Steam za pomocą konta, które posiada testowaną przez ciebie aplikację.
- Uruchom konsolę Steam, przechodząc do
steam://open/console
w twojej przeglądarce.
- Wpisz w konsoli
testappcloudpaths <AppId>
z danym ID aplikacji, którą testujesz. Przykład: testappcloudpaths 480
.
- Wpisz w konsoli
set_spew_level 4 4
.
- Uruchom swoją aplikację z poziomu Steam.
- Sprawdź aktywność w konsoli. Jeśli istnieją już pliki w ścieżkach Auto-Cloud, zobaczysz w konsoli, że są przesyłane. W przeciwnym wypadku zapisz niektóre pliki w swojej aplikacji, a następnie zamknij ją, aby rozpocząć synchronizację.
- Przejdź do innego komputera i powtórz powyższe kroki, by przetestować pobieranie plików ze Steam Auto-Cloud.
- Upewnij się, że przetestujesz tę funkcjonalność na wszystkich obsługiwanych systemach operacyjnych.
- Set
testappcloudpaths 0
and set_spew_level 0 0
to end testing. Możesz zrestartować klienta Steam, by pozbyć się zakładki z konsolą.
Don't forget to disable developers-only mode and publish the changes when you're done testing.
Dynamiczna synchronizacja z chmurą
Steam Cloud now supports dynamic sync - where changes appearing in the Cloud can be downloaded to the local machine during an application session. The current example is a suspended game session on the Steam Deck. For apps marked as supporting dynamic Cloud sync, Steam will synchronize files up to the Steam Cloud at the suspend time. Then, the user may run the game on another device, which will receive the updates from the Steam Deck session at launch. At exit, those changes will be uploaded to the Steam Cloud. Finally, when the Steam Deck device is awakened, Steam will synchronize the changes down to that device, and post a notification to the application that local files have changed. The application can then iterate those changes and take appropriate action. For instance, the game may be able to simply load the updated progress from disk and allow the user to pick up right where they left off on the other device.
Check out
our announcement post for even more information about why this feature exists, and how to use it.
Note that this feature supports applications whether they use the
ISteamRemoteStorage API to manage files, or Auto-Cloud.
For more details, see the
ISteamRemoteStorage documentation, specifically
ISteamRemoteStorage::RemoteStorageLocalFileChange_t,
ISteamRemoteStorage::GetLocalFileChangeCount, and
ISteamRemoteStorage::GetLocalFileChange.
See also
ISteamRemoteStorage::BeginFileWriteBatch and
ISteamRemoteStorage::EndFileWriteBatch - these wrappers should be used to provide hints to Steam which will help it safely sync up to the Steam Cloud at the time when the user initiates a system suspend.
Pre-release Testing
You can locally enable Dynamic Cloud Sync for your app to test your builds - this is recommended for a game that has already shipped, as enabling Dynamic Cloud Sync for all users could lead to data loss when running builds that do not handle the new API methods and callbacks.
To test locally from a PC:
- Sign in to Steam with an account that owns the app that you are testing.
- Open the Steam Console by navigating to
steam://open/console
in your browser. (You can also run Steam with the command-line steam -console
and then navigate to the Console section directly).
- Enter
@cloud_testdynamicsyncapp <AppId>
into the console with the given App ID that you are testing. Ex: @cloud_testdynamicsyncapp 480
- Launch your app from Steam.
- Progress through the game to a desired amount
- In the Steam Console, enter
prepare_for_suspend
. Steam will suspend your game process and upload any changed files to the Steam Cloud.
- Optional: play the game on another device, creating further progress, and then exit and let that Steam client upload progress to the Steam Cloud.
- Back on the original device, in the Steam Console, enter
resume_suspended_games
. This will sync down any necessary files from the Steam Cloud, post the relevant API calls to your game, then un-suspend your game process.
To test locally from a Steam Deck:
- Connect your Steam Deck with a Devkit
- To use the CEF Console, see here
- In the JS console, enter
SteamClient.Console.ExecCommand(“@cloud_testdynamicsyncapp <AppId>”)
to enable testing. You can then enter SteamClient.Console.ExecCommand(“@cloud_testdynamicsyncapp 0”)
to disable it
Debugowanie
First, always ensure that you have published your changes on the Steam partner website and have waited up to 10 minutes or restarted your Steam client to receive the published changes.
If you run into issues with Steam Cloud you should check the log file located at
%Steam Install%\logs\cloud_log.txt
.
See
Debugging the Steamworks API for additional information.