Hacker News new | ask | show | jobs
by reitzensteinm 1998 days ago
That's exactly what happens. If you are writing the game yourself, you can do interpolation to fix things up gradually.

You can also delay significant events such as death until the rollback threshold has been passed, so you don't run in to knife edge situations where, e.g., it looks like you died and your character starts to ragdoll but then you snap back when it turns out you killed the enemy instead.

The key to it not being too disruptive is keeping the maximum rollback threshold fairly low. If you add inputs and your ping is greater than the threshold, they get delayed to a later frame, and your inputs start to feel sluggish (the server would enforce the delay, but you'd also add it client side).

1 comments

Thank you these types of comments are why I frequent HN! Really insightful, first time I came across rollback I had one of those loving CS/SWE moments. So I'm grateful that you're so obliging to my curiosity!

Out of interest are there any toy projects out there you can point to that can explore the concepts here with no first hand experience with game dev?

Hmm, I haven't come across any, although you can probably dive in and build a prototype system without too much trouble.

My recommendation would probably be to build it without netcode to start (two local clients connected over a virtual pipe), and using a system where you can easily serialize the game state - C with memcpy(), JavaScript reading/writing to json, Clojure or similar. I use C# with compile time generated codes to store data in slots - it's not fun.

While not rollback, the original AOE networking writeup is probably the best I've come across as an introduction to deterministic multiplayer. There's the GGPO framework that you can get off the shelf, but it's pretty heavy weight.

There are some real head scratching moments with debugging rollback, but in general for games that aren't too performance intensive it shines. I actually developed an entire strategy game prototype over a period of three weeks in single player before bothering to test it worked in multiplayer. It did first try. Four days later, it was live in public beta (starjack.io if you're interested, which peaked at around 400 concurrent players).

https://www.gamasutra.com/view/feature/131503/1500_archers_o... https://en.wikipedia.org/wiki/GGPO

Ah man a history lesson involving AOE netcode. This is the best - will take a look, thanks again!

Also well played on starjack, very impressive