This week’s video (number 3) shows off my network code prototype.

Network code is complicated. Probably too complicated to properly explain in this style of video. But damn if I didn’t try anyway…

Like the last video, I recommend watching in HD so you can see the text.

Comments

Brian

12:41 pm, Thursday 19 July 2012

That packet / buffer visualization is awesome. And it looks like you are handling packet loss and lag very well and completely smoothly.

I work full time as a web developer which, ironically, means I don’t have to deal with most of the complexities of networking in any of my projects. I find your video very helpful for wrapping one’s head around some of the concepts. You probably haven’t reached this point yet, but what do you plan to do to detect speed/noclip hacks without getting false positives from legitimate players who just have a poor connection to the server?

Andrew Russell

5:05 pm, Thursday 19 July 2012

Hi Brian,

Basically the server is authoritative. Clients send input commands (eg: “move forward”) to the server and the server will do the simulation to move the player forward. They are sent frequently enough that a few dropped packets don’t matter.

To reduce the appearance of lag, the client will also simulate the player moving forward (called “client-side prediction” because the client is predicting the result of the server’s simulation). But this simulation is never sent to any other client. If the client and server disagree about the result of the simulation, the server’s result takes precedence.

If I manage to get it working properly this week, I’ll talk about this in video 8 🙂