Skip to main content
Game Saves provides a set of UI callbacks that let your game respond to events during sync operations. On XBOX and Windows, the platform provides built-in UI for these events. On other platforms (such as Steam Deck), your game must implement its own UI by handling these callbacks. Setting callbacks on XBOX and Windows overrides the platform-provided UI with your implementation. This is useful if your game needs a consistent player experience across all platforms—register the same callbacks everywhere and the built-in UI won’t appear.

How the state machine works

Game Saves uses an internal state machine to coordinate UI callbacks with the async operation lifecycle. When a UI callback fires, the async operation pauses—the XAsyncBlock callback doesn’t fire until the callback is resolved. The state machine doesn’t progress until the game calls the corresponding response API or the async operation is canceled. This means:
  • Each callback type has a corresponding response API. Call the response API to tell the system what to do next.
  • Response APIs can be called inside or outside the callback function.
  • If a response action is Retry, the operation retries and may trigger the same callback again.
  • The XAsyncBlock callback only fires once the operation reaches a terminal state—success, cancellation, or an offline fallback.
For example, if an upload fails due to rate limits:
  1. PFGameSaveFilesUiSyncFailedCallback fires with the error.
  2. The XAsyncBlock callback doesn’t fire yet—the state machine waits for a response.
  3. If the user selects Retry and the retry also fails, the sync failed callback fires again.
  4. If the user selects Cancel, the XAsyncBlock callback fires with E_PF_GAMESAVE_USER_CANCELLED.
  5. If a retry succeeds, the XAsyncBlock callback fires with S_OK.

When callbacks trigger

UI callbacks only fire during two async operations:

Registering callbacks

Register all callbacks before calling PFGameSaveFilesAddUserWithUiAsync or PFGameSaveFilesUploadWithUiAsync:

Callback reference

Progress

Reports upload or download progress. Use PFGameSaveFilesUiProgressGetProgress inside the callback to retrieve the current PFGameSaveFilesSyncState, bytes completed, and bytes total. Callback: PFGameSaveFilesUiProgressCallback Response API: PFGameSaveFilesSetUiProgressResponse
The progress callback doesn’t require a response to continue—the operation keeps progressing on its own. Only call the response API if the user wants to cancel.

Sync states

The PFGameSaveFilesSyncState enum indicates which phase the operation is in:

Sync failed

Fires when a sync operation fails, for example due to network issues or rate limits. Callback: PFGameSaveFilesUiSyncFailedCallback Parameters: Receives PFGameSaveFilesSyncState (the phase that failed) and HRESULT (the error code). Response API: PFGameSaveFilesSetUiSyncFailedResponse For more details on offline mode behavior, see Game Saves offline mode.

Active device contention

Fires during PFGameSaveFilesAddUserWithUiAsync when another device is already the active device for this user. The callback receives PFGameSaveDescriptor structs for both the local and remote save data, which include device names, timestamps, and save sizes that you can display to help the user decide. Callback: PFGameSaveFilesUiActiveDeviceContentionCallback Response API: PFGameSaveFilesSetUiActiveDeviceContentionResponse For more details on active device behavior, see Game Saves active device changes.

Conflict

Fires during PFGameSaveFilesAddUserWithUiAsync when local and cloud save data have diverged. The callback receives PFGameSaveDescriptor structs for both the local and remote save data. Callback: PFGameSaveFilesUiConflictCallback Response API: PFGameSaveFilesSetUiConflictResponse
Conflict resolution applies to the entire save, not individual files or folders. For details on how conflicts are detected at the atomic unit level and resolved globally, see Game Saves conflicts.

Out of storage

Fires during PFGameSaveFilesAddUserWithUiAsync when the local device doesn’t have enough disk space to download save data from the cloud. The callback receives requiredBytes indicating how much space is needed. Callback: PFGameSaveFilesUiOutOfStorageCallback Response API: PFGameSaveFilesSetUiOutOfStorageResponse

Platform requirements

For Steam Deck implementation details, see Steam Deck implementation guide.
Last modified on August 20, 2026