🎉 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 or DirectPlay or... ??

Started by
9 comments, last by chr1701 24 years, 2 months ago
Hi all, first i think i should mention that i have never done anything concerning multiplayer-programming, but... when i read the threads here, i get the impression that people seem to use winsock and not directPlay. Why? Chris.
Advertisement
My personal answer to that is that Winsock code ports more easily to other platforms. Actually much of my mult-player code is done in berkeley sockets and then moved to winsock.
I''m not sure about that either but it seems like DirectPlay is good in mplayer games where there isn''t much gamestate data to update, like 2d games, turnbased games and so on.
Winsock seems more powerful when writing online multiplayer games and fast 3d action games. I don''t think I''ve ever played a FPS using DirectPlay.

Daniel Netz, Sentinel Design
http://welcome.to/sentineldesign
============================Daniel Netz, Sentinel Design"I'm not stupid, I'm from Sweden" - Unknown
can we get more opinions on this? i''m thinking of doing this too, but just wanna hear about majority and stuff.

is winsock to directplay as
opengl is to direct3d?

how "difficult" is network programming compared to say, direct3d, cuz, most books i read say that direct3d is the HARDEST component of directx, which leads me to believe that directplay isn''t too bad. i''m planning of coding a 3d realtime racing engine, so maybe winsock would be better? ideas please!

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
> is winsock to directplay
> as opengl is to direct3d?

no.... Winsock is Microsoft''s impementation of the Sockets API used in unix systems. DPlay sits ontop of that.
Tom Spilman Co-owner | Programmer www.sickheadgames.com
Here is a really easy answer:

Look around at the servers running the multiplayer games at the ISP etc. Their almost all linux. If you want your server process running on those box''s you make sure you use something that can be ported to linux, sockets can, direct play can''t(without writing an exact clone of directplay ...ugh)

It a decision you make about your target audience. Are you writing games for mac or windows? Probably windows so more people play them, same thing with servers. We generally write the server code portable so the ISP can run their linux box''s and the lanparties can run thir NT box''s (in general)

Directplay limits you to windows box''s.

chris
Chris Brodie
hey, i actually went through a 19 page tutorial covering winsock, and i thought it was pretty easy. too good to be true? i mean, all it consisted of was:

setting up a socket
setting up host
listening
receiving data
sending data

which was maybe like only 15 lines of code that i had to know. (i mean, i know i''d have to put them in the right logical order to get it working, but are those generally the only commands that i''d need to know for winsock? cuz if so, this winsock programming is like way fun!!)

anyway, tell me all about it. are my hopes too high?

a2k
------------------General Equation, this is Private Function reporting for duty, sir!a2k
Winsock really is very easy to use, I read a whole book about it but many things I learned I will probably never use in a game.

Winsock and DirectPlay can''t be compared because they are different things, is like comparing a 3D API like OpenGL or Direct3D with a game engine.

If you want your network code to have the possibility of being ported to other non-windows enviroment you should go with winsock. If your game will run on windows only then it''s your choice. Many things that DirectPlay does you''ll eventually need to implement yourself, like connection acceptance and rejection, player management, etc. If your game will run on windows only I''d say go with DirectPlay, save yourself some headaches =) unless you''re going to have a lot of players and you want to optimize your code to the fullest.

Rick
If your game already uses Direct3D or DirectDraw, it''s not really portable anyways, so why not just take advantage of what DirectPlay has to offer?
___________________________Freeware development:ruinedsoft.com
I use all of DirectX EXCEPT for Direct Play. It''s just too frickin hard to understand. Yes I even wrote my own Direct 3D Immediate mode drivers. But Direct Play? Forget it. I use "winsock" and good old CAsyncSocket every time.

-Michael

This topic is closed to new replies.

Advertisement