Sign in to follow this  

Android turn based multiplayer: how to implement

This topic is 1783 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am fairly new to Android development but feel confident in my ability to learn and implement new concepts.  I have been working on a Pokemon-style battle game and right now would like to focus on the multiplayer.  It would be a simple 2 player battle where each player has one monster that is fighting (maybe more in the future).  It would be turn based but I'm putting in a speed system where the order of who goes may change depending on the move used, but it is still turn based.  Having a lobby where people can select who they want to fight would be nice too.

 

What options do I have to implement this multiplayer battle system and which of those options is going to be easier to learn?

 

I have seen people suggest Skiller SDK, but it appears to be too limited to use, maybe not.  I only have a very basic understanding of servers so it would be a lot to learn (and maybe pay for?).  I know things change if I want the battle to be hosted some  place or just have the phones communicate back and forth (the latter is preferred).

Share this post


Link to post
Share on other sites
You could probably build this game on top of any web framework and database. Which one you are more likely to learn easily depends on what your experience and available services is.
The matchmaking and games could be done with polling for a game that's not too big. Once the game gets big, hopefully there's enough money to help build a dedicated version :-)

Some names to check out:
PHP and CodeIgniter
Ruby and Rails
Erlang and Nitrogen
Haskell and Yesod
Python and Django
Java and Spring
Node.js and Express
C# and ASP.NET
C++ and boost::asio

Node.js is nice, if your server host supports it, because it allows persistent connections, websockets, and JavaScript scripting which is similar to how you develop for web browsers. It can also scale pretty big before needing a re-architecture. If you really have no particular favorite, I'd probably recommend you start there.

Share this post


Link to post
Share on other sites

I only have experience with Java so Spring looks attractive.  Is is going to offer similar things as the other options?

Share this post


Link to post
Share on other sites

You could also consider using a backend-as-a-service (BAAS) provider if you don't want to get your hands dirty writing server side code or dealing with the logistics of setting up server machines and worrying about scalability, etc.

 

I found this article fairly useful http://www.raywenderlich.com/20482/how-to-choose-the-best-backend-provider-for-your-ios-app-parse-vs-stackmob-vs-appcelerator-cloud-and-more which tallied well with my impression that Parse looks like the best of the bunch (in terms of API at least).

Share this post


Link to post
Share on other sites
To get a simple server up and running fast and cheap, and easily scale it up if and when you actually start to get some serious traffic, then Google App Engine is nice too.

Can program it either in python, or in Java.

The database is best for data that is written seldom, and read a lot though, so maybe not ideal for multiplayer, but should be ok for something low intensity like turn based battle.

We use if for level editing and sharing levels in our labyrinth game. (among other things) Edited by Olof Hedman

Share this post


Link to post
Share on other sites
Sign in to follow this