Live data from Hacker News

Is it just me or is networking really hard?

gafferongames.com

11–20 of 188 posts

Re: Is it just me or is networking really hard?

#11
post #7
post #6

> We have the Tribes Networking Model, The Unreal Networking Model, Valve Latency Compensation article. Which are all derivatives of the Quake model.

Can you point out where the Quake model is described in sufficient detail that one can reimplement it for one's own game? Or is it open source?

Well Quake is open source, so that might be a good place to start: https://github.com/id-Software/Quake

I don't know if it's described sufficiently detailed anywhere besides the source though.

Re: Is it just me or is networking really hard?

#12
post #2

Reading this one could think you would be a fool to use TCP, yet some games (such as World of Warcraft) use TCP exclusively with no problems... What gives?

Well, World of Warcraft does feel like moving in jello as compared to well optimized UDP-based games like Counter-Strike for instance. However, it does not matter for World of Warcraft very much.

Re: Is it just me or is networking really hard?

#14
post #7
post #6

> We have the Tribes Networking Model, The Unreal Networking Model, Valve Latency Compensation article. Which are all derivatives of the Quake model.

Can you point out where the Quake model is described in sufficient detail that one can reimplement it for one's own game? Or is it open source?

Perhaps if you're going for simplicity or something then that might be an ok idea, but he mentions those three because they are more modern or important additions to the Quake model. He is of course very aware of their Quake heritage, at the end of this article he credits John Carmack (in an indirect way).

I recommend reading the rest of Gaffer's articles before doing anything, it will give you a basis that's needed to understand why Quake does what it does.

Re: Is it just me or is networking really hard?

#15
I'm thinking to add online multiplayer to my game: http://store.steampowered.com/app/363670

...so this was very interesting read. I investigated a little bit, and found that there are more protocols than just pure UDP, and now I can't decide which one to try. I narrowed it down to these three:

* PCC http://modong.github.io/pcc-page/

* NORM http://www.nrl.navy.mil/itd/ncs/products/norm

* ENet over UDP http://enet.bespin.org/

What do you think?

Re: Is it just me or is networking really hard?

#16

I've written a series of articles about this topic: http://gabrielgambetta.com/fast_paced_multiplayer.html It's usually well received, perhaps because it builds the ideas from the ground up and does not include the words "What the fuck is wrong with you?" .

Thanks very much for this, these are great articles.

It seems one would need some way of synchronizing clocks (or measuring the lag between server and client). Do you know if there is a standard way of accomplishing this?

Re: Is it just me or is networking really hard?

#17

I've written a series of articles about this topic: http://gabrielgambetta.com/fast_paced_multiplayer.html It's usually well received, perhaps because it builds the ideas from the ground up and does not include the words "What the fuck is wrong with you?" .

gaffer's other articles are not expletive laden, but when you've been writing on a topic for so long and people are _still_ spreading lies and nonsense about it, even _after_ reading your articles, you too might reach a breaking point.

Re: Is it just me or is networking really hard?

#18
Networking has local time, like the relativity theory. "Those two packets are at the same time at point a, but not point b." "A sends b and C sends d, but since time is local you cannot" etc.

So IMO it makes sense that networking is really hard. I like it though. Networking problems are clear when you think hard about them, unlike so many of today's programming problems, where the key is to know some half-documented aspect of a large framework/library/whatnot.

Re: Is it just me or is networking really hard?

#19
post #2

Reading this one could think you would be a fool to use TCP, yet some games (such as World of Warcraft) use TCP exclusively with no problems... What gives?

Some games require less latency than others. WoW is a good example of a game that doesn't really have any precision combat. You don't have to aim at enemies there, you just have to lock them for your auto-target.

Re: Is it just me or is networking really hard?

#20
post #2

Reading this one could think you would be a fool to use TCP, yet some games (such as World of Warcraft) use TCP exclusively with no problems... What gives?

World of Warcraft is a pretty slow-paced game on "the inside", it just looks like a fast real time game but it's almost turn based when you analyze the gameplay. When you cast a spell, you'll instantly see the animation that your character is casting the spell, but the actual effect comes only when the animation is complete. This animation is used to hide the network latency (other players might see the animation played back slightly faster to compensate for the lag). Further, once you cast the spell, it must succeed and you can't really do anything before it has completed. In other words, reliability is essential and latency can be hidden.

Contrast this with a fast paced, (soft) real time multiplayer game. When a player jumps, the jump has to start immediately. If you want to jump and shoot, the shots have to be fired right away, you can't wait for the jump to complete before shots are fired. With TCP, you'd be stuck on the ground until the "jump" packet is re-transmitted (two or more network round trips, tens to hundreds of milliseconds, very noticeable) and no shots would be fired until the character is off the ground.

In a real time game, old packets are next to useless. Re-transmitting is wasting bandwidth and causing lag by blocking on information that is no longer useful. The networking model (like OP describes) is a constant stream of packets containing redundant information, minimum latency is essential and loss of packets is tolerated.

You should be aware that TCP vs. UDP becomes apparent only when network conditions are bad. You could choose either and have satisfactory results 90% of the time, but once packets get lost, TCP does the wrong thing when it comes to fast paced real time games.

If you do take the time to read Gaffer's original article, you should see that it is different from TCP in many ways. Yes it does similar things (reliability, flow control, etc) but in a completely different manner, tuned for a completely different use case.

Post reply on HN