Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to make Multiplayer Game [closed]

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. :)

like image 566
Fugogugo Avatar asked Apr 16 '11 15:04

Fugogugo


People also ask

Can you pause an online multiplayer game?

You can never pause, quit or turn off online games without finishing the round or match first.

How do multiplayer games work?

Basically, a multiplayer game is a video game in which more than one person can play the same game together. More specifically, though, the same exact game area, not just the same game. The different players are all in the same match, server, or level experiencing everything in real-time at the same moment.


3 Answers

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.

like image 50
R2D2 Avatar answered Oct 16 '22 14:10

R2D2


I would give this series of articles a read:

http://gafferongames.com/networking-for-game-programmers/

It's mostly in C/C++, but you can translate it to Java. Learn about UDP sockets in Java, for example:

http://download.oracle.com/javase/tutorial/networking/datagrams/index.html

This should be enough to get you going. I would probably do client-server setup. You can do P2P but it's harder from what I've heard.

like image 17
Mike Lentini Avatar answered Oct 16 '22 14:10

Mike Lentini


Looking up the APIs for android would defiantly help. client server would be the easiest to set up. Or, something that i am doing in a game i am making, is to have a web server and your application hit the web server for updates and whatnot. This is working really well with a turned based game I am making. Might take more capital up front, ie. Hosting your own web server, but since android supports SQLlite, you are good to go. :)

like image 2
Keith Avatar answered Oct 16 '22 13:10

Keith