DirectPlay or Socket

Started by
11 comments, last by Robinhood 19 years, 10 months ago
quote:Original post by circlesoft
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.


Two of the games I''ve worked on (the only ones that had network/internet support) use it, Pac-Man:Adventures in Time [Hasbro Interactive/Infogrames] and Rally Championship [Actualize/EA].

The following Microsoft games are meant to use DirectPlay:

Age of Empires
Age of Empires II: The Age of Kings
Age of Empires Expansion: The Rise of Rome
Age of Empires II Expansion: The Conquerors
Age of Empires II Gold Edition
Allegiance
CART Precision Racing
Close Combat for Windows
Close Combat: A Bridge Too Far
Close Combat III: The Russian Front
Combat Flight Simulator: WWII Europe Series
Combat Flight Simulator 2: WWII Pacific Theater
Flight Simulator 98
Flight Simulator 2000
Golf 1998 Edition
Golf 1999 Edition
Golf 2001 Edition
Links LS 2000
Links 2001
MechCommander 2.0
MechWarrior 4: Vengeance
MechWarrior 4: Mercenaries
Midtown Madness 2
Monster Truck Madness
Monster Truck Madness 2
Motocross Madness
Motocross Madness 2
StarLancer
Urban Assault

Some others which are meant to use DirectPlay (from a quick Google - but I can''t confirm):

Dungeon Siege
Civilization 3: Play the World
Homeworld 2
Commandos 3
Commandos 2
Railroad Tycoon 3
Industry Giant 2
Total Annihilation
Sacrifice
Sudden Strike I and II
Starfleet Command 2: Empires At War
Starfleet Command 2: Orion Pirates
Star Wars: Galactic Battlegrounds
Baldur''s Gate
Sega Rally 2
Icewind Dale
Heroes of Might and Magic 3
Diablo II
BattleCom v0.1
M1 Tank Platoon II
Worms 2
Aliens vs. Predator

BTW on the issue of UDP vs TCP or both, the following may be of interest: http://www.u.arizona.edu/~trw/games/ports.htm

Simon O'Connor | Technical Director (Newcastle) Lockwood Publishing | LinkedIn | Personal site

Advertisement
I second S1CA - DirectPlay provides a lot of functionality built on top of WinSock that you may well want. I wrote a LAN chat app recently and decided to go with DirectPlay because it meant I could get up and running very quickly (and I did - took me about 20 minutes to implement the entire network code for my app).

TCP and UDP aren''t totally interchangable, so it''s not really a question of learning one over the other. Again, I second S1CA - you''ll probably want to use both, TCP for the important but infrequent messages (e.g. player joined game, map change, chat command) and UDP for the less important but more frequent messages (player moved). A key criterion is asking what happens if a message is lost - in the case of a ''player moved'' message, having the message contain the absolute coordinates of that player means that it''s not a problem if a message is dropped, because it''ll be corrected the message afterwards.

One other thing to note is that you may find it difficult networking DirectPlay-based apps with non-DirectPlay-based apps, as you may need to do if you want to support platforms other than Windows. Because it''s all on sockets it''s theoretically possible, but DirectPlay uses a protocol which AFAIK is proprietary for MS. So you''d have to reverse-engineer that, which may be both difficult and against the terms of the license (IANAL).

Richard "Superpig" Fine - saving pigs from untimely fates - Microsoft DirectX MVP 2006/2007/2008/2009
"Shaders are not meant to do everything. Of course you can try to use it for everything, but it's like playing football using cabbage." - MickeyMouse

quote:Original post by S1CA
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

Dear Mr.O'Connor,

I want to contact you.
Could you tell me your email address?


Sungkwan Park
My Email : skpark@softweb.co.kr
My MSN Messenger : sungkwanpark@hotmail.com
My Phone : +82-11-256-9917

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




[edited by - softweb on May 31, 2004 1:04:44 PM]

This topic is closed to new replies.

Advertisement