DirectX:DirectPlay

From GDWiki

Jump to: navigation, search

Network communication has always been a sticky issue and a thorn in the side of any unwary developer who wants to create a "simple" game involving more than one machine over a network/internet. Until DirectX8.0, the only real answer for networking on the Windows platform was the use of Winsock.


Winsock (1.1 or 2.0) was Microsoft's "version" of the Berkeley Unix specification and pretty much did the job of handling network gaming for Windows.


The trouble was, that it had its' definite quirks and only the more elite networking gurus could get a smooth networking game together leaving the rest of us out in the cold trying to peek in through the door.


The DirectX team realized this was a challenge and created a networking API built on top of Winsock: DirectPlay. The earlier incarnations of DirectPlay (ie. version 4.0) is well documented to really really...blow (for the lack of a better word). It was slow, clunky and just unusable.


With the DirectX8.0 SDK though, Microsoft really made some progress with the DirectPlay API. It was now fast, robust and fairly simple to use.


The main strengths of DirectPlay, is that it encapsulates lower level network communication for you. You simply define a message type within your game structure, then just tell DirectPlay who to send the message to. The API will do the rest. If the message doesn't get through to the directed player, or a required packet is dropped, not to worry DirectPlay will handle these situations for you. Need to have a game server hiding behind a NAT and/or firewall? Again, DirectPlay will handle the communication seamlessly behind the scenes.

-_-

Personal tools
Categories