When will we have UDP?!

I just hit a roadblock developing a fast-twitch html5 game. Websockets only use TCP which are just way too slow for this. I'm aware that webRTC datachannels are coming along but they seem to be soley p2p. We need UDP connections with servers! Why don't we have this already? It's insane.

Edit: I'm by no means a master in this subject, but here is why I feel that we need UDP for HTML5 gaming. The use-case for UDP is a situation where you need packets as fast as possible and you don't care if a few get lost. A racing game or a shooting game's state packages are a good example because you need the game to be fast enough to react quickly, and you want those states to arrive asap. But if some packets get lost it's fine; by the time they were resent by the origin they would have been too old by the time they got to you. TCP in the other hand asks for confirmation of every single packet arriving, and if the packet doesn't arrive, it will resend it. This uses more bandwidth than UDP for the packet confirmation and holds all of the other packets up. So one small packet loss has a compounding effect, causing a whole bunch of packets to be sent late.

tl;dr: problems with TCP for reaction gaming as opposed to UDP:

  • increased bandwidth used per packet
  • does not allow packet loss leading to knock-on latency after any amount of packet loss.

Further edit: I think our best bet is the webRTC project. They already have peer-to-peer UDP via the RTP protocol. If this could be extended to include servers then it would bridge this gap.

Posted Jun 13, 2013, 1:35 AM UTC · edited

816
Loading comments…