Rescue City: Prologue

Well, I’ve decided to keep a blog to tell a little about my experience with games and also for sharing some useful informations about developing games. To be honest I don’t have a lot to say, I’m not a professional programmer neither a professional developer, I mean, I’m using the “professional” term here to define those who work with that every day. I work with 3D, doing visual effects for television advertises: Developing games is what I’ve been working on in my spare time.

I always wanted to make games, it was one of the reasons that motivated me to learn computer graphics (3d). I tried developing games with a friend when I was a teenager, but was very difficult – the internet was something new, there was not much information available and the existent game engines: unreachable. We had to do everything from scratch. Moreover even if we could get something at the time, releasing a game on the market would be another impossible task because necessarily a publisher would have to jump in the bandwagon. It would be difficult to contact some – not to mention the fact that we’re in Brazil… So, after several months trying to do something, my friend programming and I working in the visual elements, we have not got much success.
That was in 1996, exactly 15 years later, much has changed. Being an independent developer today, find information and have access to them is easier. There are many tools and useful information available for free or for a small price. Releasing games with the advent of mobile platforms like iOS and Android, or with the popularization of the old ones (PC, Mac, Consoles) has become an easy task. And today the publishers run after developers. Much has changed.

Having said that, let me talk about Rescue City – my first game.

– The idea.
One day I left from work late at night and on the way home an ambulance passed me at an intersection and that time I had the idea of making a game based on ambulances management, and helping services. That was in December, 2010. With the initial idea, I just needed to make the game! But how?

– Learning.
Making the visual was not a problem because this is what I do every single day at work, but I’ve never programmed anything before. I have had some experience with basic programming before, but it stood there in 1996. I knew I needed to use some engine, a framework to help me in this task – I already knew the UDK and Unity, but my first game would be 2D and I wanted to study programming. I needed an engine based only on code. A friend (Paulo Tafarello – he was developing his own game) told me about cocos2d for iPhone – it was exactly what I needed.
Knowing what I needed, all I have had to do was to learn that stuff. I decided to buy the book “Learn iPhone and iPad cocos2d Game Development” by Itterheim Steffen – Apress (a great publisher for developers, and you can buy the PDF version of the book). In the first few pages of the book, in the prerequisites / programming experience section I met my first obstacle – to understand the book the reader had to have some degree of programming experience – and understanding of programming concepts preferably using an object-oriented programming language.

So, I left the cocos2d’s book aside and bought an Objective-C book (a programming language used primarily on Apple’s OS X and iOS): “Learn Objective-C on the Mac” by Mark Dalrymple and Scott Knaster. Again I came across the prerequisites in the first few pages – “Before you read this book, you should have some experience with a C-like programming language such as C++, Java, or venerable C itself.” Again, I left the
Objective-C book aside and also bought a C’s book: “Learn C on the Mac” by Dave Mark. Why always “on the Mac?” Because I wanted to learn how to program for iPhone, and the most used tool to write and compile codes for iOS is the XCode. These books teach the basics of these languages using XCode, plus this way I learn programming, as well how to use XCode. I spent three weeks reading these books, one week for each book. Of course you don’t learn everything, but you start to have an understanding of what is going on, what you need, where to get more information and how to start your own project. In early January 2011 I was typing the first code that would be Rescue City.

– Development.
If you have any question, Google knows the answer. Everything can be found on the internet, including of course – developing games. In my case I used to access a lot 2 forums:  cocos2d and Stack Overflow. I got answers in almost every case where I got stuck. Another book that helped me a lot is “Learning Cocos2D: A Hands-On Guide to Building iOS Games with Cocos2D, Box2D, and Chipmunk” by Rod Strougo and Ray Wenderlich. Speaking of Wenderlich – his site has many tutorials and interesting information about game development. Itterheim Steffen, the author of the first book I mentioned also has a very useful website, and recently he began to develop his own engine based on cocos2d: Kobolt2D (I have not had time to see) .

In the following months I was working on the game I learned a lot about programming, and I found many libraries, classes and functions already made and free. These classes help a lot! I didn’t have to reinvent the wheel or implement some feature from scratch. One example: Rescue City is a free game, the player can try 15 free levels and if he likes it, he can buy the full game from within using In-App Purchase. To implement In-App Purchase isn’t a difficult task, there is a lot of documentation on Apple’s development portal, but for those who aren’t an experienced programmer (me), there is “generic implementations” like this: MKStoreKit, by Mugunth Kumar. Another example: In almost all existing applications, after a while the user uses it, it may ask them to rate the app. There are many ways to implement this – You can track the number of times the user use the application for instance. Here an amazing class for it: Appirater by Arash Payan.

In addition to all this code, there are a variety of tools that helping you to create the visual elements for the game.

Rescue City is a 2D game that uses orthogonal tilemaps to build its levels. With this system you can use a small library of images that can be distributed in different ways creating a myriad of combinations. There are two types of tilemaps – orthogonals and isometric (often used in 2D games that simulate 3D perspective, as the first Diablo for instance). Create game levels using tilemaps and be able to provide a real-time viewing of what is happening is essential, and in Rescue City I used a lot the Tiled Map Editor  (free).
How to manage and create that library? There are several ways to gather all these images, both the levels images and the images from game itself (cars, buttons, menus, icons, etc.), into a single image file with a list of coordinates able to return only one image in particular. This is good for several reasons – one of them is performance – call via code an image file at a time makes multiple graphic calls. For each image the graphic device manager needs to allocate a portion of memory and start a function to print this image at screen – if you multiply that by 100, 200 or 1000 times the system will be very slow. To circumvent this problem the best way is to use as I said few images that contains almost everything the game needs. The best tool I found to automatically generate these images is the Zwoptex ($ 15).
The same principle also works for the fonts used in the game. It is much more efficient to use a single texture map with all the characters already rendered than having to ask to processor to draw each character on the screen every time you need to show a text. This is valid only for dynamic texts, which often change during the game – as the score. It isn’t always necessary to work with this system. At first I used the Hiero tool (free), but after some problems and incompatibilities (it stopped working in OS X Lion) I decided to buy the Glyph Designer tool ($ 29.99).
Another feature I used a lot in Rescue City was particle systems. Cocos2d supports this feature, but to help create those systems visually first and then implement it in the code I’ve used the Particle Designer  ($ 7.99)

Music and sounds are important elements in game. I’ve bought the sounds most at SoundSnapSound Studio to edit and export to .CAF files, which is one of the formats most used in iOS. The songs are from MacLeod, a very nice composer who offers some of his tracks royalty free (of course, a contribution via paypal is worth) – He’s composed amazing soundtracks.

– Launch
Nine months later (working at nights and weekends) at the end of September, Rescue City was ready. I tested the game a lot, spent much time of last week fixing bugs and creating the latest levels. The game was well received after launching. Was TOP 10 overall in 31 countries, TOP 10 games in 39 countries, Top 10 action games in 45 countries and 66 countries in strategy category. In both Strategy and Action, Rescue City was TOP 100 over 110 countries, virtually everyone. In some countries it was the most downloaded application (TOP 1). Rescue City was featured in What’s Hot in 44 stores.
I was very happy when one of the largest sites in the world specializing in games, Touch Arcade, did a review of my game. Later major portals like iPhoneItália and iPhoneAppReviews did the same, among others.

 – Updates
After the first feedbacks, I spent days working on updates to improve the game.
I’ve improved the controls accuracy rewriting the entire code related with path drawings. (this was one of the complaints from some players who have played the first version of the game). I’ve implemented the Arcade Mode where the player could be able to play all the levels again, in totally random way – the player can save as many lives as they can. And finally, Game Center Support was added, and other improvements.
I spent days sleeping few hours a day, because I had to go to work, and just had the nights to work on my game, and no mattered how many hours I slept, I’ve woke up every morning because was in the mornings that Apple usually disclose the number of downloads of the previous day. Were tough days but very happy because I had realized the dream to develop and launch my own game, which was being seen by people all over the world.

– Present and Future
Rescue City has not changed my life in the financial sense (really! – I still work in the same place, doing the same), but the game has changed what I want, and I’ll try work only with it in the future. I really enjoyed developing this game, I learned a lot! I learned the process from start to finish, from the first drafts of an idea through the entire development until the release process and believe me, it’s a lot. I liked the feedback, knowing that thousands of people spend hours, days playing something I did.
I am now working on the iPad version of Rescue City, and then I plan to develop a new game, in 3D. I will continue doing this in my spare time, which unfortunately there is little of, and I’ll use this blog to report how is this way.

Leave a Reply