Game persistence ensures that the state of the game world is retained even when the game isn’t running. The game state is stored ‘live’ in a high-throughput entity database, which receives updates on changes in the game to ensure every detail of the game persists. Server-worker instances make updates to the database via the SpatialOS Runtime.
A snapshot holds a representation of the state of your game world at a specific point in time. The snapshot stores every entity in the game along with the values of its components' properties. The SpatialOS Runtime can use snapshots to resume a suspended game world or restart a game world from a previous point in time by using the snapshot data as a canonical definition of the world.
You can take snapshots of running deployments automatically or trigger them manually, and SpatialOS stores them automatically in the filesystem. Successive snapshots represent the evolution of the game world over time. You can see the snapshot history for a deployment in the Console outside of China or in China.
You can use snapshots to reproduce the game state for debugging. For example, your QA team may find a bug in your game during playtesting. They can create a snapshot of the game world and send it to your development team, who reload the snapshot to recreate and diagnose the issue, so they can fix the bug. To verify the fix, QA can then reload the snapshot against the updated game code.
SpatialOS provides tools to help you convert binary snapshots to and from a text-based JSON format to make them human-readable, for example, to store them using version control and review deltas.
Updated 5 months ago