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 :
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. :)
You can never pause, quit or turn off online games without finishing the round or match first.
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.
There are couple of ways to do multiplayer game:
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.
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.
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.
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.
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.
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. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With