How rollback works
Game Saves tracks finalized versions of a player’s save data. When you trigger a rollback, the service creates a new version whose contents are identical to the earlier state you’re restoring. Rollback preserves the original version history. It doesn’t delete or overwrite previous versions. Other devices that sync after the rollback see it as a normal update. There are two types of rollback. You trigger each by passing an option flag toPFGameSaveFilesAddUserWithUiAsync:
Both options fall back to default behavior (sync the current latest version) if no eligible restore point exists.
When to use each rollback type
Rollback to last known good
UseRollbackToLastKnownGood when you suspect the latest upload is bad. Common triggers include:
- Load failure or failed integrity check after downloading a save.
- A crash during or immediately after a save operation.
- A player report of corrupted or regressed state.
Rollback to last conflict
UseRollbackToLastConflict when a player chose the wrong side during conflict resolution. As described in Game Saves conflicts, both resolution choices preserve the discarded branch. This rollback option restores that preserved branch.
Calling the API
Trigger rollback by passing the appropriate option toPFGameSaveFilesAddUserWithUiAsync. You can only call this function once per user, so to roll back for a user that’s already added, first call PFGameSaveFilesUninitializeAsync and wait for it to complete.
Fallback behavior
If no eligible restore point exists for the requested rollback type, the call behaves as if you passedPFGameSaveFilesAddUserOptions::None. The current latest version syncs normally. Check the synced files after the call completes to confirm whether a rollback occurred.
Title configuration
You can restrict client-initiated rollback through two configuration flags. When you enable either flag, only support tools and Game Manager can perform that type of rollback.
Set these flags in Game Manager under Progression > Game Saves.
Error handling
Considerations
- Rollback creates a new version. It doesn’t erase history. The player’s version sequence continues forward.
- The service tracks known good automatically. It determines which versions qualify based on successful load-then-replace cycles. Your game doesn’t need to mark versions explicitly.
- One rollback per add-user call. Because you can only call
PFGameSaveFilesAddUserWithUiAsynconce per user, triggering a second rollback requires callingPFGameSaveFilesUninitializeAsyncfirst. - UI callbacks still fire. Rollback goes through the same sync flow as a normal add-user call. Register your UI callbacks before calling the API.
- Restrict rollback if needed. If your game handles recovery server-side or through support tooling, disable client rollback with the title configuration flags to prevent players from accidentally reverting progress.
- Rollback works on all platforms. This API has no platform-specific guards.
