how to make Multiplayer Game

Fugogugo picture Fugogugo · Apr 16, 2011 · Viewed 54.2k times · Source

I already knew the basic of android programming, especially the one at game. now I want to try multiplayer game. but I dont have any background about multiplayer game. so I want have a number of question :

  1. What is the basic of multiplayer programming?
  2. how is the communication method for multiplayer? should it bluetooth? or maybe client-server ? or maybe peer to peer? if the game that I want to make required 2 android handset near each other?
  3. what should I know in order to understand this multiplayer?
  4. is there any basic tutorial about how to make multiplayer game?
  5. can an android handset acted as a Server?

I don't plan to make any sophisticated game yet. may be just multiplayer tic tac toe is alright for me. the most important is that I understand the basic of multiplayer game programming. :)

Answer

R2D2 picture R2D2 · Jul 5, 2011

There are couple of ways to do multiplayer game:

  1. Multiplayer on the same device: Make multiplayer logic for your game and allow multi touch controller for both players on the same screen. It can be turn based or simultaneous. For this game you do not have any dependency but the players should be near each other.

  2. Bluetooth game: This the next stage of multiplayer games. A little bit trickier but can be done. The controller need to get and synchronize the game between two devices that are near each other. A short review of the Bluetooth android API and you are good to go.

  3. Score comparison: This is not a real multiplayer but you can upload scores of the users and compare with other users. You can do it yourself with server side that will store all the scores for each user or use existing services that allow score comparison like Skiller SDK or scorelop SDK.

  4. Real multiplayer games: This is the best one from my opinion. Everybody can play with everybody else in real time (as far as latency allows :D). This one is pretty difficult, if you want to do all by yourself. Here you will need a strong server side and a lot of server logic. But again you can use existing services that handle the server side for you. I went with the Skiller multiplayer SDK. Good support and monetization features.

Whatever multiplayer implementation you choose, give your game to your friends first so that they could review it and tell you what can be improved. It will help you A LOT!!!

Good luck.