Android 2 player game - connecting

Started by
7 comments, last by ddudek 10 years, 4 months ago

Hi All - question without the spiel in bold,

Certain forum dwellers may notice I have popped up a lot recently asking somewhat dumb questions - so sorry for that, I hope to return the favours by the time I've finished my project with things I have learnt.

I am looking at making a 2 player game (simple card game a first, maybe developing into something bigger) and am stuck at how to connect players/users. I have done a bit of a search and found 3 things: Skiller SDK, AndEngine and Google Play Game Service.

Skiller I believe is paid for, so currently on my 'budget' is a no. AndEngine looks thoroughly complex, but may be what I'm after, and the Google Play service looks very promising but I'm not sure what "catches" there are - for starters I think it needs G+ signin? I'm not against it, but was hoping to not limit players to having to have a G+ account (just like the Bitstrips FB limitation).

Does anybody have anything to say about these and/or other methods of connecting players?

A very basic flow of the game will be - Player one plays a card face down and clicks done, player two does the same (this would be preferably simultaneous but doestn need to be) when both are done, cards flip over and both players see both cards. The phases will then continue as such: both players making their 'move' but the opponent cannot see what has been done until both players confirm they are done.

Thanks as always.

Advertisement

If it were me, I would look at the Google Play support structure. Having a google+ signin is a little annoying, but compared to developing your own, how bad is it, really?

If you want your own, you have to build it yourself, using whatever server infrastructure is available to you. Spin up a node.js on a free Amazon EC2 "micro" instance, perhaps?

enum Bool { True, False, FileNotFound };

Hi H+

As I say, I'm not too much against the G+ signin, however I'm a little bit too 'new' to understand your second paragraph I'm afraid.

I'm happy to build the infrastructure myself, but wouldn't know where to begin - I imagine I need my own server space to be used as a room for the players to connect to?

I'm not sure what an Amazon EC2 micro instance is either, but I imagine a quick search will give me that information.

Thanks

Yes, a quick search will give you more information ;-)

If you are not familiar with networked/cloud server development, I *highly* recommend using the Google services instead of trying to roll your own. A G+ sign-in is a small price to pay for getting access to infrastructure built and run by some of the best in the business.

enum Bool { True, False, FileNotFound };

I have given this a perusal and the Amazon EC2 concept appears to be a place to hold the common data, and the node.js is the proverbial web-server? I feel if I was to use this approach i could, for at least testing purposes, create a local testing environment with a copy of Ubuntu server?

I am currently using Parse.com to deal with my user accounts and databases and am led to believe they support this too? I may be wrong, but it would be good to keep everything in one place. If it comes to it though, G+ will be the way to go - at least for the immediate term.

Thanks H+

I agree with what's been said: if you're not up for a whole lot of work, use a service.

I personally would roll my own, but I have a ton of "connecting devices" experience (PhoneMyPC, on Android, for e.g.).

If the G+ system works for you and your game becomes popular, perhaps you could roll a non-G+ version in the futurue. On Android, you're much more likely to have Google-ready users than on other platforms.

Amazon EC2 is really just a fancy, automatable, way of renting virtual servers, and managing the OS/software on those servers in various ways.

Parse is a higher-level service, more similar to Google App Engine or Heroku.

If Parse gives you everything you need for your game, and you're OK with their service and pricing, then staying there is probably fine for you.

To answer the other questions: Node.js is an application server environment that runs on top of V8 (which is the JavaScript engine used in Google Chrome.)

It's good in that you can share code between client and server, and comes with a variety of useful server-side libraries built in (HTTP, HTTPS, database connectors, etc.)

Amazon also has a number of other services that you can rent a la carte -- message queueing, storage (EBS, S3, Glacier,) databases (MySQL, SimpleDB, etc.)

enum Bool { True, False, FileNotFound };

I came across a snippet of code today which demonstrates connecting two phones in a client/server relationship rather easily (can't find it right now but will post if anyone was interested) but would only work locally. The topic did however spread to the ability to move this to client/client using a third party as a server - I imagine utilising the likes of Google App Engine, Parse, EC2 etc.

My initial thought is that I want this to be as close to free as possible while I am still working on this, the $25 Google developer fee seems the cheapest option to me.

I looked deeper into the Google App/Engine/Game services and feel the documentation on these is sufficient to get myself started on the connectivity side of things.

Thanks for the input guys.

I used photon from exitgames (https://www.exitgames.com/) - it's quite simple to use, and it's free to start development. They also have some cloud solution if you don't want to set up your own server for production. If you need some more info - don't hesitate to ask :-)

Anyway good luck :-) Multiplayer is really fun to develop

This topic is closed to new replies.

Advertisement