How Do I Upload to My Steam Cloud

In Brief

Steam Cloud automatically stores files from your game on Steam'southward servers so your players tin can log into Steam and access their saved games from any figurer.

Level of integration

Configuration of file paths required on Steamworks website. Optionally, some API calls required from inside game code to Steamworks for upload, download, enumerate, and delete.

Steam Cloud Overview

The Steam Cloud provides an like shooting fish in a barrel and transparent remote file storage system for your game. Files specified in the Car-Deject configuration or written to disk (created, modified, deleted, etc.) using the Cloud API will automatically exist replicated to the Steam servers later on the game exits.

If the user changes computers, the files are automatically downloaded to the new computer prior to the game launching. The game can so access the files by reading them through the Cloud API or reading them direct from disk as usual. Avoid machine specific configurations such as video settings.

The Steam Customer does the work of ensuring that the files are kept synchronized beyond all computers the user may be accessing.

Users can globally disable Deject synchronization in the Steam Settings under Cloud by unchecking "Enable Steam Cloud synchronization for applications which back up it."

Users can as well disable the Cloud synchronization on a per game basis in each games properties.

Spacewar_Cloud_Properties.png

Notes and All-time Practices

Information technology is important to retrieve that Steam volition synchronize the user'due south Steam Deject files for your game before and after every session. Any matching files which modify during the session volition be uploaded to Cloud storage immediately subsequently. If your game writes very large files, or many modest files, to Steam Cloud, then this may cause a noticeable impact on the user's internet bandwidth and likewise delay their power to shut downwardly Steam or re-launch the game.

Every bit a general dominion, smaller files will work improve. If the saved country for a given user can be split up into dissimilar categories - things which may change frequently, and things which may non alter ofttimes - and so we recommend using separate files for those categories. That style, the un-changed state will not exist re-uploaded afterwards every session.

File Size Limits

The absolute limits on file sizes for Steam Cloud may change over time. Here are some current limits and thresholds:

Size Restriction
100MB Maximum size for a call to ISteamRemoteStorage::FileWrite or ISteamRemoteStorage::FileWriteStreamWriteChunk
256MB May result in a non-optimal storage endpoint selection for the user's location, negatively impacting upload/download performance

Relieve File Paths

When deciding where to write your save files, be sure the path will exist unique for the electric current Steam user. If needed, you can get the user's unique Steam ID via ISteamUser::GetSteamID. From that, you tin access their accountID from GetAccountID(), allowing you to have a unique variable when constructing your save path.

Cross-Platform Saves

If your game is supported on multiple platforms - or even if you plan to support this in the time to come - you should consider this when setting upward Steam Cloud for your game.

If y'all plan to read/write files directly via the ISteamRemoteStorage interface, so y'all tin control platform sync via ISteamRemoteStorage::SetSyncPlatforms. The default for a new file is to sync to all platforms.

If you lot plan to use Steam Car-Cloud, there are some fundamental things to know. Showtime, 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 volition be partitioned past 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 so create Root Overrides for the other supported platforms. Files matching a given Root path which also has platform Root Overrides volition sync to all platforms in both the origianal Root and all Overrides. Run across the Steam Machine-Deject documentation for more details.

Initial Setup

To set up Steam Cloud you must set the Byte quota per user and Number of files immune 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 ready the values to reasonable amounts for your game title.

NOTE: Don't forget to click Save at the lesser of the page, and Publish your updated settings. Once published the deject 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 cheque the box labeled Enable cloud support for developers only. If developers-only way is enabled and then only the steam accounts which own a "Developer Comp" license for your title will see the cloud icon and will be able to apply the Steam Cloud. This is useful to safely test Steam Deject integration without breaking the public user experience. This has no effect on unreleased games since no i owns the game yet, they won't be able to see or admission whatsoever cloud storage for the specific app ID.

Yous are able to share Cloud storage space between 2 app IDs by filling out the Shared cloud APP ID field. This is most commonly used to share saved games betwixt a demo and a full game. A value of 0 disables this feature.

Steam Cloud API and Steam Machine-Cloud

Steam provides two different methods of utilizing the Steam Deject, read up on how the two methods differ, and decide which would exist the all-time for your application.

Starting time up is the Steam Deject API.
The Cloud API provides a serial of functions which allows you to straight integrate the Steam Deject into your game. The Cloud API isolates private Steam users files from each other and provides a greater level of control over the Steam Deject.

The Steam Cloud API is exposed via the ISteamRemoteStorage API interface, and y'all can find case usage in the Steamworks API Instance Awarding (SpaceWar) project.

The second is Steam Machine-Cloud.
Steam Automobile-Cloud was designed for games where you choose to non integrate the Steam Cloud API. It provides a quick and easy way to go started but lacks the flexibility that is available with the Steam Cloud API.

If you prefer a deeper integration with Steam Cloud (for example, assuasive to choose which relieve files are stored in the deject), then you should utilise the Cloud API. Otherwise y'all can employ Steam Automobile-Cloud.

Steam Auto-Deject

Steam Auto-Cloud is an culling to the Steam Cloud API that allows apps to use Steam Cloud without writing code or modifying the game in whatsoever way. It only requires that you specify the file groups which you want persisted to the Deject. Steam will automatically sync the groups of files when the awarding launches and exits. Avoid car specific configurations such as video quality.

Notation: The file steam_autocloud.vdf volition be created in each location specified past your Steamworks cloud paths. This file is used by Steam, and tin can exist ignored by your game.

Setup

After completing the Initial Setup the Steam Auto-Deject 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 tin be equally specific equally 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:

  1. Root

    This is a pre-determined listing of paths where game saves are commonly located.
    Root Supported OSes Corresponding Path
    App Install Directory All [Steam Install]\SteamApps\common\[Game Folder]\
    SteamCloudDocuments All Platform specific path, e.g. on Linux: ~/.SteamCloud/[username]/[Game Folder]/
    WinMyDocuments Windows %USERPROFILE%\My Documents\
    WinAppDataLocal Windows %USERPROFILE%\AppData\Local\
    WinAppDataLocalLow Windows %USERPROFILE%\AppData\LocalLow\
    WinAppDataRoaming Windows %USERPROFILE%\AppData\Roaming\
    WinSavedGames Windows %USERPROFILE%\Saved Games\
    MacHome macOS ~/
    MacAppSupport macOS ~/Library/Awarding Support/
    MacDocuments macOS ~/Documents/
    LinuxHome Linux ~/
    LinuxXdgDataHome Linux $XDG\_DATA\_HOME/
  2. Subdirectory

    Subdirectory path to the clouded files relative to the Root. Apply `.` if in that location is no subdirectory.

    Auto-Deject special path values
    Auto-Cloud allows the employ of unique Steam user identifiers in the Subdirectory path. This allows yous to store save files for each Steam user on the computer separately. You lot can use ISteamUser::GetSteamID in your game to get the current users SteamID or AccountID to salvage to and read from.

    • {64BitSteamID} - Utilise this variable in the steam path to insert the users 64bit Steam ID. A 64 bit Steam ID looks similar: 76561198027391269
    • {Steam3AccountID} - Use this variable in the steam path to insert the users Steam three Account ID. An Account ID looks like: 67125541
    Instance: SavesDir/{64BitSteamID}
  3. Design

    File mask blueprint to match. You tin utilise * as a wildcard. If you want all files in the directory, merely use *.

    Example: *.sav

  4. OS

    Sets the Operating Systems that these files will be synced from/to. This is but required if the files are Bone specific, which is hopefully non the case!
  5. Recursive

    Include sub-directories when searching for matching files. This is useful for sub-directories with not-deterministic names such as not-steam user names or IDs. If it'southward using a Steam ID, and then using the special path values in the Subdirectory field is highly recommended.

Root Overrides

If your awarding is cross-platform and requires dissimilar directories for each OS. You lot can apply the Root Overrides functionality to specify an override the Root Paths that y'all set above.

The root paths specified in a higher place can be overridden to correspond to a different path on another OS. If you utilize Root Overrides, you must specify [All OSes] in the Root OS drop downward above.

A Root Override consists of 5 parts.

  1. Original Root

    This corresponds to one of the Roots that yous ready in a higher place.
  2. OS

    The Operating Organization to apply the override on.
  3. New Root

    The new location that the Original Root maps to on the specified OS.
  4. Add/Replace Path

    This allows yous to optionally add a subdirectory path which is inserted between the new root and the original subdirectory.
  5. Replace Path

    If enabled, it causes the path specified in Add/Replace Path to replace the original subdirectory entirely.

Case: Configuring Auto-Cloud for Unity Applications

The following is an example of setting upward Automobile-Deject for apply with Unity and the Awarding.persistentDataPath property where the value is different per Bone. 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 volition be synchronized between the three folders as shown in the Preview samples.

Cloud_Unity_Auto-Cloud_Example.png

Pre-release Testing

If y'all are adding Steam Auto-Deject to a game which is already released and you have enabled developer-just way during the Initial Setup then y'all must complete some additional steps to test the functionality.

  1. Sign in to Steam with an business relationship that owns the app that you are testing.
  2. Open the Steam Console by navigating to steam://open up/console in your browser.
  3. Enter testappcloudpaths <AppId> into the panel with the given App ID that you are testing. Ex: testappcloudpaths 480
  4. Enter set_spew_level 4 iv into the console.
  5. Launch your app from Steam.
  6. Check the console for activeness, If files already be in the Auto-Deject paths then you should see them being uploaded. Otherwise save some files from your app and then close it to trigger a sync.
  7. Go to another PC and repeat the steps above to test downloading the files from Steam Auto-Cloud.
  8. Be certain to test on all supported operating systems.
  9. Set up testappcloudpaths 0 and set_spew_level 0 0 to end testing. Y'all tin restart the Steam client to become rid of the panel tab.

Don't forget to disable developers-simply mode and publish the changes when you're done testing.

Dynamic Cloud Sync

Steam Cloud now supports dynamic sync - where changes actualization in the Cloud tin be downloaded to the local motorcar during an awarding session. The electric current example is a suspended game session on the Steam Deck. For apps marked as supporting dynamic Deject 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 go out, those changes will exist 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 awarding can then iterate those changes and take appropriate action. For instance, the game may be able to but load the updated progress from disk and permit the user to option upward correct where they left off on the other device.

Check out our announcement post for fifty-fifty more data near why this characteristic exists, and how to employ information technology.

Note that this feature supports applications whether they employ 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.

Run into also ISteamRemoteStorage::BeginFileWriteBatch and ISteamRemoteStorage::EndFileWriteBatch - these wrappers should be used to provide hints to Steam which volition help it safely sync up to the Steam Cloud at the time when the user initiates a system suspend.

Pre-release Testing

Y'all tin locally enable Dynamic Cloud Sync for your app to exam your builds - this is recommended for a game that has already shipped, as enabling Dynamic Deject Sync for all users could atomic number 82 to data loss when running builds that exercise not handle the new API methods and callbacks.

To test locally from a PC:

  1. Sign in to Steam with an account that owns the app that yous are testing.
  2. Open the Steam Panel by navigating to steam://open/panel in your browser. (You lot can also run Steam with the command-line steam -console and then navigate to the Console section straight).
  3. Enter @cloud_testdynamicsyncapp <AppId> into the console with the given App ID that y'all are testing. Ex: @cloud_testdynamicsyncapp 480
  4. Launch your app from Steam.
  5. Progress through the game to a desired amount
  6. In the Steam Console, enter prepare_for_suspend. Steam will suspend your game procedure and upload any changed files to the Steam Cloud.
  7. Optional: play the game on another device, creating further progress, and then exit and permit that Steam customer upload progress to the Steam Cloud.
  8. Back on the original device, in the Steam Panel, enter resume_suspended_games. This will sync down whatsoever necessary files from the Steam Deject, mail the relevant API calls to your game, then un-suspend your game process.

To test locally from a Steam Deck:

  1. Connect your Steam Deck with a Devkit
  2. To use the CEF Console, see hither
  3. In the JS console, enter SteamClient.Console.ExecCommand("@cloud_testdynamicsyncapp <AppId>") to enable testing. You lot can then enter SteamClient.Console.ExecCommand("@cloud_testdynamicsyncapp 0") to disable it

Debugging

First, always ensure that you have published your changes on the Steam partner website and have waited up to x minutes or restarted your Steam client to receive the published changes.

If y'all meet issues with Steam Cloud you lot should bank check the log file located at %Steam Install%\logs\cloud_log.txt.

See Debugging the Steamworks API for additional information.

grahamtaidew1967.blogspot.com

Source: https://partner.steamgames.com/doc/features/cloud

0 Response to "How Do I Upload to My Steam Cloud"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel