Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Robinhood

DirectPlay or Socket

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

Advertisement
I personally have not use DirectPlay but I found WinSock easy enough to use. I started reading a DirectPlay tutorial but it seemed like more hassle than it was worth. You''re probably best with WinSock for a small application (assuming Windows).

Red Sodium
Build a man a fire, and he''ll be warm for a day. Set a man on fire, and he''ll be warm for the rest of his life. - Terry Pratchett

Share this post


Link to post
Share on other sites
Basically, DirectPlay is just a wrapper around winsock. Since professional game developers knew this, most of them decided to go straight to winsock, instead of dealing with dplay and all of it''s overhead. As a result, nobody uses dplay, since it''s just easier (and faster) to just use winsock. This is why Microsoft is no longer supporting or updating DirectPlay.

The answer: go with winsock.


Dustin Franklin
Mircrosoft DirectX MVP

Share this post


Link to post
Share on other sites
Seriously, Pipo? I thought UDP was best for things such as streaming and file transfer. Oh well, you are obviously more correct.

Red Sodium
Build a man a fire, and he''ll be warm for a day. Set a man on fire, and he''ll be warm for the rest of his life. - Terry Pratchett

Share this post


Link to post
Share on other sites
The book ''Advanced 3D Game Programming with DirectX 8.0'' by Peter walsh has a decent chapter on UDP (it actually has nothing to do with dx, so I don''t know why it''s in there).

You should actually be using UDP because, like pipo stated, it''s less complicated. UDP is like a bare-bones version of TCP. It''s much smaller, and much faster. However, TCP adds a lot of stability to your network transmissions, where UDP isn''t as reliable.

Most (if not all) professional games use UDP.

Share this post


Link to post
Share on other sites
Although DirectPlay isn't perfect, there ARE commercially released games using it!.

DirectPlay does provide extra functionality such as NAT support, session management, lobbying and voice communication. If you need that functionality, with sockets you'll need to implement it yourself. Additionally DirectPlay comes with tools for simulating various networking scenarios and connection types.

If support for DirectPlay is dropped altogether (as opposed to being "feature frozen"), IMO it'd be likely that a replacement would be released - likely tied into XNA.


The main advantages of sockets are the lower-level control over the connection and they're cross platform which may be handy if you're going for client-server based architechture where the persistent server stuff has to run on a flavour of *NIX.


On the UDP vs TCP issue, you'd likely want to use BOTH. Which one you use depends on what the purpose of the data being communicated is. For lobbying and setting up the session you'd probably want TCP for its guaranteed (but slow) nature and less reliable (but fast) UDP with your own dead-reckoning plus packet verification for the in-game packets.


Whichever you decide to go for (sockets or DirectPlay), do pay particular attention to the security of your code and make sure it works properly with firewalls (such as the one built into Windows XP and enabled by default in SP2).


Simon O'Connor
Game Programmer &
Microsoft DirectX MVP

[edited by - s1ca on May 31, 2004 8:50:42 AM]

Share this post


Link to post
Share on other sites
It''d be far easier to just use TCP/IP. You could implement a reliable UDP protocol, but then you need to spend time implementing it and testing it. The lag you get with TCP/IP doesn''t matter too much in lobby servers, since you''re just trying to match people up.

Share this post


Link to post
Share on other sites
quote:
Original post by S1CA
Although DirectPlay isn''t perfect, there ARE commercially released games using it!.
Really? Do you know which games use it? Now that I think about it, I think the Microsoft Flight Simulator series uses DirectPlay.

On the XNA topic, I bet that Microsoft will do just that. It should be very exciting, especially the merging of the XBOX and the PC. It''s probably going to involve a lot of gameplay decisions by the developer, though. For example, the XBOX will always have a disadvantage in first person shooters, since it doesn''t have a mouse (yet ).

Share this post


Link to post
Share on other sites

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