Jump to content
  • Advertisement
Sign in to follow this  
Idov

Multiplayer mobile games: P2P or client-server?

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

Hi,
I want to build a multiplayer (2-3 players) mobile game.
I'd like to know what is the most common architecture for this kind of games:
1. P2P : Players mobile devices communicate without a server's help.
2. Server-Client: Clients do not communicate directly with each other, but send each move they do to the server.

How do most mobile games do it?

thanks :)

Share this post


Link to post
Share on other sites
Advertisement

It depends on the game. "Party games" can work without a central match-maker. An example of such a game might be "Space Team" (which I recommend if you have some friends over and your neighbors don't mind some shouting.) You typically implement these using plain UDP broadcast, or some library/service that is in turn implemented on top of UDP broadcast. That means they work as long as all players are connected to the same WiFi network. It is theoretically also possible for one of the phones to act as an access point, and the other phones to connect to it, but in practice, this either doesn't work, or performs really poorly.

Real-time interactive games that don't rely on physical proximity will need a matchmaker server for matching up the players to each other. Once matched up, you have the choice of having one game instance "host" the game and the other players "joining" that hosted game ("client host",) OR each instance running its own game and "updating" the others about their actions ("peer-to-peer",) OR running the server centrally and having each player just send their updates to the server, and the server echoes the data to the other players. Peer-to-peer is the least robust, client hosts are nice for developers who have very little money, and central servers generally provides the most robust gaming experience with the least chance for cheating. But, in each of these cases, you at least need a server of some sort to match-make/introduce the players to each other. (Libraries or toolkits like Game Center or Play Services or whatever can do this for you in some cases.)

Finally, asynchronous multiplayer games -- anything from a "chess by mail" game to a "backyard monsters" base builder to a "farmville" semi-social game -- needs some server that stores the state of the game between player check-ins. Because the players aren't online at the same time, the client hosted method, and the peer-to-peer method, don't work.

 

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!