Jump to content
  • Advertisement
Sign in to follow this  
Westeria

Nature of the UDP packet sends.

This topic is 5045 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Its always been my understanding that since UDP has very little header information, you could get away with sending alot of packets per frame in game. My game runs at a smooth FPS, (20 <= FPS <= 50). And with sending 4 packets per frame, it gets boggled down (I'm on a Network, so its really strange). eg.. my game was model'd so that each packet was a creature update. So if you walked into a room with 10 creatures, you'd get 10 packets per frame. So really, I'm wondering... should I be aiming for a certian size of packet? eg... close, but not a byte over, 64kb?

Share this post


Link to post
Share on other sites
Advertisement
It depends on whether you're aiming at LAN or Internet network play. The optimum packet size is that at which it won't get fragmented as it travels over the network. I can't remember off hand what the best sizes are though. The Winsock Programmers FAQ is a pretty good source of information - http://tangentsoft.net/wskfaq/

But yeah, you really don't want to put each monster's info in a separate packet - each individual send occurs numerous overhead penalties as it sinks through the network stack layers to the hardware then rises back up at the other end, plus the more packets you send, the more chance of losing some (UDP being unreliable).

Share this post


Link to post
Share on other sites
64 kB UDP packets? Crikey...

The guaranteed-unbroken UDP packet size, if I remember right, is something like 560-ish bytes total (header and data). Could be wrong.

Anyways, I'd say a good rate would be one packet for all creatures, at most 10 or 15 times per second, to keep from bogging the local (or at least the local part of the) network into the ground.

Share this post


Link to post
Share on other sites
Each creature is roughly 107 bytes, but I can shrink to 80 relatively easy.

Put > 7 creatures on the screen at one point, and the UDP packets become fragmented?

What does fragmented UDP packets mean? Do I have to change my code over it?

UDP packets arrive in random order, so theoretically, combine that with random sizes, and it makes it IMPOSSIBLE to work with.

So what is a fragmented UDP packet?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!