Avatar

UDP vs. TCP (Destiny)

by Beorn @, <End of Failed Timeline>, Wednesday, July 01, 2015, 20:46 (3233 days ago) @ ChrisTheeCrappy

Does anyone know if their netcode is TCP instead of UDP? It just seems like they don't want to decide a winner, so everyone loses. And that was one of the reasons they stated they didn't do TCP in PvP during Halo Reach but did for FireFight (prob why FF vs was never a constant thing)

So... any system that is sending real-time data is going to use UDP instead of TCP. This is as true for Destiny/Halo/CoD as it is for a Skype video chat or a VoIP phone call.

The benefit that TCP offers is that it guarantees complete bit-perfect transmission, which is essential for something like serving a web page or downloading an application binary. There is, however, non-trivial overhead involved in the setup, transmission, and teardown of those connections. In TCP, the Source needs to remember what it sent until the Recipient acknowledges that it received those bytes, and if the routing between two hosts is wonky, the server ends up spending a lot of time re-transmitting stuff that it had already sent. This re-transmission can delay new data from being sent immediately, so a few transmission errors can cause a cascade of delays and it can be impossible to catch back up to real-time. In a game, this would be awful.

UDP, on the other hand, does not guarantee packet arrival, instead opting for a quick, "best attempt" transmission. In real-time applications, "old" packets are useless (who needs to know where the enemy was or what someone said 5 seconds ago?!), so it's better to just ship the data and assume that the recipient will receive most of what was sent. Anything that's missing can be "smudged over" with interpolation because it'll be irrelevant after a few seconds anyway.

In short, downloading an OS update to your computer is not time sensitive but does require a 100% bit-perfect transmission, so the overhead that TCP provides is worthwhile. But knowing exactly where the damn Blade Dancer is right now can be critical to the game experience, so TCP overhead can actually cause more problems than it solves for real-time applications, and that's why games and voice chats use UDP. ;-)

That said, there are certainly things I'd expect Destiny to use TCP for (although I have no idea if this is actually true), most notably transactional information from the world server such as loot drops, equipment changes, XP gains, and the like. That's the sort of stuff you want to make sure the server knows about, be it 0.05 or 5 seconds after the fact.

I don't remember Firefight switching the networking code to TCP, but it would make sense in light of the fact that the game was in "lockstep," requiring everyone to pause and re-synchronize when clients fell behind. That sort of thing would be absolutely horrendous in PvP.


Complete thread:

 RSS Feed of thread