🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

TCP-IP: All at once OR whenever

Started by
6 comments, last by Spyder 23 years, 8 months ago
I need help with the following scenario:
A multiplayer tcp-ip game where alot of movement and messaging etc is going on. Is it better to collect all updates and send them along with the movement at regular intervals, or better to send all updates between the intervals whenever there is something to send?
Advertisement
What kind of game? And everyone seems to recommend udp (for good reasons)
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
It''s an arcade style of game. All I wonder is how to get most out of tcp-ip. Send large collected messages at regular intervals, or send small whenever there is something to send?
my guess would be, collect them all and send, else ur gonna be opening - closing the connection 100''s of times .. i think
X
Ok thx. Any other opinions?
You don''t close the connection between packets!

Specifically, what kind of game? Galaga? Racing (car boat or whatever?)

How many players? 2, 8, 32, 1000''s?


Do you want to lock frames or let the hardware render as fast as it can?
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
This question isn''t as important to worry about for TCP as it is for UDP. For TCP the OS decides when to send data, how much to send, etc and you don''t have a whole lot of control over it. When your code sends some data it typically isn''t actually sent - it''s buffered until the OS decides to send it. You might see a slight perf improvement if you collect the data yourself but I''d probably just do whatever is easiest for you.

For UDP you do have control over how much data gets into a particular packet, indirect control over when the packets go out, etc. so these issues are more important to worry over.

-Mike
I''m a fan of collecting the data on the server and performing one send to each client. And as the previous poster hinted... make SURE you disable NAGLE on the socket.

This topic is closed to new replies.

Advertisement