DatagramPacket delivery system (UDP in Java)

[quote]the first thing you should do is to abstract the network part, so you will be able to switch to UDP or any other network protocol pretty easily
[/quote]
I was able to drop a large part of my “abstraction” pretty easily when I was able to assume reliable, ordered transport. My game side packet headers also got smaller. Switching back to UDP would require quite different assumptions and a bigger “abstraction” since there are packets that need ordering and some that don’t and some that need reliable transport and some that don’t. If this not the case. ie you need everything to be ordered and reliable --like I assume now, there is really no reason to move to UDP.

I think for getting things starting a network “abstraction” that assumes reliable orderd transport is fine. You can always add all the extra stuff that UDP makes hard/lets you do when you need it. The difference is, you are adding to a code base that already is working.

Always think, how can i get a playable version going easiest…

It has to be said that the Q3 network model is specifically designed to only work when packet delivery is slightly unreliable and out-of-order. It won’t be nearly as efficient running over TCP and may even be worse (but you’d have to check that, of course)

Cas :slight_smile:

Quake is a special case really. It is a perfect example of when UDP is the right choice.

But they have no reliable delivery code and they don’t do resends on undelivered packets. Every game frame the full game state is sent at a fixed rate. Thats it. The clients only care about the latest game frame and ignore everything else. All the flow control and reliably ack packet complexity simply does not exist. UDP really makes scene when you can do this.

But this won’t work for MMO or RTS where the game state is too large for a packet. At that stage loosing a packet can matter.

ps. I often tunnel Q3 over ssh TCP as a fake VPN. It plays just fine.

UDP can be a good choice in any case you got keyframes & intermediate frames as in video, but this can also apply to a lot of game

hehe this just mean that Q3 is well programmmed and that it network architecture doesn’t blowup as we may have expect in such case (tunneling), but in another hand tunneling via TCP just make all your UDP packet reach their destination and in the correct order that why I guess there are few resent and why the tunnel doesn’t explode, but anyway… why are you doing that !?

it might just as well simply work because of they way the tunnel or rather how udp over tcp was implemented if you simply drop incomming udp packages at the start of tunnel if the tunnel is congested… - you can because udp doesn’t have to be reliable. So you end up with the situation that the udp packages to be send never end up in the tcp stream.

well that and the much simpler explanation: typical bandwidth has increased by at least 10 fold or something over the years. q3 dates from a time 56k wasn’t uncommon.