Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

10
  • 7
    internet is now pretty fast and reliable No, it's not. The bandwidth has dramatically increased, yes, but latency is still quite high. With pure TCP you need the server tick time to be more than the max affordable latency, unless you do packet squishing - which is best done at the client via UDP. The problem is that some info in a game needs to be reliable, while some other needs to be fast. Custom protocols on top of UDP allow for that, as well as a bunch of proprietary ones that give you everything you need in a nice package. Commented Feb 14, 2017 at 18:34
  • 5
    They don't exactly implement TCP over UDP. There are some features that TCP offer which are desirable and that are implemented on top of UDP. A major point of using UDP is that if you send a packet containing the world state at time t0 that is never received, then you send the new world state at time t1, you don't have to wait until the client actually receive the first package, which is already obsolete. Commented Feb 14, 2017 at 18:51
  • @Ordous I think this answers my question :) Thanks Commented Feb 14, 2017 at 18:54
  • 4
    Also be aware that UDP is prone to IP spoofing which could make your server open to DDoS attacks if that is a concern. You could avoid that by having a "control" TCP connection that sends the clients IP address and other details to the server which then accepts UDP packets from the "authenticated" address. Also you may have to implement your own encryption layer as there are no open standards for that over UDP. Commented Feb 14, 2017 at 19:21
  • @blownie55 good points there Commented Feb 14, 2017 at 19:34