Skip to main content
GameDev.net gamedev.net
🔒 Locked

Asynchronous turn based games for social and mobile

Started by bigtunacan Feb 10, 2012 at 3:06 AM 7 replies 5.4k views
Original Post
bigtunacan
bigtunacan
I've done a few indie games, but up until now they have all been single player games. For my next game I want to create a small asynchronous turn based game (something along the lines of Scrabble, Words With Friends, or Dominion). I know that the newest version of GameCenter supports something like this, but then it would be locked to only iOS; or at the very least I would have seperate code for each platform and someone on iPhone wouldn't be able to play someone else who is on Android or Facebook...

So I don't want to use GameCenter, instead I would rather an independent push server app I could use/purchase, or preferably just write my own. Since I'm new to this bit of it though I'm not sure where to start. I've googled a bunch but everything just points me back to GameCenter or something similar. Any advice would be greatly appreciated on this! Thanks.
frob
frob
If you have web hosting -- which you can get free from many places -- you can implement it as a simple http command. It doesn't need to be complex, AJAX uses small requests like that.

You send a single HTTP request to the server with your information as the query parameters. Then the web page returned is text containing the data your app needs.

The web server is then responsible for handling the actual game. You can implement any number of game clients on any platform since they only need to know about the web server and the commands it supports.
GGMich
GGMich
[color=#282828][font=helvetica, arial, verdana, tahoma, sans-serif]

You send a single HTTP request to the server with your information as the query parameters. Then the web page returned is text containing the data your app needs.

[/font][/quote]
I second this if you are looking to avoid GameCenter. That's probably my first inclination if I were to approach this. If you want overkill or you're just looking for more options, there's always RakNet or OpenTNL.

Slightly off-topic, GameCenter will be expanding to "another platform." OS X Mountain Lion is going to have GameCenter support, which means it's a possibility for an iPad user to play a game with someone on their Mac. Not the same as a social or web experience like Facebook, but interesting none the less.

"I work for GarageGames, home of the award winning line of Torque engines and a community of more than 150,000 independent game developers. Learn more about us at garagegames.com "
SymLinked
SymLinked

Slightly off-topic, GameCenter will be expanding to "another platform." OS X Mountain Lion is going to have GameCenter support, which means it's a possibility for an iPad user to play a game with someone on their Mac. Not the same as a social or web experience like Facebook, but interesting none the less.


Have you even seen the state of OpenTNL recently? I wouldn't even recommend that in the "overkill" case.

I was surprised the site was even online as it wasn't before. But it's almost worse now that the site is up again - the Sourceforge page has broken links all over the place, the "News" section leads to an odd website in German, the downloads lead to 404, heck even the documentation is 404.. etc. RakNet or even ENet would be a better choice here.
interNEKO
interNEKO
The catch is if you want the server to notify all the clients when someone finishes their turn. If you want the server to notify them, then use NodeJS, but you will need access to the server to install and set it up. Otherwise, you can have a js timer, and just do AJAX calls for status updates, but this can be costly depending on your queries and bandwidth available. Hosting any multi-player game is costly bandwidth wise, so as long as the requests can be fulfilled fast, then it washes out in the end.

As people have mentioned, it is easy to have something like PHP return JSON, and use jQuery's AJAX calls to interact with them. Going one step further, you can then use Backbone or JMVC to incorporate templates.
lmbarns
lmbarns
You might take a look at a browser game called "Lord of Ultima". It uses html5 canvas for the game, with ajax calls to update the clients. It's a very, very, basic game but from a big publisher, EA. It gave me a lot of ideas...

You also might like this 48 hour competition scrabble MMO http://www.startupmonkeys.com/2010/09/building-a-scrabble-mmo-in-48-hours/ it utilizes mongoDB's "Geo Spatial" indexing to:
MongoDB geospacial indexing was a lifesaver here. We are able to store every tile thats placed on the board by its x,y coordinate and query a bounding box whenever someone changes their view. The resulting queries are ridiculously fast, even with a tile collection approaching over 90 thousand. Once we get too big for that, scaling is going to be dead simple given we can just use modular arithmetic to produce a shard key.[/quote]
jamesmintram
jamesmintram
There is a web service called parse which supports the kind of thing you want and it is free up to a certain amount of messages/api requests (Like GAE)

It has cross platform libraries (iOS and Android) and supports REST so you can use it with anything. Supports push notifications and offline sending of messages (You create the message to send and the library will save it transparently and upload it next time you get a connection)

Check it out here: www.parse.com

Regards,
James Mintram
Buster2000
Buster2000
I am also using Parse for my current game. There is no point implementing something if it is already there waiting for you to use.
There are also several other platform as services that are similar to Parse such as Kinvey, Pubnub and TrestleApp. These kinds of service seem to be pretty big this year with VCs giving funding to a new one every couple of weeks.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.