What is Sparse Saving and when should I use it?
mainBy default, GGRS saves the game state on every frame advance to ensure a nearby save point is available for any rollback within the max_prediction_window.
Sparse Saving changes this behavior so that GGRS only saves at the last confirmed frame (the most recent frame where all clients have provided real, non-predicted inputs).
Trade-offs
- Pros: Significantly fewer
SaveGameStaterequests (at most one per update tick instead of one per frame). This is ideal if saving state is computationally expensive or involves large buffers. - Cons: Potentially longer rollbacks. If a misprediction occurs, GGRS must re-simulate from the last confirmed save point rather than a more recent frame.
Recommendation: Only use sparse saving if your state save is expensive. If your state save is cheap and fast, the default behavior is likely more efficient as it reduces rollback re-simulation costs.