Game Networking Weekly #6
A Physics Engine with Incremental Rollback Wayback
Easel switched to a new custom physics engine that snapshots and rolls back only changed state rather than the whole world. The goal was to support larger environments. The article describes some neat edge cases they considered and some choices they made to enable the games they want to be able to create on their platform.
Deep Dish Dungeon: Three-player online co-op in Unity Wayback
This two-person dev team (one artist, one programmer/everything else) made a 1-3 player co-op dungeon crawler that reached over 500,000 wishlists on Steam. Article talks about how they decided to leverage a bunch of Unity 6 built-in features like Netcode for GameObjects to replace 3rd party packages they relied on for previous games. Game uses a peer-to-peer networking model with one player designated as a host.
They side-stepped most of the difficult netcode issues by choosing to design their game around the limitations of not being able to spend a ton of focus on netcode. This was very smart given their extremely small team. Still they did manage to support join-in-progress which can be non-trivial even on a simple game. Overall this is more of a marketing post but still worth a read.
Fixing the Internet for Real Time Applications: Part I Wayback
Riot discusses why the normal internet is not great for real-time game traffic. Providers’ routing policies can favor cost over latency and BGP doesn’t automatically find you the fastest route.
Games like to send many small updates, because it’s better for responsiveness to player input, but that can put more pressure on routers. A common router buffering model has a fixed number of packet slots, and so even a small packet still takes a whole slot. Thus small packets can overload a router more easily than large packets for the same bandwidth.
Once a router is overloaded, a common strategy is to drop UDP packets since it:
- knows that TCP will be retransmitted if dropped
- has no way to know if UDP traffic is meant to be reliable (i.e. will retransmit)
The broader point is similar to the routing side of Valve’s SDR featured in Game Networking Weekly #4: the public internet is not set up for gaming.
Classic
John Carmack's QuakeWorld plan Wayback
Carmack’s original QuakeWorld plan is the genesis for much of the real-time multiplayer netcode we have today. I love that at the time it was still very uncertain if this “definitely cool” internet gaming “can actually make money”. Many important ideas appear together in this early plan, such as:
- Master server discovery.
- Hosting multiple game servers per dedicated server.
- Matching physics simulation between client and server.
- Moderation and banning of bad actors.
- Bandwidth estimation for flow control.
- Client side movement simulation with server authority.
The new code has the unreliable packet as its basic primitive, and all the complexities that entails is now visible to the main code instead of hidden under the net api.
This is a key insight. If you try to fully abstract away all of the complexity of a system from the game code you’ll end up with a brittle system that is much more complex. It’s much better to create honest abstractions that are fit to purpose for the problem.
The proper way to address this is by changing the server model from a game style loop to a fileserver/database style loop.
Instead of expecting everyone’s messages to be dealt with at once, I now deal with each packet as it comes in. That player alone is moved forward in time, and a custom response is sent out in very short order. The rest of the objects in the world are spread out between the incoming packets. There are a lot of issues that that brings up. Time is no longer advancing uniformly for all objects in the world, which can cause a lot of problems.
This is a particularly interesting bit. It’s quite similar to how Unreal’s Character Movement Component evaluates movement as soon as the ServerMove RPC arrives. But this is not a technique that survived through other Quake-lineage titles like Doom 3 and the Source engine shooters. Although interestingly, CS2’s sub-tick system sort of echoes the same goal through a different mechanism.
but you will need to lead your opponents differently when shooting at them.
Foreshadows the lag compensation technique that helped make Counter-Strike so popular.