Explaining netcode in games, and why rollback is overrated (though still worth adopting)

“Down here, salt is a way of life…”

TL;DR

  • Rollback is excellent for casual play but has significant vulnerabilities in competitive for-money play; it’s not a silver bullet, nor is it a strict improvement on purely delay-based systems — it does have drawbacks.
  • It is my view that many players don’t understand the unequal nature of, and exploitability of, rollback in competitive situations.
  • Rollback in tournaments should require specific rules regarding the relationship between player distance/ping to one another and input delay settings, and game implementations that publically show each player’s settings for a match, to ensure fairness.
  • GGPO is excellent and ought to be adopted by as many fighting games as possible, which will also come with the bonus of better standardising game netcode.
  • Game developers need to do more than they’re currently doing to properly explain how rollback works to players, so that they understand how to set their input delay and other settings appropriately.

Table of Contents

Basics of network interaction during play

  • Input latency: The delay between you pressing a button, and that action being processed and displayed in-game. Having input delay is crucial to ensure that each player is seeing the same state of the game at a given time, as it allows your inputs to reach the other person’s screen before it has to show them.
  • Network latency: The delay between sending information from your side of the network, and it being received on the other side, i.e. at the other player’s game.
  • Lag freezes: this refers to when a game has frozen in place, waiting for one player’s connection to catch up. This occurs when a player’s connection has a sudden temporary increase in network latency (e.g. because it’s congested or due to a brief disconnection).
  • Rollback: An alternative to lag freezes. Instead of freezing the game while a connection catches up, the game continues and predicts the inputs that have not arrived from one player’s connection yet — if those inputs were predicted incorrectly, the game “rolls back” to the correct state of play instantaneously.
  • Purely delay-based systems: Games that don’t use rollback. If one player’s connection has a latency spike or other slowdown event, the game will momentarily stop so that ensure both players remain in sync.
  • Delay-based systems with rollback mechanisms. Note that both systems require some input delay in practice: it’s possible to have rollback with 0 input delay, but that’s generally a disaster except on extremely good connections.

The history of rollback, and why it is a relatively recent addition to online games

  • Connection ‘quality’. This doesn’t mean bandwidth, but rather how much a connection’s response time fluctuates. This has improved in modern times, making rollback a much more viable option than it once was.
  • The type of game. Because rollback needs you to be able to revert the state of the game in some cases, trying to implement it in a game with hundreds of different units all acting at once is extremely challenging (not to mention very offputting for the player). As a result, it’s more suited to fighting games and other games with fewer player-controlled assets flying around at any given time.

Why purely delay-based systems have often been received very poorly

Lack of foresight and market considerations

Difficulty of predicting network stability

The benefits of rollback

Much smoother play in most cases

Lower input latency

Better at handling large numbers of small lag spikes

The downsides of rollback

Cost and complexity of development

Unequal to each player

  • In a similar manner to the traditional ‘lag switch’ cheat, you can temporarily cause some lag on your side when you are about to begin an attack, meaning you will see a normal game but your opponent will see you suddenly zip across the screen and be unable to react. It’s important to note that this specific exploit is very difficult to utilise in practice — you’d have to have an advanced setup to both create said lag and start your combo at the same time — but it is possible.
  • A much easier exploit is simply to simulate a constant, random state of lag on your connection — as if your connection were genuinely a bit unreliable or laggy. It requires no active input from the cheating user, and will create unpredictable rollback issues on the other player’s PC — of course, this is not as big an effect as a traditional lag switch, but is still an advantage. This doesn’t work in purely delay-based systems, because simulating constant random lag through a match would cause as many problems for the cheating player as it would for the opponent, rendering it useless.

Much worse at dealing with large lag spikes

More problematic in dealing with desyncing

  • Network lag, causing one computer to not know the opponent’s inputs yet (forcing it to either begin a lag freeze, or predict inputs for a potential rollback).
  • Hardware lag (e.g. one computer is not running the game at full FPS for some temporary reason, meaning it is now behind the other computer even though it knows the next inputs it needs to render on screen).

The problem of letting players decide input latency

A common logical fallacy of rollback impacts

Comparing this to purely delay-based systems

  • Rollback is completely unpredictable for the player (you have no idea when or where the rollback will occur, and as such if an opponent’s move suddenly jumps forwards three frames, you will be completely unprepared for it). In addition, players often recognise an enemy move by the ‘signature’ startup frames associated with that move — and in some rollback scenarios, this can cause a player not to recognise an attack they would otherwise recognise and realise it too late.
  • Higher input delay, while making it harder to block on reaction, is a factor the player can account for when making decisions, meaning that the impact of it is mitigated slightly (though not by much).

Tournament considerations for rollback

Survivorship bias, and its effect on players’ perception of rollback

  • If a combo drops because of lag, or an opponent hits you due to lag, it’s a very memorable event for the game. Rollbacks will often have an equivalent impact on the game but be almost impossible to discern visually: it’s a lot more likely that a player will assume they just didn’t react fast enough. This difference means that rollback will frequently not be blamed for problems while lag will be. In addition, players feel much more ‘cheated’ if their combo drops due to lag, versus if they got hit because a rollback reduced an enemy’s startup time on their screen, as it feels more like the player’s control of the game was denied to them even though both cases involved that.
  • Unlike lag, rollback doesn’t affect both players — so if you get screwed by an unfortunate rollback, the other player is not going to see it or know about it.

COVID-19, and a rise in online tournaments

Recording games

Conclusions

  • If a developer doesn’t allow users to set their own input delay, it’s on them to make sure that they set an appropriate delay so that it strikes a balance between input delay and janky matches.
  • If they do allow users to set it, it’s partially on the user to set a proper input delay, but it’s also on the developer to explain to the user how they should do this, give them the tools to measure it, etc.

--

--

--

Computer scientist. https://twitter.com/antsstyle

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The Power of Dashboards in IoT

Taking the next step in immersion, sounds

AWS EKS Managed Node Groups via Terraform

Instead allow test through center.

How to Contribute to Open Source

YAML Tips and Tricks for Kubernetes Users- CKA Exam Certification Series

Reducing Your Page Load Time With WP Accelerator

19coders

How to shove an existing application into containers with Docker

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Antsstyle

Antsstyle

Computer scientist. https://twitter.com/antsstyle

More from Medium

Why Does Web3 Matter?

Joe Rogan Vs. Neil Young…Thank You!

The future of the Lucky Wolves NFT

Zeus vs Monsters Game Critique

main gameplay screen, showing multiple choice math problem with mythological Greek characters acting above