I would try doing something simple with DirectPlay (not a game, just some chat code, or something) and then try to build it from scratch using Winsock. You'll see the pitfalls, but also see how nice it is to be able to tailor your work. (Also affords you portability if you don't use any of Winsocks WSA_ calls [except init and shutdown]).. anyways, good luck!
What to do first?
If you don't have any experience with Winsock, I think your best bet would be to start with DirectPlay. It will give you a chance to understand the methadology behind multiplayer gaming (ie. game packets, latency, messaging, etc). Once you have that done, you can look at Winsock (Windows) and BSD Sockets (*NIX). HTTP is a protocol that works over TOP of TCP/IP (Winsock/BSDSockets), so it should be left for later. It is relatively simple once you know how to handle TCP/IP.
I don't see any particular advantage in DirectPlay (I'm currently using it in my DX based game, but if I were to do it over again, I would use std sockets). The + in DirectPlay is supposed to be the "transparent" support for multiple protocols. Only problem is, it is not transparent (and besides, who cares about anything but TCP/IP these days?)... On top of that, all the nifty features such as latency calculcation works like sh*t...
Just mho.
/Niels
<b>/NJ</b>
I think one of the easiest ways to get started with network programming is to do TCP/IP socket programming in Java. Java has a very simple socket interface and there are a ton of samples out there.
Once you get a handle on the concepts you can move to Windows sockets or BSD sockets in C++/C. The concepts are generally the same, its just a more complicated syntax.
I would NOT recommend DirectPlay for someone just starting out. It is probably the worst designed interface of all the DirectX components, and the documentation is bad.
------------------
-vince
-vince
Hmm just gonna add my opnion about directplay. You really want to spend the time writting tcp/ip,upd(not hard ive done it in winsock myself)IPX(very popular i hear winsock 2.2 can maybe do it? But then again win95 doesnt ship with 2.2..)Modem (still popular),and finally Serial(very popular for ppl that want to bring over there comp and play a quick game ect.)
So even though dplay might have some pitfalls i say its very usefull.
I agree DPlay has advantages over pure socket programming, but I don't recommend it to someone who is just starting out with network programming. The docs stink.
I stand by Java sockets as the easiest way to get started with network programming - moving on to other things such as DirectPlay can be done later.
------------------
-vince
-vince
November 04, 1999 05:33 PM
Java Sockets? That sounds great! I already know a bit about java programming, where can I find more info about them? how do they work?
I agree java is pretty easy to start off with. Though myself i like the idea of java just not the results i got. (i started off learning java then moved back to c/c++)I think i miss pointers. But anyways here is alink to something that might help you some with java game programming.
http://www.informit.com/content/1575211483/chapter_15027.shtml
http://www.informit.com/content/1575211483/chapter_15027.shtml
Just a footnote: Any object reference in Java IS a pointer (you just don't get to do all the dangerous stuff with it, that you do in C++ )
/Niels
Oh, and garbage collection rules !!
<b>/NJ</b>
Garbage collection is nice, but that's just because we don't expect Java to be high performance. If we didn't expect C++ to be high-performance, we'd just new memory (or malloc) and never bother to delete/free it. The operating system would clean up for us When we get to high performance apps, we want to control our garbage collection explicitly, because there are times we can afford to clean up while other sutff is running concurrantly.
- Splat
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement