r/gaming • • 22h ago

Nidhogg Adds Rollback Netcode, Training Mode, and More in Surprise Update

https://primagames.com/news/nidhogg-adds-rollback-netcode-training-mode-more-surprise-update
464 Upvotes

33 comments sorted by

View all comments

Show parent comments

50

u/Mohmed_98 20h ago

Isn't rollback the standard for recent fighting games?

-4

u/Xywzel 18h ago

It is kinda standard at the moment, but its also kinda messy fix for a problem you would rather not have at all. So lots of people in the dev teams would want to fix the underlying issues properly rather than rely on storing or recalculating older state and changing things that have already been shown to players.

Though you can't fix speed of light and electric signals, so you might still need some ability to keep the fixed state and sync point slightly in the past.

2

u/CeraphFromCoC 13h ago

Could you try explaining what you mean again? But more clearly?

3

u/Xywzel 12h ago

Rollback is one possible methods to handle network delay between two client. Its kinda hacky one though. It relies for the game to make predictions about what inputs other players have done before receiving information about what these input are. If you predicted right, everything is good. If you predicted wrong, you need rollback (hence the name) the game state to when the input was made and then calculate all the changes again.

Imagine you need to calculate the state again from up to 10 frames back, you might need to keep 10 copies of the game state in memory and you might need to do 10 frames worth of updates again. To not cause frame delays, you would need to be able to calculate these updates in a single frame, so you would have to optimize the came with expectation that only 10 % of computation power is being used on logic side. And if you actually have network delay that fits into single frame, all that memory and optimization for update time was wasted.

Many gamedevs would rather eliminate the delay (physics give some hard limits to this, so can't do it completely, but usually its just a small portion of the whole delay), fit it inside other delays (send input first thing each frame, spend most of the frame time in something else, then update opponents on last ms when you have their inputs received), or make sure the prediction is always correct enough that you don't need to roll back (just adjust the current state rather than recompute it from older state).

Also, during these 10 frames you might have seen that you got a hit, but the rollback might make it so that you missed. It is often considered bad practice to change something that the player has already seen, especially against them.

While its best solution we have at the present, at least in its more advanced forms, many developers kinda live in hope that its solution to problem they don't have to deal with or that they can solve in more clean way.