It's out in the AppStore! Here's the link.
We've worked on Mega Dragon Run for a while. The thing is finally out and doing good. The highest rank we reached was #5 Top Overall Free App in the US AppStore. That's a huge achievement. Here are some of the things that I personally feel good about having contributed to the game as a technical and creative person. None of them are supposed to be too impressive, smart or complex, but I feel they're cool.
By the way, the game is free. Go get it. Now. And buy some coins.
Facebook Friend Score Boards
The reason I enjoyed doing that was the server side work. The game consumes many different web services but writing both ends of a client-server system and seeing it in action, at least for me, is very satisfying, especially considering all the new stuff I got to work with. I'm going to go into the server architecture we used for the feature and the problems we had to overcome.
We originally used a WAMP (Windows, Apache, MySQL, PHP) stack for the server side here. Almost every development tool that composes the setup was new to us - before this, we never wrote a line of code in PHP, used Apache outside of school, or done any meaningful work with MySQL. After a couple of weeks we had the web services up and running on AWS EC2. The stack worked just fine for the following months until release day came and that's when (obviously) everything started crashing. Apache was able to serve requests for less than a minute before crashing and having to be restarted, with the error log reporting hitting the maximum thread count. Upping the thread count limit gave it just a little more uptime. The game was already live in the AppStore, but this didn't seem to be a load-related issue because usage was still very low.
|It seems I'm as good at the game as I am at server architecture|
After research and long attempts to stabilize the server with Dan B. from AWS support I realized the best shot would be to set up a new stack, this time using Linux instead of Windows, and separating the database and application to 2 different servers. A Facebook message to server guru and friend +Shai Mishali (who also advised the use of Nginx instead of Apache), and 3 hours later we had a stable working stack consisting of Ubuntu, Nginx, MySQL, PHP. So thanks to Shai everything seems to be fine right now. Shai is also a web developer and a native iOS app developer and is available for freelance work - highly recommended.
At some point in the development of MDR (Mega Dragon Run) we switched all 3 background layers of the game with another (the current) backgrounds that are more consistent with the rest of the art style. The downside was that the change made it harder to visually distinguish the enemies from the backgrounds, making gameplay suffer. The main thing we did to solve the issue was assing a thicker stroke for the enemies. The second thing was the shadows, which made the game look prettier and gave the player a visual logical indication of the existence and position of actors, making the player and enemies more distinctable to the eye.
Here's a comparison of a typical scene in the game with and without shadows (the point is made better in motion, though):
|Enemies use same colors as background and platforms, hurting gameplay|
|Shadows give a realistic look and indicate actor position|
The shadows were implemented using OpenGL blending functions to use the platforms as a mask for the shadows. We could not use shaders for the job as they are not supported on OpenGL ES 1 (cocos2d 1.0) which MDR is using. In case you're wondering why we didn't just stick shadow sprites that follow their actors, the reason is that partial rendering of shadows is required over edges of platforms.
The game is based on the code of Mishu the Dragon, which went through a lot of changes. I didn't like the way the camera moved in he original game, so I decided to try a different system. The best way to feel both is to simply play both of them which are available for free in the App Store. The camera position and the way it moves is based on the these priorities:
- Keep the player on the screen.
- Keep the lowest visible platform on the screen (ignoring those already behind the player).
- Accelerate and move smoothly, minimize fast movements.
I think that the end result is good. Try it in the game right now and let me know what you think.