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

Winsock vs DirectPlay

Started by
19 comments, last by Allied 23 years, 3 months ago
Hi... I''m currently developping a little online RPG. I was using winsock, but a few day agos, while I was coding the Gfx engine, I discovered that DirectX was featuring DirectPlay... Which I should use? Winsock or DirectX? What If I want to ban someone on my server with DirectPlay... Is this possible? Thanks...
Advertisement
Hmm, well if you work on the DP team: Why isn''t it possible for clients to get the "playerid" directly in a client/server connection? Now I need to let the server sent it to the client, and the client needs to confirm this again

(btw, Using Visual basic!)

But anyway, DP is great :o)

Almar
If you want to ban someone from your dplay server the easiest way is to just set up a username/password system.

The only advantage that Winsock has is that it''s portable to other OSs.

Ben
http://therabbithole.redback.inficad.com
It''s simple to ban people with directplay. Just return E_FAIL from the DPN_MSGID_INDICATE_CONNECT event and you''re done.

DirectPlay adds so much on top of Winsock, and as of DirectPlay 8 is pretty efficient about doing it... I can''t see ever going back to Winsock for games.
I''m using winsock for my Online RPG right now but once the new revision comes out on my 3d engine (genesis 3d) then it''s going to have different netcode and i might consider switching to that but I don''t know aobut Directplay since i haven''t used it but there are 2 reason why i wouldn''t use it (it''s just me but..). First of all it''s part of DirectX. Nothing bad about that but that means it can only be run in Windows. Besides the fact that i hate microsoft i have problems with this. The client i wouldn''t mind using it for since the 3d engine (i think) only can be run in windows... but the server i want to be able to run in LINUX basically because of it''s stability (Also Win2k is good for stability) and because since we have about 4-5 admins each at a different house then the server except for one of us then linux lets us easily administrate the server remotely (if it crashes bring it back up, add patches to it, etc...). that''s just my opinion though.
ALL YOUR BASE ARE BELONG TO US!!!!
Direct Play is mostly ready made. Think of it as the C++ of network SDKs.

WinSock is low level and very fast in the right hands. It''s like Assembly.

It''s a personal choice. Get my point?
------------------------------------------------------------I wrote the best video game ever, then I woke up...
So directplay is soon going to be cross-platform.... oh well i''m not giving up everything i''ve learned with winsock...

Also i''m not going to get into it here but i don''t hate microsoft because of what the governments says. I hate them because i hate windows yet i''m forced to use it because i can''t download/pay for linux (16 with no job) plus i''m working on developing games adn the 3d engine we have is only for windows!
ALL YOUR BASE ARE BELONG TO US!!!!
I''m not sure about DPlay every being cross-platform. Microsoft is the developer of it and I don''t know of any plans to port Direct X to another system.

As far as which one to use, sockets or Direct Play? Well, I actually use them both. I evaluate what the project needs and then decide which API to use.

I know thats not much of an answer but I will tell you one thing. Direct X 8.0 has made DPlay MUCH better. It has most of the features I wanted to see added. Also, it is very fast now. In fact, my current project uses DPlay and it orignially was planned to utilize sockets.

It does all boil down to a design issue though. I would recommend that you wrap your communications code in such a way that you could go either way without affecting your game. It is not a good idea to make your code reliable on one method.

Anyway, my $0.02 worth.

(Shameless plug follows)
Oh yeah, my upcoming book covers both sockets and DPlay!

LostLogic
webmaster@lostlogic.com
www.lostlogic.com

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

If DirectPlay is so easy and intuitive to use why does the DirectPlay docs take up 419 pages ???
-------------Ban KalvinB !
419 pages:

Take ASM versus a higher level language. Which one will need more documentation? I think you will find that the higher the level you go to, the more documentation. For ASM, you would need maybe a list of all the OP codes and their descriptions and then the syntax. For C++, you need... well, look around at how much stuff there is about C++.

So why is it that the more "complex" things need less documentation? It is because you have to think for yourself a lot more. Winsock requires you to think about exactly how things will work. DPlay will make a few assumptions which will probably help you. DPlay is probably perfect for heaps of things which could be done with Winsock as well.

Winsock will give you more power, so if you know how to use it, and you have enough time then you could write something so it will go faster than DPlay. If you don''t, it could end up worse.

DPlay probably just about suits your needs and will do the job about as well as it will be done.

Now, to discredit my entire post: I have never used DPlay, I have only read about it. I''ve used Winsock and found it quite simple, but that is because I was only using it for simple things. DPlay does look cool (and I''m not just saying that because the DPlay team guy is here )
Trying is the first step towards failure.

This topic is closed to new replies.

Advertisement