Wednesday, 31 July 2013

My Very First Android Development Experience

INTRODUCTION
This is a rather non-technical developer diary of my development experience with Android. Non-technical because the game doesn’t have much complex stuff in the first place. My first Android game is essentially an upgraded version of my online racing game “XPro Rally”.

DEVELOPMENT OF THE ANDROID VERSION

Unity technologies recently made the Android Basic license free of charge. I already had the Android license for Unity3.x, but updated to Unity4 for this game. Developing the Android ‘port’ took me about 100 hours, across 3 weeks. Being my vacation time, I was pretty laid back about it. 

1) UI/Presentation : You can head over to Shockwave3D.com and play the earliest version of XPro Rally. Probably the first thing you would observe is that the menu and the UI of the game, are pretty ugly. Of course, that was the best I could do back then. I was infact quite proud of the menu and felt that it was nice. 
The very first menu UI, very plain and boring :/

It took me about half a year to realize that the UI wasn’t good at all. In the next version, called XPro Rally : Refueled, I redesigned the UI, and this time the results were much better, and a bit professional, I thought.
The Refueled UI was inspired from a version of Colin McRae Rally and MotoGP 2. See below

The UI for XPro Rally : Refueled

But with the android version, I wanted something different. So I designed the UI from the ground up. This time it looked muddy and messy, just like a rally track would look like. Dirt flying around with a lot of splatter around the screen. By the time I finished, the new menu UI alone had 620 lines of code. It is still a work in progress with a lot of room for new features.

Menu style of the Android version, the CarolineUI ;)

When I was about to start coding the UI, I had to make a folder where I could store the UI programs. For some reason, I didn’t name it “UI 3.0”, instead I paused for a while to think what the name should be. “UI 3.0” sounded too generic. I thought for about 20 seconds and then realized the name of the song I was listening to, it was ‘Caroline’ by Wolfmother. It’s one of my favorite songs ever, and I had put it on an infinite loop. It was probably playing for the 50th time that day when I thought that the folder could be called “CarolineUI”, it sounded nice, somewhat like a code name. I’m into code names…they always sound very awesome J


2) Performance : The main issue with the Android port at first was the performance of the game. I got the Sony Xperia ZL this June, which is a sort of flagship smartphone by Sony right now. With quadcore 1.5GHz processor, Adreno 320 graphics, and 2 GB of RAM, the frame rate averaged at 15. I did some reading, and found out that the main reason for it was probably the Unity terrain. Here is an informative discussion : http://answers.unity3d.com/questions/138903/splatmap-performance-question.html

I looked into my project and found that most of my terrain were using 3 splatmaps. I had to repaint the terrains with just 4 textures to get better results. Further, I increased the pixel error to 61, pixel error is a sort of LOD for the Unity terrain engine. I removed the 3D trees from the environment. Each tree has as many as 2000 polygons, which often resulted in a total of as many as 120k triangles being rendered at every frame. 
With the 2D trees and terrain optimisation, the number came down to a maximum of 40k and 230 draw calls, which averaged at 170 draw calls per frame.


3) Car Controls : Being a racing game, the car controls play an important role in the overall gameplay experience. I had received some positive comments about the controls of the online version of the game, so I decided to stick with them for the most part. I didn’t want the game to have very realistic rally specific controls like a simulation, so I made sure that the controls had an arcade-ish touch. This way they would be suitable for a larger number of players… it might disappoint some rally purists who  play Colin McRae or Richard Burns rally etc.

The program behind the car controls was originally written by Andrew Gotow here : http://www.gotow.net/andrew/blog/?page_id=78

I have continuously worked on it and taken it from being a 65 line program to 370. Its not even remotely close to what I would want, but it gets the job done. Changing the program from a keyboard input to touch 
input was a pretty easy job too.

Touch-pad controls

For some reason, the motion based control system didn’t work out really well with the game, so I decided to stick to a virtual pad controller. It still has a major issue… it doesn’t detect multi-touch. This is obviously one of the main changes that I am planning with the next update.


PROMOTION

XPro Rally had a quiet launch on both Google Play and Amazon. I tried to upload it to SlideME and Samsung Apps, but it didn’t comply with some of their policies. I didn’t have a promotion or marketing budget. I posted about it on facebook and a few friends gave me some feedback about it. I came across a page with a list of popular android forums where I posted announcements of the games’ release. The posts were viewed by thousands of forums members ( and lurkers J ), which boosted my game to about 350 installs a day.

It was one Friday, after about 10 days of the game’s release that I decided to upload tablet screenshots of the game to Google Play. I don’t know if it was the ‘weekend effect’ or the tablet screenshots, but my downloads kept on increasing 3 to 4 times for the next couple of days, and within 4 days the total installs of the game were 17000, 5300 of them coming on Tuesday alone!

Anyways… the popularity of the game has been increasing exponentially; it was featured in the trending apps section on Google Play Russia at 122 position. The rankings in the racing game category have been jumping up by dozens and hundreds in a single day. Right now, it has a 2 digit rank in 3 countries, and the list is hopefully going to get bigger. The game enjoys good popularity in Russia, South Korea, Hungary and Taiwan to name a few.

USER RECEPTION

The reception of the users has also been positive with an average rating of a little over  4 out of 5 starts, based on about a hundred reviews. Some people have experienced game crashes, leading to an increasing number of 1-star ratings. I am yet to resolve this issue, but I guess the main reason would by the specification of the phone itself. I have updated the minimum hardware requirements of the game to 1GHz processor and 768 MB RAM from the previous 800MHz/512MBRAM. Since about 65 percent of the users have a medium-high end phone like Galaxy Tab 2, Galaxy S2/3/4, hardware requirements are not much of an issue.

MONETISATION MODEL

Developers might specially be interested in this section J

XPro Rally is a completely free game. I decided against making it a paid app because of several reasons : piracy; 30% revenue cut that Google keeps and the fact that the game doesn’t have enough content for a paid game.

The game is completely ad supported, without the ads intruding during the gameplay. The ad networks used are : StartApp which uses ‘search based monetisation’; AppBrain, which shows up a list of free apps when the user presses the “more apps” button in the menu; and finally AdBuddiz which shows a full screen ad everytime the user finishes a race.


I would not disclose the revenue details publicly, but I am very happy with the performance across all 3 networks.

CONCLUSION

Overall, it has been a good experience porting my game to Android. It has helped me learn a lot by revisiting an old project. I realised I could have done certain things in a better manner. There were a lot of things that indicated lazy development with 'shortcuts' just for making things work, that are not easy to change to expand later, which made me think that I was a little stupid a year back! I guess that despite how much you cherish your old games, this feeling of stupidity and maybe even embarrassment when you see your old projects 'inside-out' is a sign that you have made progress.

The fair amount of success with XPro Rally has given me a nice launch and a boost of enthusiasm. I have more projects in development which will be out in the months to come.

Cheers

2 comments:

  1. Thanks for sharing these guidelines for developing successful Android apps. You have done a fabulous work. Android Game Development is becoming fastest growing field in app development market.

    ReplyDelete