123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|663|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> On Topic -> TCP or UDP

Thu, 20 Dec 2007, 17:36
dna

Which of these streaming formats is faster?
Which of these streaming formats is more simple to use?


-=-=-
DNA
Thu, 20 Dec 2007, 18:13
mike_g
UDP is faster as there is no reply when you send data that way. For most situations TCP is better. There should be little difference in how easy they are to use.
Fri, 21 Dec 2007, 20:48
Afr0
Absolute bullocks!

UDP is faster, and as such is much more suited than TCP for responsive games, namely FPSs and the like. You can get away with TCP for MMORPGs, because their gameplay (even realtime) tends to be relatively slow and unresponsive in nature. Note, however, that WoW was the first 'large-scale' MMORPG to use TCP *exclusively* for it's protocol - most MMOs tend to at least use UDP for login, account and auction stuff because it's faster.

When that's said, UDP is much harder to work with, because UDP packets are not neccessarily ordered, and are most of the time broken up, so that sending two strings (for instance) more often than not can result in:

Packet1:
'String1Str'

Packet2:
'ing2'

In other words, when using UDP you have to invent your own mechanism to ensure that data that belongs in one packet but was contained in another packet gets where it belongs before the packet is processed.

Edit: The Sims Online comes to mind as using SSL (and thereby TCP, as SSL is built on TCP) exclusively for it's protocol, and it was released before WoW, though it's gameplay is even slower than WoW's... so slow, in fact, that I cannot think of any other multiplayer games off the top of my head that are slower (with a possible exception being Civilization in multiplayer mode, starting with the expansion to Civ3).

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Sat, 22 Dec 2007, 09:01
mike_g
Absolute bullocks!

I was not exactly wrong, just a bit vague
Thu, 10 Jan 2008, 22:48
oscar
"most MMOs tend to at least use UDP for login, account and auction stuff because it's faster."

that's not true... UDP is not reliable to use for something as important as logins... there is no garauntee that the data will EVER arrive (unlike TCP). UDP is a one way protocol. That means taht is just pumps data out and doesn't care what happens after that. so if you try and login to a site and one of the packets happens to not make it... theres nothing taht can be done.

you use UDP for streaming video and the like (where it doesn't matter if one or two packets go missing)
Fri, 11 Jan 2008, 10:28
Afr0
Of course there's something that can be done! :|
You can make reliable protocols over UDP also... if you know that there's a packet that's supposed to be there and it didn't arrive, you either request the client or the server (depending on who you are) to send it to you again.

Edit: Check here for an example if you don't believe me.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!
Fri, 11 Jan 2008, 21:30
oscar
the problem is that UDP *ITSELF* doesn't allow you todo error checking and if you are building error checking onto UDP... why not just use tcp instead?
Sat, 12 Jan 2008, 01:01
Afr0
Because, do it right, and the result will *still* be faster than TCP.

Edit: Only slightly, and for that much more work, but enough to make a difference when it counts.

-=-=-
Afr0 Games

Project Dollhouse on Github - Please fork!