🎉 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!

DirectPlay - msg size & send-rate

Started by
2 comments, last by stefu 23 years, 2 months ago
I''m great 3D programmer but new in networking. Currently I''m coding (C++) a 3D net racing sim, using OpenGL and DirectPlay Peer/Peer system. I''m jus wondering at what rate is the best to send data to all other players (all players send own car position to all others) and what is max size for singe message. At the moment the message data consists of car matrix, tyres'' rot angle, front tyre''s steer angle (84 bytes). It''s now sent 50 times per second. What do you think about the size and rate? Of course I have to add some deltas to message data and interpolate position cause the message arrival is not so frequently. I think 50 fps is too much. Another problem. If I send my MSG_CARDATA - message and there is stil older message queuing, how can I remove it? Is it good to just set the timeout value to match the send-rate? Thanks a lot for answers!
Advertisement
Hi Stefu,

1. 50 times per second is overkill. You should be able to get away with 10 times per second if you use proper interpolation.

2. You might try creating your own pre-queueing mechanism that allows you to remove messages. You would need to create it so that your queue only sends message to DirectPlay if DPlays buffers are not full. This would let you remove messages if they had not been sent yet.

Todd Barron
Author, Mutliplayer Game Programming
LostLogic
webmaster@lostlogic.com
www.lostlogic.com

LostLogicwww.GamerOutfit.comXBox 360 Community Games Reviews and NewsExisled - 2D/3D Shooter for XBox 360

Thanks a lot!

Yes, the 50 times per sec really is too much. It worked when I opened two apps in single machine (TCP/IP), but now I tried over internet and it jammed my app after few seconds.

Pre-queuing sounds good, something I''v thought myself too.
Try to avoid having your data send rate locked into your graphics frame rate. This would be bad since people with slower computers will not be-able to keep up with the faster computers.

Instead try to use a graphics independant frame rate.

Also, I have found that Directplay is happy to accept the messages as fast as you give them to it. Unfortunatly it will buffer them internally, either because it can''t get them out fast enough or because it is throttling back due to the client not being able to accept them fast enough.

Thus it is hard to tell how long your message will hang around in the internal DirectPlay buffer. So try to regulate the speed at which you supply them to Directplay. The intefaces provide methods for monitoring the internal buffers.

Directplay does provide a time out feature. Perhaps you could look at how many messages are timing out and use that as a means of regulating your throughput.



This topic is closed to new replies.

Advertisement