GGPO Rollback Networking SDK
Zero-input latency networking library for peer-to-peer games.
Created in 2009, the GGPO networking SDK pioneered the use of rollback networking in peer-to-peer games. It's designed specifically to hide network latency in fast paced, twitch style games which require very precise inputs and frame perfect execution.
Traditional techniques account for network transmission time by adding delay to a players input, resulting in a sluggish, laggy game-feel. Rollback networking uses input prediction and speculative execution to send player inputs to the game immediately, providing the illusion of a zero-latency network. Using rollback, the same timings, reactions visual and audio queues, and muscle memory your players build up playing offline translate directly online. The GGPO networking SDK is designed to make incorporating rollback networking into new and existing games as easy as possible.
How Does It Work?
Rollback networking is designed to be integrated into a fully deterministic peer-to-peer engine. With full determinism, the game is guaranteed to play out the same way on all players computers if we simply feed them the same inputs. One way to achieve this is to exchange inputs for all players over the network, only execution a frame of gameplay logic when all players have received all the inputs from their peers. This often results in sluggish, unresponsive gameplay. The longer it takes to get inputs over the network, the slower the game becomes.
In rollback networking, game logic is allowed to proceed with just the inputs from the local player. If the remote inputs have not yet arrived when it's time to execute a frame, the networking code will predict what it expects the remote players to do based on previously seen inputs. Since there's no waiting, the game feels just as responsive as it does offline. When those inputs finally arrive over the network, they can be compared to the ones that were predicted earlier. If they differ, the game can be re-simulated from the point of divergence to the current visible frame.
Don't worry if that sounds like a headache. GGPO was designed specifically to implement the rollback algorithms and low-level networking logic in a way that's easy to integrate into your existing game loop. If you simply implement the functionality to save your game state, load it back up, and execute a frame of game state without rendering its outcome, GGPO can take care of the rest.
This article originally ran in Game Developer Magazine's September 2012 Edition. It's a good introduction to how GGPO works, how it interacts with your game loop, and some things to consider with how it impacts effects and audio rendering. Thanks to Patrick Miller and GDMag for allowing me to share it here!
Mike Zaimont, better known as "Mike Z", is the lead design director and a programmer at Lab Zero Games. Mike incorporated GGPO into Skullgirls, Lab Zero's first title. He's always been a strong advocate for rollback networking (thanks Mike!) and describes why in this episode of Cross Counter LIVE from 2013.
In 2017 I gave a talk at the Evolution Championship Series describing how GGPO works, the how and they why it came to be, and its integration into the FinalBurn Alpha emulator. There's a bit of Fighting Game Community history and stage setting in the beginning, so feel free to jump to 10:38 for the juice.
The GGPO SDK is publicly available on GitHub. If you're interested in licensing on terms other than the MIT license or just want to reach out, feel free to contact me with the form, below.