Sign in to follow this  
ajage

Peer-to-Peer Game Programming

Recommended Posts

Hello Guys! For a school project I have to program a peer-to-peer network module for a game that class mates have developed for playing it in 2-player-mode over LAN, and I have no idea where to begin with. I m not lacking knowledge about network programming, but I just don't know how to start. Is there any good step-by-step-tutorial about this? There are a lot of tutorials on the web, but they either only explain one or two aspects out of the whole thing or are about client-server rather than p2p. Cheers, ajage

Share this post


Link to post
Share on other sites
There is almost no difference between P2P and LAN gaming. If they use UDP broadcast for the LAN, then you change it to UDP single-cast. If they already use UDP single-cast, you simply figure out how to send that packet to the remote peer. If the LAN game uses TCP or UDP single-cast, then you just add a way for the user to configure the IP address and TCP/UDP port of the remote player.

The problem with P2P comes in finding the remote peer. Typically, you'll want a matchmaking lobby somewhere. This requires a whole separate server process, where each player can register their interest, and a match can be made.

Finally, if the idea behind the P2P module is that it would support more than 2 players in the same game, when the LAN version only supports 2 players, then you're probably screwed :-)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this