🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

2D Network Game

Started by
10 comments, last by Slayer-X 23 years, 9 months ago
I''m making a 2D game and I''d like to do 8 players over the internet and over a lan. I''d like to know what I''d need to use to accomplish this. I want the fastest and easiest way to do this (fastest as in data transfer). If there are any tutorials that are good for this, let me know where they are. If you have any tips for getting started, those are appreciated as well.
Advertisement
hey dude, go read the directplay docs (or winsock docs)
If you want fast, look into winsock. If you want easy, look into Directplay. Since your message didn''t contain any specifics really, I''ll assume that this will be a new area for you. If that is the case, you might want to look at DirectPlay. It isn''t much slower than winsock, and winsock is much more complicated to get it to outperform Directplay anyway.
I need to be able to transer player world locations, weapon locations, item locations, weapons fire locations, and various other data (for example, I''m going to put a lighting engine in the game, hope so anyway, and I''m going to send data to each client on the color, intensity, etc, and have the server just hold the data while the clients read/send changes while they do the game processing). I''m planning to have the server as a place to hold the data and change the data so that the clients can use this to do the multiplayer games. I''ll have the server do some minor processing to keep from having various game play bugs. Whichever one would be easiest and be able to do this without major lag is the one I want. This would be my first time doing any network programming (if you couldn''t tell).
Ok, then Directplay is probably what I''d suggest. About the lighting, well a networking rule in general... If you don''t NEED it, don''t send it! It might be easier to set up all of the lighting information client-side.
Hmm, this seems to be a common question, I just answered one like it a second ago.

DirectPlay is not too difficult to implement and is fast enough. Many popular commercial games use it and they run fine.

Sockets work really well too but are less documented. One benefit is that the code can be transferred to Linux(Unix) easily.

Personally I use sockets for MMORPG(massively multiplayer online roleplaying game) style games. I use DirectPlay for the type of games you are talking about.

BTW, I have a book on programming network games utilizing sockets and DirectPlay coming out around May-June timeframe. Visit www.lostlogic.com to sign up on the mailing list for it (look under products.)

Thanks,
webmaster@lostlogic.com
hey, vic_semionov, vijdam che si ot Bulgaria... ako prochetesh tozi mesig e-mail me at... i mi kaji ot kyde si etc... az sym ot BG systo i za pyrvi pyt srestam Bulgarin na tozi forum... are, e-mail me kato prochetesh mesiga.. ciao

-------------------------------
That's just my 200 bucks' worth!

..-=gLaDiAtOr=-..

[Edited by - Gladiator on December 18, 2008 7:36:18 PM]
For 8 players DirectPlay will work just fine
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
I think I''m going to use Winsock instead of DirectPlay, because i''ll have to learn Winsock eventually anyway. Which would be better to do a 2D fast action multiplayer (up to 8) game: TCP/IP or UDP? Also, which one would be easier? I''m new to network programming and don''t want to try to do something that''s going to discourage me from network programming.
UDP is probably easier for the fact that one message sent is one message received. With TCP you have to write code to collect incoming data until you have a complete message recved.

Only thing to watch out for with UDP is that it doesn''t guarantee delivery. Dropped packets will frustrate you... alot. =)

This topic is closed to new replies.

Advertisement