Skip to main content
GameDev.net gamedev.net
🔒 Locked

DirectPlay??

Started by Mattman Apr 11, 2006 at 10:51 AM 7 replies 4k views
Original Post
Mattman
Mattman
I just saw this FAQ entry stating that DirectPlay is depreciated. Is there a DirectX (specifically Managed DirectX) replacement for DirectPlay? What is the recommended networking strategy for games today? Thank you!
alex_myrpg
alex_myrpg
Hi,
There certainly is a replacement...and a much better one: the System.Net namespace. Using Sockets (maybe TCPClient/TCPLisetner) you can communicated in any way you like other computers...
A good article was here *i believe*:
http://mdx.ircomm.net/Home/tabid/36/ctl/Details/mid/365/ItemID/7/Default.aspx
Unforunately, the site's down at the moment but when it's up I post some more exact info hopefully. In the meanwhile you can try these articles in addition:
http://www.codeproject.com/dotnet/dotnettcp.asp
http://www.dotnet247.com/247reference/a.aspx?u=http://msdn.microsoft.com/library/en-us/dnadvnet/html/vbnet08282001.asp?frame=true
http://www.dotnet247.com/247reference/msgs/51/257235.aspx
http://www.eggheadcafe.com/articles/20020323.asp

Hope it helps.

Alex
Mattman
Mattman
Quote:
Original post by alex_myrpg
A good article was here *i believe*:

Unforunately, the site's down at the moment but when it's up I post some more exact info hopefully. In the meanwhile you can try these articles in addition:


Alex,

Thanks for responding. Unfortunately, it looks like your articles didn't post in your response. If you come across this post again and have an opportunity to repost the links, I would greatly appreciate it. Thanks for pointing me in the right direction!!
alex_myrpg
alex_myrpg
Wow, you replied quickly. ;) I had some trouble with my browser and I couldn't get the links so I had to post then edit. Anyway they're in there now. If you don't mind, I'd like to hear what solution you decide on in the end - TCP/UDP sockets and whether you use binary/text format... because eventually I'll need to do something similar with my game.
Mattman
Mattman
Haha, thanks again for the info. The game I'm planning on working on is not going to be anything really advanced, just kind of a card game with a lobby to meet up for players and such. With such limited data going back and forth, I will undoubtedly be using TCP since every packet matters. Whether I'll be using binary or text may be a different story.

I also would like to see if any of thes articles (or others that may be out there) include delivering encrypted socket data. I'm guessing I'll probably have to implement my own means of transfering keys and encrypting/decrypting on each end, but I really won't know until I start reading, which I'll do when I get home from work. ;)

Thanks again!
alex_myrpg
alex_myrpg
Your welcome, glad to help. And yes TCP does seem like a good choice for a card game. I'm not an expert on this, but in UDP is data susceptible to loss often?
Now I would actually recommed using binary, especially since it's easier to perform encryption on...regarding encryption itself I actually have some experience in this area, working with RSA, hashing, and other algorithms. If you state what kind you want (probably RSA would be very secure) I can put together some sample code and explain how it would work across a network.
Mattman
Mattman
How often UDP loses data depends upon the amount of data required to be sent/received by each system as well as the connection strength, speed, etc...there are many factors. There is no right answer about how often UDP packets are lost, it varies from packet to packet / system to system.

I'm not sure what kind of precentage difference there would be in expected packet loss to sent ratio as the number of packets per unit time increases, but I imagine the percentage lost would increase as bandwidth is limited.

As for the encryption, I'm going to first work on sending plaintext (or plain "byte" ;) ) to learn how the different classes of System.Net work. I'd also like to see if I can put what I've learned through classes in past to use for encryption. If there are pre-written encryption classes in the .NET framework, then I should be able to figure out what I need to send encrypted packets. If there are not any pre-written classes to handle this, then I'll probably end up needing some input on getting some classes written.

I don't need something amazingly fast, since it's not a fast-paced game. However, I don't want the game to lag due to hashing or encryption or anything like that, so I'll need to figure out what algorithm would work best...but the faster the better either way. :)
alex_myrpg
alex_myrpg
Something like RSA or DES would be good...it's built into the System.Security.Cryptography namespace. If you need examples just ask.
Oh, and thanks for explaining the stuff regarding UDP data loss.
alex_myrpg
alex_myrpg
How's it going so far - have you managed to get the networking/encryption working? Cause I'm interested in the architecture of it...many ways of doing it.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.