Hacker News new | ask | show | jobs
by dahfizz 2180 days ago
> Fizzi released a dolphin build with rollback netcode ... making it a game with better netcode than most current big name fighters.

I see this repeated often without justification. Why is rollback better?

Based on my basic understanding, rollback netcode would absolutely fall apart under any suboptimal network conditions. If there's too much lag or packet loss, you and the opponent character will start teleporting all over the screen, missing lots of inputs, etc.

It makes sense that rollback netcode would be preferable when paired with a very good, reliable network (e.g. so if any rollback is needed, it's only a frame or two). But if you're selling a casual game meant for anyone to be able to play, a delay based netcode makes more sense to me. An average Joe can understand "the game is buffering", but if the game starts rolling back too much and you can't control your character because he's teleporting all around, that just looks like a broken game.

An interesting follow up question: if rollback is objectively the better approach, why is it implemented less often? Is it significantly more difficult to develop and does that offset how much value it would add to the game?

5 comments

Rollback is not a replacement for delay-based, but an enhancement to delay. Slippi, for example, still delays the inputs by 2 frames to minimize the inconsistencies that appear. This can (in theory, not sure if it’s implemented in slippi) be increased to any number of frames to reap the benefits that delay based netcode has. Only using delay is objectively inferior because any flaw that rollback has is also shared by delay. You are welcome to try out the old Melee netplay and compare it to the new Slippi to experience this for yourself.

The reason rollback is rarely implemented is because it is hard to motivate a company to do it when the benefits are so intangible. “Better netcode” doesn’t really sell games, flashy graphics does. And since most of the FGC has existed offline, online is just an afterthought.

This video explains fairly well: https://youtu.be/1JHetORRpfQ

That and most developers are in Japan, where rollback doesn't show any real benefit because the infrastructure there is small and fast enough to make even the worst netcode viable.
If there's "too much" lag or packet loss, delay-based netcode will also become unplayable; the difference is that rollback has more tools to address bad connections, so that rollback is often not even visible:

- predicting that the buttons held down in frame X will be the buttons held down in frame X+1 is actually a pretty good heuristic

- in fighting games, changing directions and attacking generally have windup animations, so if a correction skips a few of the initial animation frames, it still hasn't diverged the overall game state much

- even in bad connections, you still have control of your character; the game doesn't freeze and take you out of the flow (this can be subjective)

- hybrid approaches are possible, where a small fixed delay is used in addition to rollback; short enough to not be obvious to the player, but long enough to avoid rollback in the cases where delay would be sufficient. (delay-based netcode is not good intercontinentally anyways due to the necessary delay for synchronization becoming obvious input lag)

As for why rollback is rarer, yes, it is more difficult; it usually requires a fully deterministic game engine with the ability to snapshot and restore game state, which can be a very intensive retrofit if you didn't design it in from the start.

I don't see why you would think that. On the contrary it is with solely delay-based netcode that the game would miss your inputs, because it will freeze under bad network conditions and anything you input while it is frozen will be missed. Rollback netcode allows the game to keep running and processing your inputs regardless of the network conditions. You might see the other character jump around somewhat but it's unlikely that your character will warp as the game knows all of your inputs. Your own character can basically continue to react perfectly to your input regardless of network conditions.
Rollback more or less massages the differences between players connections. Comparing this to old netplay (Anthers Ladder & co) is night and day differences.

Teleporting rarely happens for me, if ever - and if it does, then I can cancel and move on to the next opponent who generally doesn't exhibit the issue. In a game like Melee, this is huge - you really need to play both to understand how impactful the difference is.

It's a balance between normal delay-input and rollback netcode, not one or the other. You can increase the delay which will reduce teleporting but obviously makes the game more delayed.

Rollback requires your game to be able to rollback to a previous game state. Some games are not developed with this in mind (too much reliance on global state, hard to go backwards in time)