Directplay tcp/ip

Started by
3 comments, last by supercow 22 years, 5 months ago
I was taught that tcp/ip, although it supports guaranteed delivery, is very slow, so I had planned to use udp. But, when I started to use direct play, there is no "pure" udp that I can see, but the tcp/ip protocol (in direct-play) seems to allow guaranteed/non-guaranteed delivery for packets. Is this as fast as writing my own udp (for speed) selective delivery-guarantying system??? Also, since position update packets (in a game) are sent so often, I assume I shouldn''t set the guarantied-delivery flag on each position packet. Will the position-update packets arrive in order or could they possibly come in out-of-order. If so, anyone have any idea how to figure out which packet is the newest??? Thanks, Kevin
Moo goes the cow
Advertisement
1) Using DirectPlay is not as efficient as writing a UDP handler that does only what you want it to (and not extra overhead necessary for DP sessions). If you absolutely need UDP raw speed, then go for it. But you might save headaches by seeing what DP is actually capable of in terms of speed (also depends on your target audience... if this does not include modem users, then definitely use DP).

2) You can always include packet indicing... simply increment a value and include this in the packet data. Then at least you may discard older packets if newer ones are available right away.




MatrixCubed
http://MatrixCubed.org






quote:
I was taught that tcp/ip, although it supports guaranteed delivery, is very slow, so I had planned to use udp. But, when I started to use direct play, there is no "pure" udp that I can see, but the tcp/ip protocol (in direct-play) seems to allow guaranteed/non-guaranteed delivery for packets. Is this as fast as writing my own udp (for speed) selective delivery-guarantying system???


Where do you see it''s TCP/IP? It''s pure UDP. btw, I like DP8. I do not need to reinvent the wheel for gaurenteed/prioritizing messages, etc.

quote:
Also, since position update packets (in a game) are sent so often, I assume I shouldn''t set the guarantied-delivery flag on each position packet. Will the position-update packets arrive in order or could they possibly come in out-of-order. If so, anyone have any idea how to figure out which packet is the newest???


With DP8 you can specify an flag if you want all the packets in the right order,''I only forgot which one at the moment. It''s with all the other flags, High priority, gaurenteed, no loopback, etc.

Sending everything gaurenteed is not recommended though.
www.persistentrealities.com for Inline ASM for VB, VB Fibre, and other nice code samples in C++, PHP, ASP, etc.<br/>Play Yet Another Laser Game!<br/>
Ok, thanks.

But does the ''arrive in order'' flag really slow down things? Also, if I just increament a number, won''t that start to slow down the packets? I''m guesing that I would have to reset tghe number before it gets too large.

Thanks again,
Kevin
Moo goes the cow
What about your thoughts on DP7? Is there any major shortcomings or differences between it and 8? I''m programming in a different language and it only takes advantage of dx7 so thats why I ask..

This topic is closed to new replies.

Advertisement