Jump to content
  • Advertisement
Sign in to follow this  
ChaosPhoenix

Sending too much data at once?

This topic is 5404 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

I'm currently sending 69 bytes per packet and I'm getting some strange values on the recving end. I know the size is huge but unfortunately I'm using a full 4 x 4 transformation matrix(16 floats). Is this TOO much to send across a LAN line, is it filling the recv buffer?

Share this post


Link to post
Share on other sites
Advertisement
69 bytes 20 times a second is less than 1.5 kilobytes per second, which should work even on a 28.8 modem -- assuming you're sending nothing else, of course :-)

If you're seeing "strange values" then you could suffer from:
- misaligned data
- reading vs. writing different amounts (different protocol versions, say)
- not properly using htonl()/ntohl() to account for endian differences

or just some regular bug in your program.

Btw: If your entities can't be scaled or sheared (which is the norm :-), then you can decompose the matrix into one position (3 floats) and one quaternion (4 floats, can be compressed to 3-value Euler angles). And you don't have to send floats; if the size of things is limited, 20 bits per position component and 16 bits per euler angle should be sufficient.

Share this post


Link to post
Share on other sites
Yes, I'm definately looking towards Quaternions towards whatever my next project is. This one is stuck with transform matrix.

And yes, it ended up being some misaligned data. Did a little sprucing up in my packet creation and it seems good now.

Share this post


Link to post
Share on other sites
You are not stuck with matrices. You can decompose the matrix into scale, quaternion and translation, and send those components, then re-compose a matrix on the other side. Unless, that is, you use shear and skew ;-)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!