what is rollback in fighting games and how come it makes it feel like there isn’t really any lag?

518 views

what is rollback in fighting games and how come it makes it feel like there isn’t really any lag?

In: Technology

2 Answers

Anonymous 0 Comments

There are two ways you can write up the netcode for a game. You can either handle the button presses when they were originally pressed, or you can handle them when they get to the central server.

Let’s say you’re starting with the central server timing. This is also referred to as Delay-Based. If you press a button on your screen, until you receive an acknowledgement from the server that the button was pressed, nothing happens. This creates a lag that you have to overcome that just isn’t present with in-person gaming, and is going to vary greatly depending on your connection at the time. However, everything you see on your screen is guaranteed to be what actually happens.

The other way, handling buttons based on when they were originally pushed, is what is referred to as rollback.

Imagine each button press gets sent to the server with a timestamp. Your local game can start playing the actions right away, because it expects that the server will accept that button press at that time.

When it gets to the server, it will look at the timestamp of the button press. If it has already done any calculations for any button presses later than that, then it rolls back those button presses, adds the new one, and then replays them, and sends the correction to both clients.

This means that you effectively always get your button press at the time you pressed it, without weird lag making it much later than you intended. This also means that, if there is substantial lag, you can see the game stutter as it corrects itself, but if there is very little lag, then everything appears very smooth for both players, making them feel as if it’s a local game.

You are viewing 1 out of 2 answers, click here to view all answers.