5 ms·
From the website: "Of course, I’m ending up reimplementing a lot of TCP, with packet resending and ordering for most things, so I’m not totally sure all this w
by Aardwolf 14y ago
From the website:
"Of course, I’m ending up reimplementing a lot of TCP, with packet resending and ordering for most things, so I’m not totally sure all this work is actually worth it, heh."
Then, maybe, don't, and just use it... :)
- jws 14y agoGenerally, if you have to automatically survive a broken connection, you may feel an intense sense of duplicating TCP. If you have to make decisions about bandwidth utilization it gets even more redundant.
- jiggy2011 14y agoThe problem will be latency, maybe there are some situations when you need to make sure you get all the packets in order but others where you don't. For example , if you send an in-game message then this needs to be in the correct order. On the other hand if you have a spaceship turning quickly then as it's angle and velocity changes old information becomes useless so you will just introduce lag if you hang around waiting for old packets before doing anything with the new ones. http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/ http://gafferongames.com/networking-for-game-programmers/udp...
- davidp 14y agoThat's when you turn to using multiple data streams/connections/endpoints. Funnelling multiple data streams with different needs over a single mechanism (TCP, or UDP, or smoke signals) only yields misery, sadness, and death.
- jiggy2011 14y agoUsing UDP and TCP at the same time can cause increased packet loss in UDP according to a paper linked from the article above. http://www.isoc.org/INET97/proceedings/F3/F3_1.HTM http://www.isoc.org/INET97/proceedings/F3/F3_1.HTM I haven't read the whole thing, but the TL;DR appears to be: If the connection is good then TCP will keep increasing it's Window size until packet loss occurs. This will cause the sender to keep sending more packets. The result of this is that the TCP connection will start to consume most of the available bandwidth effectively drowning out more of the UDP packets (e.g if a buffer in a router starts to become full). TCP is designed to play nice with other TCP connections. This is probably precisely what you don't want in a game where the UDP packets contain the most important information.