Skip to main content

Module rollback

Module rollback 

Source
Expand description

Rollback networking support — deterministic state snapshots, input prediction, and reconciliation for peer-to-peer fighting/action games.

§Architecture

  • GameState trait — implement this for your game state to enable rollback
  • RollbackBuffer — ring buffer of state snapshots indexed by frame
  • InputPredictor — predicts missing remote inputs based on last known
  • RollbackSession — orchestrates rollback, save/load, re-simulation
  • NetworkStats — RTT, packet loss, and frame delay tracking

Structs§

DesyncDetector
DesyncEvent
FrameInput
All player inputs for one frame.
InputPacket
InputPredictor
Predicts missing remote player inputs by repeating the last known input.
NetworkStats
PeerStats
PlayerInput
Serializable snapshot of a single player’s input for one frame.
RollbackBuffer
Ring buffer of state snapshots and frame inputs for rollback.
RollbackSession
Orchestrates frame advance, rollback, and re-simulation.
StateSnapshot

Constants§

INPUT_DELAY
MAX_PLAYERS
MAX_ROLLBACK_FRAMES

Traits§

GameState
Implement this on your game state to enable rollback.

Type Aliases§

Frame
PlayerId