Skip to main content
gamedev.net
🔒 Locked

Simple networking...

Started by Metus Sep 28, 2000 at 1:15 PM 6 replies 600+ views
Original Post
Metus
Metus
I''m writing a small, simple multiplayer game and I''ve been thinking of the networking class (or actually I haven''t ) Should i use DirectPlay or Winsock? I''ve read that Winsock is faster, but DirectPlay is easier to implement...if that''s true, hiw big are the speed differences? The game will be a simple topdown game (DDraw / D3D) Nes-IkariWarrior-inspired multiplayer game... Thank you in advance! Patrik Wixner
Ethereal
arrogantgod
arrogantgod
DirectPlay is not too difficult to implement and is fast enough. Many popular commercial games use it and they run fine.

Sockets work really well too but are less documented. One benefit is that the code can be transferred to Linux(Unix) easily.

Personally I use sockets for MMORPG(massively multiplayer online roleplaying game) style games. I use DirectPlay for the type of games you are talking about.

BTW, I have a book on programming network games utilizing sockets and DirectPlay coming out around May-June timeframe. Visit www.lostlogic.com to sign up on the mailing list for it (look under products.)

Thanks,
webmaster@lostlogic.com
JonStelly
JonStelly
Directplay works well for anything where you''ll be serving less than 64 or so clients I would say. The DPlay Groups can really help to keep things organized and it''s a simpler programming model.

As for performance, you''re not going to be able to really squeeze any extra performance out of Winsock until you fully understand Overlapped I/O etc... And even then, the gain is often minimal.
daveb
daveb
-------
Sockets work really well too but are less documented.
-------

Whoa whoa whoa. Sockets are possibly the single most well documented networking architecture out there. They''ve been printing books on sockets for 20 years. Its an excellent way to deal with networking. DirectPlay just generates one horror story after another. If I had to recommend one, I''d definitely say go with sockets.
Volition, Inc.
Metus
Metus
Ok..tank you all..I''ve been looking into the Dplay samples from Microsoft and i SAY Arrghh..that''s the ugliest code I''ve ever seen...an all the Enumeration of sessions, connections available, all other crap....i just want something simple, that''ll work...no enumeration, or something, ONLY use TCP/IP and some ConnectionFunction like this:

Connect(IP, Port)
{
MySession->Connect(IP, PORT);
VerifyConnection(IP)
/*
Bla, Bla, Bla, Jadda, Jadda, Jadda
*/
}

Where can I find tutorials of both winsock and directplay that an average programmer can understand? (Microsoft''s DirectPlay SUXXXXX)


Patrik
Ethereal
JonStelly
JonStelly
Woah, I didn't even see that statement about sockets being poorly documented. I can name 3 books on Winsock 2.0 alone, can't think of a single book I've seen on DirectPlay.

Then:

"if u handle winsock ur self... u'l always have better speed and performance"

The speed of winsock code is directly proportionate to the ability of the person writing it. Directplay is a higher level api, so there's less room to tweak performance. Winsock offers Overlapped I/O, which alone could constitute a good week of learning just to figure out a way to implement it correctly. And on the other side, poorly written Winsock code will perform much worse than poorly written directplay code.

Metus:

Yeah, some of the directplay code is ugly. If you don't like the way it looks, sure, choose winsock. go to: http://www.stardust.com" to find good winsock information.




Edited by - JonStelly on September 28, 2000 5:53:34 PM
arrogantgod
arrogantgod
When I said it was not well documented I meant in terms of Windows game development.

Sure, there are plenty of books on straight sockets development but you will find little in the way of hard-core network game development books on it.

Direct Play is not too bad once you get the hang of it. It also handles connection and disconnection of players fairly easily.

Sockets programming is easier to "read" though.

This entire discussion is as volatile as asking which is better, Unix or Windows. I dont think that is the point here. If you are unsure, try them both. They both accomplish the same thing in the end.

-AG

Topic Locked

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

Sign in to reply to this topic.