Jump to content
  • Advertisement


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


Best way to Network in this situation

This topic is 5495 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

A couple of friends and I have developed a fun strategy board game, and we play it constantly. As we are now on summer vacation, we are unable to play it as frequently as we used to! (average 10 or so games in school, between classes and during). I have programmed the game on my computer, with an average AI and such, but now I''m ready to take the next step. I want to be able to play this game with 2 to 8 players over multiple computers. I was wondering what the easiest way to network them together is, and how to do it. I''ve heard a little bit about Winsock, and that seemed pretty easy, but I would appreciate soom feedback. Thanks in advance!

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
There''s WinSock, which is very similar to standard UNIX sockets. Then there''s DirectPlay, which is Windows only. Then there isn''t much else.

I say go with WinSock; it''s reasonably portable, and straightforward.

Warning, though: programming for multiple computers is a bit of a shock, because you can''t guarantee the order of events anymore, and you can''t just assign values -- you have to be careful that all changes get distributed across the network somehow, and they don''t fall out of sync.

I recommend using TCP for a strategy game; it''s so much easier to use because it''s ordered and guaranteed.

One good debugging mechanism you MUST build, is the ability to dump all of the game state to a file of some sort. This is useful for savegame, too. Then, every so often, exchange this entire file across the network with the other players, and make sure that the other clients are in sync. If they aren''t, hit the debugger right then, and figure out what went wrong! You can turn off this feature in the release version of the game, but keep it on as much as you can.

Just don''t base your entire networking protocol on exchanging the entire board state, because that''ll make for sluggish modem play.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!