![](smile.gif)
🎉 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!
Network traffic in games.
I''m creating an online action/strategy game.
I don''t know how some of you ppl talk about sending 500 byte UDP packets, when I have usually only 1-8 byte packets (+header) and I send them about 10 times per second. Only chat messages are bigger.
From client->server I send key presses (or coordinates). And from server->client only the stuff that client can see and what is important.
I also read about Serious Sam (a 3d action game like Quake) compressing UDP packets. Compressing?! The ~4 byte packets I use probably wouldn''t gain much from compression
.
I understand the header is 20 bytes and when my packets are only about 4 bytes, the header part is quite large. But still the traffic is about 1-2 kb/sec so who cares? Or am I missing something important now?
![](smile.gif)
In your situation I would not expect compression to do a whole lot for you.
There are infinite situations out there though and many of them benefit from compression.![](smile.gif)
Many games also "bunch" packets together before sending. So, if you bunched together 100 4-byte packets you may see benefit from compression.
LostLogic
"My book on multiplayer game programming coming out Q2/2001"
www.lostlogic.com
There are infinite situations out there though and many of them benefit from compression.
![](smile.gif)
Many games also "bunch" packets together before sending. So, if you bunched together 100 4-byte packets you may see benefit from compression.
LostLogic
"My book on multiplayer game programming coming out Q2/2001"
www.lostlogic.com
Good luck keeping the packets that low. You''ll find as you flesh out your client - server protocols and sync scheme, you''ll have to send more than 4 bytes / entity. What about world state data which the client doesn''t see ? or the timmer sync routine for the dead recoking to work? Etc.. it adds up, though not to 500 bytes/update worth though. It will proably be 50 bytes/update, more likely. And at times can peak at much higher, perhaps 2x - 3x that much per packet during heavy action scenes. As for compression it only becomes functional with an adaptive scheme or using a dictonary scheme sent async with the packets and the packets have to be large enough to be worth compressing.
I think the UDP header is 32 bytes.
Good Luck
-ddn
I think the UDP header is 32 bytes.
Good Luck
-ddn
8byte packets are inefficent, because 80% of the packet is overhead :p
And is that 8bytes per player?
And is that 8bytes per player?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement