What tech would you use to develop backend services

What tech would you use to develop backend services for a game developed in Corona?

I'm mean a server that 1. Handles matching and synchronizing many two=player games. 2. Acts as an AI opponent against a human player.

I'm using PHP/MySQL as my back-end, but only because it's what my hosting company supports.

I'm also developing a multi-player game that needs to sync everything down to exact seconds between all the players. I do that by setting all times to the server's time, then subtracting that time from each device's local time to get an offset. So if I need to do something a minute from now (according to the server), but one of the players has their clock set 10 seconds too fast, I have to ADD 10 seconds to that player's wait time.

ALL the data in my app is sent as JSON packets. The JSON library that comes with the "Facebook Connect" sample code that ships with Corona works very well for me. It's fast, is easy to use and just works!

I make HTTP requests to .php pages on the server (ex: http://myserver.com/game/addplayer.php?gameid=1&username=joeyjesusballs). The pages read the querystring variables, run the necessary SQL command(s) for that action, and return data as a json packet (ex: {"status":"success", "message":"joeyjesusballs has been successfully added to the game!"}). The JSON parser on the device gets that response back and handles it appropriately (maybe doing a native pop-up to relay the information back to the user).

This has worked-out very well for me, your mileage may vary.

Personally, I'm a .NET developer by day, I'd LOVE to use ASP.NET MVC and LINQ to SQL for the back-end (I'm really not too fond of PHP/MySQL), but it's all I've got to work with...

And one thing that I'd really love to see in Corona is the ability to do asynchronous HTTP calls. Right now, my UI freezes for a second while requests are being made. It's not too noticeable, it doesn't take away from the game, but being able to continue with the game loop and wait for a response at the same time would be SLAWSOME!

-Mike

Thanks for your feedback. The reason I ask is because either I'm going to have to develop the backend server for my game or I'm going to have to hire somebody.

If I were to do it I'd either use Pyhon & Django or I'd stay with Obj-C and use a hosting company with OS X servers.

I have one app on the app store (not a game) where I simply issue requests in REST format and get data back in JSON format (using php/mysql as the platform). I use TouchJSON to do the parsing and NSURLConnection to issue the request. Haven't played enough with corona to see how you issue http requests as yet.

It really depends on what your needs are. For a number of the projects that I have worked on, simple networking is more than adequate as long as the packet size is small. So simple PHP or RoR can get the job done in a huge number of the projects.

Coming from a strong Torque and FPS background, I have also used C/C++ and Java master servers for strong ghosted network simulations with a ton of players in an action-oriented environment. I've used RakNet with a couple of engines as well as PushButtonLabs network library and ActionScript master server in the past.

But again, it really depends on what your needs are and how latency will affect your application. Many games can work with queued network events by implementing things like charge-bars, detecting important events versus every possible event. But something like a physics-based platformer will require you to think out the events and prediction intelligently and account for latency across a number of connection types depending on their location. If their router goes out in a ladder tournament and they get switched to Edge before it finds a 3G signal, they will be complaining rather loudly to your support address.

How about using BarracudaDrive & Lua Server Pages as a game server that handles the (cloud-based) AI routines of my iPhone game and communication between the server and the iPhone client? (the AI routines that'll run on the BarracudaDrive are in Lua.)

http://barracudaserver.com/products/BarracudaDrive/
http://barracudaserver.com/products/BarracudaDrive/LuaServerPages.lsp

I don't have any experience with either, so I'm not sure. That's why I didn't comment on your other topic about them. I have Amazon Web Services experience since I do a lot of testing on my own projects with it as well as dedicated hosting experience with native applications as well as some web solutions. Have you done any heavy load tests with it to determine latency and bandwidth restrictions at different times of the day or from different locales?

I don't know if you need to match a language:language ratio for your client/server tech. It might make development easier for you as long as it also meets the expectations of the application and your audience.

DaveMB. Seems that we got almost the same conversation on two threads so I'm posting here too:

What I want to do ( and what I think the BarracudaDrive App Server with Lua Server Pages allows) is to have a Lua program running on the server. That Lua program is the AI for the second player. In my iPhone game client after player1 (the human player) makes a move, the client sends the game state to the server. The server hands the game state off to the Lua AI program which computes a move, hands it off to the server which transfers the move info back to the iPhone game client which updates the game state according to the AI's move.

Let's continue this conversation on this thread.

views:2235 update:2011/9/21 18:18:19
corona forums © 2003-2011