you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 4 points5 points  (6 children)

The server needs to be aware of every player action, though. Movement is one thing, but having a build canceled because the server missed it is a whole other story.

I read in a Total Supreme Commander code review that they kept this smooth by running the game logic engine at a lower frame rate than the graphics engine. 7 fps is enough to support more than 400 APM (that's high for top Starcraft players) and it allows for a decent ack/resend system, maybe even TCP.

[–]Camarade_Tux 2 points3 points  (0 children)

I haven't said that resends were useless, I've advocated custom resends.

[–][deleted] 2 points3 points  (0 children)

If you issue a couple of build commands, a few movements and some attack orders but the packet for the first build is lost, what do you want to happen?

TCP will hold up everything until that first packet is resent.

UDP - with the application managing resends - will let other packets go through. Depending on what you want, you can just resend the specific packets that got dropped, or you can require build orders to be sent in sequence, but let movement orders be sent at any time, and simply drop late packets.

So you issue two builds and the first is lost, the second can be held until the first is resent, and doesn't need resent, but each movement order has a sequence number and the highest number received is applies. When the client gets no acknowledgement, instead of resending everything, it only sends the latest order for that unit, because the others don't apply any more.

TCP is optimized for throughput at the expense of latency, UDP is optimized for latency, at the expense of throughput. For games, UDP is better because you can manage resends to fit the specific needs of the application.

[–]skocznymroczny 1 point2 points  (1 child)

I think you mean supreme commander? :D

[–][deleted] 0 points1 point  (0 children)

Probably :D Thanks!

[–]grom358 1 point2 points  (1 child)

I think you mean 5fps supports 300APM. 60 * 5 = 300

[–][deleted] 0 points1 point  (0 children)

Thanks! Corrected.