Question

I have a simple two-player android game (like Chess), and I want to add some functionality for users to play against each other online. I would prefer to make this as simple as possible (so no complex website where users meet each other and maintain a rating, etc.; instead, just the ability to somehow "look-up" your buddy and have a quick game against him or her).

First of all, is there any way to do this peer-to-peer? From my research, it looks like no, or at least there is no "easy" peer-to-peer method. Admittedly, I haven't looked much into p2p for Android in a while...

The other way then, would be to set up a server, but I have no idea how to do this. Does anyone have some links, info, etc. about how to set up a simple server for enabling online gaming like this?

Thanks!

Was it helpful?

Solution

The problem with p2p is going to be discovery i.e how do players discover each other or their address for communication. The other problem with p2p is that players phones are often going to be behind NATs and if both are behind a NAT then they will need a intermediary between them for communication. These are two common reasons why a server is required even for the simplest of multiplayer games.

Is your game an asynchronous turn based game like words with friends?

There are options of using cloud service for such a game as well so that you just do Android development and access a webservice for storing game data and sending push notifications to update the other player of his/her turn. You can take a look at this https://github.com/shephertz/App42-Tic-Tac-Toe sample on how to do it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top