Archived

This topic is now archived and is closed to further replies.

Getting started in multiplayer programming

This topic is 6162 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey everyone! I''m about to enter the wonderful world of multiplayer programming, and I was wondering wether there was anyone out there that has some pointers for a beginner :-). Any suggestions as to what API to use, etc. Anything is welcome. -Doddler

Share this post


Link to post
Share on other sites
First and foremost, make sure you understand the two (arguably) most important concept of network layouts: client/server model, and peer-to-peer models. Check any theory tutorial on these concepts, you should get a good grasp if you are at all internet-inclined.

Second, learn about WinSock programming at its lowest level. IMO it''s easier than learning the intricacies of Windows API programming that comes with learning DirectPlay... once you''re familiar with WinSock and TCP/IP or UDP programming, move on to DPlay if you feel it''s necessary. (Note that you should read as much as you can on it anyways, even if you''re not using DPlay, particularly the architecture parts.)

Finally, make test programs. Chat programs. Small tile-based multiplayer games. Try managing a username/password database, that can add/delete/modify dynamically. You should have a good grasp at that time.

Hope that helps!


MatrixCubed
http://MatrixCubed.org

Share this post


Link to post
Share on other sites
I have to disagree with the DPlay part. I have horrible vision and wear contacts. I'm talking anything farther than 6 inches away is blurry. I got up one morning and without even wearing my contacts, added DPlay support to my game. Took about an hour or two. There's really nothing intricate about it. Unless you program the functions from scratch but that's what dpconnect.cpp is for.

Winsock you really have no choice but to start from scratch.

My order of operations was
1. Get two clients working
2. Fake a client server setup*
3. Make it work they way I want it to
4. Figure out exactly why it works if time permits.

*My game to this day is still actually a peer-peer setup according to code. It's just that I removed the "create" button on the "client" and removed the "join" button on the server.

I also already know it works over the internet just fine. Minor occassional lag with a 56k modem but not enough to fret over. Winsock wouldn't fix that. With Dplay I know the packets are going to get to the destination and I know they're going to be 100% in tact.

Ben
http://therabbithole.redback.inficad.com

Edited by - KalvinB on January 28, 2001 6:03:24 PM

Share this post


Link to post
Share on other sites
quote:
Original post by KalvinB

I have to disagree with the DPlay part. I have horrible vision and wear contacts. I''m talking anything farther than 6 inches away is blurry. I got up one morning and without even wearing my contacts, added DPlay support to my game. Took about an hour or two. There''s really nothing intricate about it. Unless you program the functions from scratch but that''s what dpconnect.cpp is for.
Re-he-heaally. *SHilbert skitters away to try out DPlay*


Visit my site!

Share this post


Link to post
Share on other sites
Good luck. My other secret was the SimpleConnect demo from DX7. When that program is done connecting it initializes some other dialog boxes. I removed those dialogs and had it start initializing the rest of DirectX instead. Then proceed to the game loop. Once you got a connection working and can get a screen with some basic connection information showing, it''s ready to go.

Also where it checks for DPlay messages and Windows Messages. Get rid of the wait. By default it''s "INFINIT" meaning it won''t do anything until a message is recieved including continue looping through the game routines. You can make that zero. It doesn''t affect recieving messages. Just waiting for them to be there.

Ben
http://therabbithole.redback.inficad.com

Share this post


Link to post
Share on other sites
Hey, thanks guys. I''m still trying to figure out wether to use DPlay or Winsock. Since I''m not wanting to start a DX vs. OGL equivelent discussion, I''ll probably base my decision on what resources are available to me online. Does anyone know any resources for either DPlay or Winsock begginers?

-Doddler

Share this post


Link to post
Share on other sites
Winsock has many more on-line documentation sites and examples. As well as more support on Gamedev. More people use that here than DPlay. Dplay has a few samples here but the only real on-line source is the SDK documentation at msdn.microsoft.com/directx

I''ve pretty much taught myself.

Ben
http://therabbithole.redback.inficad.com


Share this post


Link to post
Share on other sites
Me & Stelly started fiddling with DP8. It has a number of new features that *very* desirable with regard to packet queues & reliability that was not present in DP4.

It was a $@&*# to just to open a port and get two machines to talk, once that''s done it''s all downhill. Afraid I haven''t messed with it much since my first DPN_CONNECT_COMPLETE msg been working on movement...

Do you want to make a LAN playable game, or an internet playable game? or perhaps both?

IPX is the most efficent LAN protocal, IP is the internet protocol. You should a bit about how IP works before you try to program using it (otherwise you''re in for a world of hurt)

Magmai Kai Holmlor
- The disgruntled & disillusioned

Share this post


Link to post
Share on other sites