Search code examples
androidnetwork-programmingmultiplayer

how to make Multiplayer Game


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


Solution

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