# Check that saves survive a crash

> See how the two copies of each save protect it, what a load reports when a copy is damaged, and how to test it yourself by ending the game during a save.

Product: Rolly Save 1.0.0 | Sheet: guide | Updated: 2026-10-31 | HTML: https://rolly-docs.pages.dev/save/guides/save-safety/

## Know what each save does

- A save goes to the copy, `_a` or `_b`, that does not hold the newest save, with a sequence number higher than any the slot has had. A crash, a killed game or a full disk during the write can only damage that copy; the other keeps the save before it.
- The first save to a slot after the game starts reads both copies first, so it never lands on the newest one.
- A load reads both copies and loads the newest that verifies. When that is the older one, because the newer is damaged or was cut short, the result's `bFromBackup` is true and the store raises `OnLoadedFromBackup`: tell the player that the last save may be missing.
- A copy made by a newer version of your game or of Rolly Save is never written over, and the older copy is not loaded in its place. The player can still delete the slot.
- A failed write reports `LowStorage` apart from other failures on Windows, Mac, Linux, Android and iOS. On iOS every write is read back, since the iOS save system can report a write as done without writing it.
- Saves to one slot run one at a time, in the order they were asked for, also across the game instances of Play In Editor, which share one save folder. A save still waiting is replaced by a newer save of the same slot and reports the newer one's result.
- A part save, copy, rename, import or End Rolly Run reads a slot and then writes it; requests of that slot asked for in between wait for its write, in the game instance that asked. Play In Editor instances do not wait for each other's, so in a multiplayer test change a slot from one window at a time.
- Saves still queued when the game quits are finished first, for up to 10 seconds, and when a mobile game goes to the background, for up to 3 seconds, so a storage that never answers cannot keep the game from closing.

## Check a slot's copies

In the console, `rolly.save.verify <slot name>` loads the slot the way the game does and prints which copy loads and why, then one line per copy. `-profile <name>` checks a profile and `-index` the slot index. It uses the File Prefix and Storage Backend of Project Settings, changes nothing in storage and works in Shipping builds.

```text
mygame_slot_crashtest: copy a loads, sequence 41, the backup: the other copy is damaged or unreadable and may hold a newer save.
  copy a: valid, sequence 41, 67109312 bytes
  copy b: damaged, sequence 42, 1048576 bytes: Truncated: 1048576 of the 67109312 bytes the file records
```

A copy is valid, damaged (with the reason), made by a newer version, missing, or unreadable when the storage failed to read it.

## End the game during a save

`rolly.save.debug.stress <slot> <MiB> <count>` saves a slot again and again with data that does not compress, each save asked for when the one before has reported, and logs the copy and sequence number of every save written. It is not in Shipping builds.

1. Start the game as a standalone game or a packaged Development build, with the log visible (`-log`).
2. Run `rolly.save.debug.stress crashtest 64 50` and wait for the first lines that say a save was written.
3. End the process while saves are still being written, for example with Task Manager or `taskkill /F`.
4. Start the game again and run `rolly.save.verify crashtest`.

The copy that loads holds the last sequence number the log showed as written, or the one after it when the game ended between the write and its log line. The other copy is valid and older, or damaged with its reason. Nothing crashes, and no save older than the last one written is lost. Delete `<prefix>_slot_crashtest_*` from the save folder afterwards.
