Rollback System in C++ for Online Multiplayer Games
summary
A concrete C++20 implementation appears on GitHub and uses SDL2 spine Photon FMOD and fmt to run on PC Linux and Nintendo Switch while shipping a simple custom physics and fixed-point (32-bit with 16-bit shift) math replacement to preserve determinism. The system copies compact arrays (inputs packed to ~5 bytes), keeps a rollback manager stores inputs and snapshots the model state, re‑simulates up to N frames (commonly 6–8) and uses a checksum detects desyncs — current tests show desyncs after ~1.5s without more debugging tooling.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 3:16Online multiplayer challenges
- 7:33Network latency and input delays
- 10:31Netcode basics
- 14:02Rollback netcode explained
- 19:29Physics vs graphics states
- 23:20Game architecture for rollback
- 27:12Implementing rollback
- 33:35Physics determinism challenges
- 36:02Floating points break determinism
- 41:20Fixed-point numbers
- 43:28Server-client input confirmation
- 47:04Debugging desyncs
- 50:56Object creation and destruction
- 52:02Optimizing rollback performance
- 53:47Future of C++ sockets
- 54:52Conclusion and key takeaways
- 56:24Q&A
related talks
44mReal-Time Multi-User State Management for the Collaborative Web
57mPlaying Video Games One Frame at a Time
48mSynchronizing Game Components
44mCoordination-Free Designs for Mobile Gaming
31mReplicated Redux
28mOptimistic updates in a pessimistic world
35mBuilding Multiplayer Games with Phoenix and Phaser
01h 00mC++ Mythbusters
