Jump to content
Jade Shadows: Share Bug Reports and Feedback Here! ×

Switch Udp To Tcp


Keetsune
 Share

Recommended Posts

reason for using UDP is because their is drastically less latency due to no error checking.  Try streaming 1080p video with 10.1 surround sound to 3 different people using your home internet.  Wouldn't work too well, would it?

Link to comment
Share on other sites

reason for using UDP

There is no reason to use UDP protocol in 2013 year especially in online games. UDP is damn relic of 20 century, which in case of this game make a lot of network issues.

Edited by Keetsune
Link to comment
Share on other sites

... dude, do you even know the differences between UDP and TCP? -__-"

 

... and why UDP is used on almost all online games? -_______-"

 

sorry if this is insulting, but please don't talk like you understand everything. because you don't.

Edited by agung.up
Link to comment
Share on other sites

The problem with using TCP for games is that unlike web browsers, or email or most other applications, multiplayer games have a real time requirement on packet delivery. For many parts of your game, for example player input and character positions, it really doesn’t matter what happened a second ago, you only care about the most recent data.

Consider a very simple example of a multiplayer game, some sort of action game like a shooter. You want to network this in a very simple way. Every frame you send the input from the client to the server (eg. keypresses, mouse input controller input), and each frame the server processes the input from each player, updates the simulation, then sends the current position of game objects back to the client for rendering.

So in our simple multiplayer game, whenever a packet is lost, everything has to stop and wait for that packet to be resent. On the client game objects stop receiving updates so they appear to be standing still, and on the server input stops getting through from the client, so the players cannot move or shoot. When the resent packet finally arrives, you receive this stale, out of date information that you don’t even care about! Plus, there are packets backed up in queue waiting for the resend which arrive at same time, so you have to process all of these packets in one frame. Everything is clumped up!

Unfortunately, there is nothing you can do to fix this behavior with TCP, nor would you want to, it is just the fundamental nature of it! This is just what it takes to make the unreliable, packet-based internet look like a reliable-ordered stream.

We don’t want a reliable ordered stream.

We want our data to get as quickly as possible from client to server without ever having to wait for lost data to be resent.

This is why you never use TCP for networking a multiplayer game.

Link to comment
Share on other sites

This topic is not for you.

well thanks then. you have proven that you actually don't know about it.

 

aaaand for other people who visited this thread, wondering what is udp and tcp, i'll suggest at least visit wikipedia. for the more depth about why online games usually use udp, see some of these (WARNING! WALL OF TEXT!)

 

http://gafferongames.com/networking-for-game-programmers/udp-vs-tcp/

http://mmnet.iis.sinica.edu.tw/publication_detail.html?key=chen06_tcp

http://www.slideshare.net/mmnet/an-empirical-evaluation-of-tcp-performance-in-online-games

Link to comment
Share on other sites

/facepalm. Guys plz stop that, dont dive in discussion of things that you never will know and which you shouldn't know. This topic is for DE and maybe for ppls who atleast know what is winsock without using google.

Edited by Keetsune
Link to comment
Share on other sites

More than 99.999% of peoples that reading this post at them moment .. including you.

what you saying i dont get becuz not even gramatically. including you

 

I would do that with pleasure cause i can.

If you can than why are you asking? Go do it.

Link to comment
Share on other sites

What a horrible idea.

 

* Now your game is consuming WAY more bandwidth due to error checking, re-sending lost packets, and all that jazz.

 

* Got a lost packet? OKAY, lets wait until we get it! Meanwhile, the game can totally wait for it. Right? Right?

 

Mr. "Software Developer", there's a reason most of the software that needs fast (and not necessarily precise) data transfer over ethernet uses UDP.

Link to comment
Share on other sites

/facepalm. Guys plz stop that, dont dive in discussion of things that you never will know and which you shouldn't know. This topic is for DE.

now i'm pretty sure he's trolling. sorry guys, i'm really embarrassed going too far with this.... i'm out.

 

oh, and i "accidentally" report the thread as "he has a great idea for warframe developers. check this, it will make your day happier."

Edited by agung.up
Link to comment
Share on other sites

@Eversor

The biggest difference is that TCP is reliable and ordered. You send the data and you are gaurenteed, short of connection loss, that the data will all get there, and in the right order. But its slower because you have to check each and every packet to make sure its all there and in the right order, and if anything is wrong or missing you have to stop everything and resend that packet.

UDP on the otherhand doesn't know or care about what order the packets will get there, or if any will be missing. UDP is used when you want to get the information from one place to another quickly and not really caring if you have some data missing. Its a lot faster because it doesnt do the checks, your own code does.

In any realtime game you *cant* use TCP because of the error checking built into it. Anyone loses a packet? Better stop everything to resend it and make sure that the data is there again.

See the problem with trying to do that yet keep a game realtime for everyone else?

In UDP it doesnt care and just continues sending and recieving data without pausing if something is lost. Much more realtime than TCP can ever hope to be.

@Keetsune

Please tell me how you would overcome the built in latency and issues with TCP in a game like this? I'm a professional networker for my JOB and I know when to use both protocols. So please try to explain your reasoning and I'll explain why you're wrong.

Edited by Tsukinoki
Link to comment
Share on other sites

May i laugh?

Switching from UDP to TCP in a realtime online shooter... funniest thing I've heard today xD

(some online RPG's use TCP over UDP since they don't need Real-time as much as a shooter does, but lots of them have problems with TCP)

 

Srsly: bad Idea...

We have enough latency-issues with bad hosts as it is.

And as already mentioned: If a package is lost, who cares!

By the time it's discovered that the package is missing the data it contained isn't relevant anymore.

 

UDP a relic... afk, I'm a bit rolling around on the floor and laughing... xD

Link to comment
Share on other sites

@Keetsune

You got it wrong.

TCP will have a LOT more latency than UDP.

TCP will check and verify all packets and if any are dropped will ask for it to be resent. This pauses the game and everything stops. Meanwhile packets are building up. When it finally gets the packet again and verifies it, it can then check through all of the other packets.

That can be MASSIVE amount of lag and jerkiness for everyone.

In real time games what happened 5 seconds ago doesn't matter anymore and there is no point in asking for it.

UDP doesnt care and is a constant stream of packets without error checking.

Which is MUCH faster than TCP can ever hope to be.

And it doesnt care if it dropped a packet because it will have more up to date information by the time to sees that some information was lost.

And now I must ask, are you trolling? Or just completely ignorant?

Edited by Tsukinoki
Link to comment
Share on other sites

Probably trolling...

One of the first things you learn when dealing with TCP/UDP is, that TCP is pretty much just UDP + an additional layer of checks and the creation of a "connection" (things that create latency and are just not needed in this case (Sometimes TCP buffers the data until the package is at its max. size, that can increase latency too since the packages in online games are pretty small normally)),

all things that are supposed to make your life easier for streaming large files for example...

 

Thus there is no discussion "is TCP or UDP better", only is the one better for THIS SPECIAL SITUATION, and in this case UDP is clearly superior since you don't need the checks or the buffering.

 

Thus Keetsune either has really no idea how these protocols work or is trolling...

I hope trolling^^

Link to comment
Share on other sites

You cannot use TCP reliably for video games.  It is too slow due to it's error checking features.  This is why UDP is used to transport gaming packets.  UDP is also used for a lot of other things, it's still very common.  Your youtube videos are delivered via UDP for example.  Lots of things use UDP.  DHCP, DNS, TFTP, and lots more.

 

UDP is a modern protocol.  It's use is situation dependant, just like TCP.

 

TCP would result in obscene network latency and our connections would suffer.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...