Take the 2-minute tour ×

so ive read this post here: and im a bit confused, so here's my additional question:

how does UDP handle data which are lost? because it says there that UDP doesn't care if the data will arrive to the destination or the ordering of data.

SO example in an on line game, how does UDP handle data loss? my understanding is that when a data is lost so lets say my character's hand cant be seen in an on line game? or the warglaive of azinoth which i farmed for years is lost? LOL

and if the ordering is not important so lets say i the head of my character will be messed up or the body will be dislocated, something like that.

So can anyone clarify this for me?

share|improve this question

closed as off topic by Filburt, M42, Vladimir, alecxe, Aleksandr M May 31 '13 at 10:05


As mentioned in the post you reference, UDP does not care about anything other than sending packets. It doesn't handle order, it doesn't handle if they arrive, ... It only sends packets. If a packet gets lost somewhere, on the receiver end it will be as if it was never sent. If you need handling of lost packets you either have to use TCP or implement your own handling with UDP - for instance, send packets back with information on which packets were received. But I believe this question is offtopic, as the referenced one was too. –  Bikonja May 31 '13 at 7:35

1 Answer 1

up vote 2 down vote accepted

A better example of UDP in gaming is for position information.

In this case the position of a character is sent several times a second and it doesn't matter whether a packet is lost as another one will be sent again shortly. When you combine this with a game engine that does some level of interpolation and extrapolation then you can achieve smooth looking motion from sporadic data.

In the case of re-ordering if you receive a character position which is older (in time) due to packet re-ordering you would just discard it as you've already got a newer value.

With your example of loot - it's possible this information is sent via TCP or using a reliable wrapper around UDP - to your client.

Take a look at http://code.google.com/p/lidgren-network-gen3/ for a C# UDP networking library which is designed with games in mind. It provides various unreliable and reliable channels over UDP and should give you an idea how UDP is typically used in games.

share|improve this answer
ohhh i get it. the "doesn't care if the packets are sent" is the one referred to as lag in on line games? am i right? –  Monkey May 31 '13 at 7:46
