No DirectPlay9?

Started by
15 comments, last by BlazingClaymore 16 years, 11 months ago
Ok I looked at the Q&As I'm sort of confused the frist one said to use WinSock and the second one said if you are making a action game use UDP but form all the forums I looked at thay said UDP was only in DirectPlay so does WinSock have UDP?

Q2) Should I use DirectPlay or WinSock?
A2) As of Summer Update 2004, Microsoft has put DirectPlay into "sunset" mode, where they will not develop the API further. Microsoft now recommends you use WinSock for networking, until the re-cast X-box Live! technology is rolled out for PCs, probably around Longhorn time-frame. If you're on Linux, MacOS, or some other platform like that, life is easier: you only have regular sockets to work with. Luckily, sockets and WinSock code can look very similar if you stick to the Berkeley sockets functions of WinSock, and avoid WSA functions; you can write quite portable programs with a little bit of thought.

Remember to include <winsock2.h> before including <windows.h> in your win32 program, or compile errors will ensue. Also, always start your WinSock program with WSAStartup( MAKEWORD(2,2), ... ) to get version 2.2 of WinSock, as the older versions have bugs and limitations that you don't want to deal with. Finally, you need to link with ws2_32.lib on Win32 when using WinSock.




--------------------------------------------------------------------------------



Q3) Should I use TCP or UDP?
A3) There are at least four different kinds of games as far as networking is concerned: Turn-based games, Real Time Strategy games, Role Playing Games, and Action Games. Briefly, if you're turn-based, you should go with TCP because it's simpler, unless you need peer-to-peer NAT punch-through. For RTS games, you're usually best off using TCP, although UDP can make sense in extreme cases. For role playing games, the story is less clear -- action-based RPGs with lots of kinetics, like City of Heroes, use UDP, whereas slower RPGs and MUDs often stay with TCP. For action-based games like first-person shooters or racers, you should absolutely use UDP.
Advertisement
TCP and UDP are the LOW level packet communications options, all APIs you see (DirectPlay, RakNET, WinSock, etc) sit on top of one or both of those ... or in other words, all packets you send will probably be either TCP or UDP spec protocol transmissions, but you use a higher level programming library to do the sending and recieving ... writing "strait" udp would mean setting all the header bits etc yourself, noone has done that in decades.
all I need to know is what is the fastest way to send data over the internet for an MMO? what does World Of War Craft use?
Hey there, I'm just done some stuff on dplay and Ive set up a server and cliant and it all seems to work ok over the net and lan , but the voice over net was a bit laggy It could have been refind. So Im going to use DPlay8 for now
Quote:Original post by BlazingClaymore
all I need to know is what is the fastest way to send data over the internet for an MMO? what does World Of War Craft use?


Pretty much every network library (Including Winsock and DPlay) support UDP and TCP/IP. I'd guess that WoW uses Winsock and UDP.

There's a bit in the Multiplayer and Network Programming forum about UDP vs TCP/IP. UDP is "faster" but you have to deal with lost, duplicated and out of order packets. TCP/IP gives you guaranteed, in order delivery of data, but is a bit slower.
Most games will use UDP, although they might keep a TCP/IP connection open for other data (A control connection, or for chatting or something like that).
Don't you dare start this crap again leave me alone. Don't even post any thing on my threads if your just going to make fun of me. oh and thanks Evil Steve that was the answer I was looking for.

EDIT: (for benefit of other members of the community) struck out part that is no longer relevant - I removed the offending reply.

[Edited by - jollyjeffers on May 22, 2007 6:11:17 AM]
Thanks now I don't have to look at it.

This topic is closed to new replies.

Advertisement