Advice? Creating Turn-based Multiplayer Game

12 replies [Last post]
Shizapp
User offline. Last seen 29 weeks 18 hours ago. Offline
Joined: 23 May 2011

Hey everyone,

My next game is going to be a turn-based multiplayer game that will work across android and iphone. I have done some extensive research regarding the potential pitfalls and had some ideas. I was wondering if folks who are more versed in this area would give me some advice on where I should pay attention before starting on this potentially expensive venture.

So far I have considered the following:

1) Use Amazon Services (simpledb) to store user information as well as active games.

2) Use PubNub for active turn messages between the players.

-- OR --

1) Only use Amazon SimpleDB services for all interactions between players.

Any advice or input? I wanted to use those services because they are simple and instantly scalable and cheap for the most part. I have a dedicated server that COULD be used but I don't want the potential headaches later on with ramping that up.

I appreciate your help.

Replies

robmiracle
User offline. Last seen 3 weeks 16 hours ago. Offline
Joined: 18 Jan 2011

Consider PARSE instead of Amazon's SimpleDB. I tried to figure out SimpleDB's API and use and its far from "simple".

Shizapp
User offline. Last seen 29 weeks 18 hours ago. Offline
Joined: 23 May 2011

So would you use Parse with all player-to-player interaction? For player registration, game registration, player moves, etc? Or would you use separate services?

Thanks for your input.. I've looked into Parse, how difficult is it to integrate into Corona? I see the have a REST API but is it easy to use?

robmiracle
User offline. Last seen 3 weeks 16 hours ago. Offline
Joined: 18 Jan 2011

Someone has posted a Lua/Corona module for using PARSE in the community code. I think it would be far easier to implement than SimpleDB.

Parse is just a cloud based database service. I don't think it will do what PubNub does with regards to messaging other players. But then again, SimpleDB doesn't do what PubNub does either.

Shizapp
User offline. Last seen 29 weeks 18 hours ago. Offline
Joined: 23 May 2011

Thanks again.. If you were going to invest your time and it were for your game it sounds like you'd use Parser huh? I did see the corona library for Parser, looks like I could take a lot from it.

I appreciate your response.

Anderoth
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 1 May 2011

I'll start by saying this is just my unproven opinion.

In my eyes the only way to do this successfully you will need push notifications in the mix. Until Corona supports push notifications on Android and more so, a solution presents itself for Kindle Fire & Nook push notifications(being these really are the successful Android platforms), it isn't really feasible to be multiplatform.

I say this because people have come to expect the game will tell them when it's time to take a turn, not have to keep checking it manually, over and over. Being turn-based you could have long periods of time waiting for the other player. People want to move on and come back when notified.

You could do iOS only and port it when Corona extends push notifications to Android or just keep it local only on the same device.

I looked into Amazon's service as well as Google's app engine. Both I found not well suited for my simple needs. Unfortunately, I have nothing to add about PARSE. In the end I just went with the basics of a 3rd party hosted server using PHP and MySQL. I was going to go on about how we all expect to sell a large number of copies but then realized you did not mention how the app would be distributed. If you go with free + IAP or ads, I can see the infrastructure to handle that load would be considerably more than my plans. My plans only include paid apps. I am a horrible business man. I dislike being nickled and dimed and I hate ads. So I avoid using IAP or ads.

I rambled. Really I just wanted to point out the push notification dilemma as I see it.

toby2
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 11 Mar 2011

On the surface, PARSE looks like an interesting option because it replies with JSON objects, which we can easily parse (heh) in Corona. PARSE also looks very app-oriented with APIs for user account management etc. You'd have to carefully consider how active your app is going to be. 1M API calls probably goes by a lot faster than you think. Don't get surprised by the cost.

Amazon SimpleDB, on the other hand, is a raw data repository. It returns XML, so you'll need to write XML/JSON middleware or parse it directly. That seems like the steepest learning curve with it. The pricing model is based on CPU time and data transfer, which is likely to stay low even for an app that scales up significantly.

If it were me, I'd try Amazon first because I have background and experience with their other AWS products (EC2 and S3 mostly) so I know what I'm getting into. Pure LUA XML parsers are easy to find, so I wouldn't let that scare me off.

Unless the 'extra' APIs in PARSE really knock your socks off ("I gotta have that!"), in which case, obviously pick what seems like the best tool for the job.

Shizapp
User offline. Last seen 29 weeks 18 hours ago. Offline
Joined: 23 May 2011

Thanks guys!

@anderoth - I'm going to be following DrawSomething's model.. Free with paid upgrade and removal of ads. I'm not cloning anything, this an original game but it will be a social game much like DrawSomething.

@toby2 - I originally wanted to go with Amazon because of how raw it was, I felt like I could control more. However, Parse has the "Push" feature that anderoth was speaking on as well as facebook features that I would require. It basically equals out to about $70/month for 2Million api calls and that is, indeed pretty expensive. So it might be worth it to build those libraries on my own and just use Amazon.

From what it looked like Amazon uses standard SQL statements but I could be wrong.

Trust me, I am not naive (however, I have been there), and I do not think that I'm going to have a million downloads but I want to plan as if the slight possibility existed so that it is easy to scale up and not break the bank. Learning from the insanity that Draw something went through the first few weeks after launch, I've learned to be prepared for anything.

robmiracle
User offline. Last seen 3 weeks 16 hours ago. Offline
Joined: 18 Jan 2011

If you have a million downloads, you can afford fees.

Shizapp
User offline. Last seen 29 weeks 18 hours ago. Offline
Joined: 23 May 2011

LOL that's a pipe-dream. Not to mention, it would probably only take about 500 - 1,000 downloads to use up a few million api calls and assuming that most of them do not actually purchase it makes for an empty wallet. That's why I want to put ads up, but I'm not even sure if those would cover the costs.

Anderoth
User offline. Last seen 1 day 15 hours ago. Offline
Joined: 1 May 2011

Just a note on PARSE and it's "push" feature. Again, I have not looked at PARSE but I can be pretty confident the push feature will not function as I described in my example. You can't have true push notifications (the kind that are sent to the device, open your app and the app deals with the information) without Corona responding to the notification first. This requires Ansca adding support. At this time it only responds to notifications from Apple's notification service. Anything else is a quasi push notification, if you will. It only works if your app is running and only if it's in the foreground checking a 3rd party service, a la PubNub, Game Minion, etc. PARSE sounds like one of these types of services.

If Urban Airship was officially added to Corona then we would be most of the way there. It supports Apple and Android and supposedly the Android push feature some how works with the Kindle Fire without any changes.

toby2
User offline. Last seen 1 year 10 weeks ago. Offline
Joined: 11 Mar 2011

Got to thinking about SimpleDB so I hammered out a library for it.

Every API response has a BoxUsage parameter that tells you how much CPU time that request took. That's handy -- you can profile your app and make estimates about the cost as it scales. Some of the REST stuff is a little fiddly, but it's well within reach of Lua/Corona with 100 lines of code.

Shizapp
User offline. Last seen 29 weeks 18 hours ago. Offline
Joined: 23 May 2011

@anderoth - Thanks for that, I hadn't looked into it too much myself, and I haven't looked into push notifications at all actually so I didn't know if they had some mojo that they worked to make it happen. Thanks for the clarity.

@toby2 - That's awesome. I was thinking about keeping a local database for each user as well as data that was needed for the game sessions on Amazon. The BoxUsage that is returned with each call is one of the big reasons I wanted to use it and also because it scales automatically, without delay. Parser seems to be a bit expensive but there is a chance it might still be a good option. I just trust that Amazon will be able to scale since they have other cloud services with reputation, while Parser is still in beta, it's an infant, not to mention $70 for 1mil api calls is a bit expensive but I have nothing to gauge average usage to make a true determination.

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.