Rollback P2P Mulitplayer for Versus Game


Rollback Fighter sample: a playable 1v1 fighting game with a rollback graph and desync demo ... It only supports 1v1, and your gameplay code has to use the included physics and math to stay in ...


by LowHikeGames


Price History +

Rollback netcode package for versus 2D games, with a template fighting scene and a deterministic physics engine included
  • GGPO-style rollback netcode for 1v1 games: prediction, rollback and instant resimulation
  • Fully deterministic fixed-point (Fix64) 2D physics engine included, bit-identical on every machine
  • Physics works like Unity's Rigidbody2D and colliders, with a one-click converter for existing scenes
  • Input delay with automatic negotiation, and time sync between players
  • Reliable input delivery with retransmission
  • Desync detection by checksum, plus a sync test that needs no network
  • Full match lifecycle: handshake, disconnects, rematch and failure reports
  • Replays from confirmed inputs, with offline verification
  • Sounds and effects that survive rollback corrections
  • Two transports: direct UDP (no account needed) and Unity Relay (works behind NAT, encrypted)
  • Live network simulator for latency, jitter and packet loss
  • All 2D collider types, nine joints, five effectors, raycasts and shape queries
  • Snapshot save/restore with checksums, for rollback, lockstep and replays
  • Rollback Fighter sample: a playable 1v1 fighting game with a rollback graph and desync demo
  • Physics Showcase sample: sandbox room and every physics feature with rewind
  • Step-by-step guides to take a local 2-player game online

This package adds rollback netcode to Unity, the same approach used in GGPO and most modern fighting games. Each player's game runs without waiting for the other player's inputs. If an input arrives late and doesn't match what was predicted, the game goes back a few frames and replays them with the correct input.


For rollback to work, both machines need to get the exact same result from the simulation. Unity's built-in physics can't guarantee that, so I wrote a 2D physics engine using fixed-point math. It's set up like Rigidbody2D and the usual colliders, and there's a converter for existing scenes.


The package also handles input delay, time sync, desync detection, disconnects, rematches and replays. You can connect players directly over UDP, or through Unity Relay if they're behind a router. There's also a network simulator so you can test with lag and packet loss.


It comes with two samples: a small fighting game for testing rollback between two instances, and a physics sandbox. There are guides that explain how to take a local 2-player game online.


It only supports 1v1, and your gameplay code has to use the included physics and math to stay in sync.