Skip to content

Following an open-source trail to Jimmy's blog, I found this article about GGPO-style netcode.

GGPO (Good Game Peace Out) is a rollback-based peer-to-peer networking methodology built as a middleware. The wikipedia article says that the author created it as a rage response to poor netcode in Capcom's Street Fighter II, he later demo'd it to Capcom and its since been implemented in a swath of hugely popular online multiplayer fighting games.

The methodology is powerful because it uses peer-to-peer syncing, but in order for that to work, state must be able to "rollback" and simulate out of sync requests.

For such a state to not result in two clients out of sync, the game must be deterministic – for the given state at a given game clock event, you must have the same, reproducible state.

Floating point numbers are the enemy of reproducibility. Different architectures generate them differently.

What's the solution to such a widespread, low-level challenge?: Fixed Point numbers.

Fixed point numbers limit the decimal values of a number, and we use them every day when representing dollars and cents (ie. $24.32). They are very useful for deterministic game state because they reduce the variability of fractional numbers into a predictable, pre-defined numerical resolution.

For more interesting GDC talks about netcode: https://www.youtube.com/watch?v=W20t1zCZv8M https://www.youtube.com/watch?v=7jb0FOcImdg

netcode #gamedev