Dev Story: Raildale is a game about the railroad for iOS and Mac

Raildale iconI'm a game developer Raildale, and this article will tell you the story development. But first, let me say a few words about the game. On the field there colorful town you want to join the railway. From the cities come out of the train, and they need to send the appropriate color using the switches and signals and avoiding collisions. Yet there are various additional features: repair trains, Express trains, and others. In my opinion the game was very interesting, and the reviews yet I have only received positive. The game is not easy and it is really difficult. Raildale is available for iOS and Mac OS X in the App Store.

image
More information about the game can be viewed at www.raildale.com.

the Backstory

2 years ago (fall 2012) I worked as a programmer and worked on the time management systems company for 10 years. Such systems have one common feature: these projects are never ending. I loved the project and tasks were interesting, but for 10 years I'm tired of this region. In addition, like more freedom in the adoption of technological and interface solutions.

So what I'm wondering about implementation of the project. I thought about developing an app or game for iOS. In the end I decided to make a game. This could not be further from what I was doing before, and therefore very interesting. Of course, the project wasn't supposed to be very large, as I had no experience in game development or in marketing.

I had a lot of ideas, but I stopped my choice on the trains. This was the game that I would love to play. Frankly, the idea is not new, in the childhood I played a similar game. Expected to find something similar for the iPad, but that was all I did not like. So I decided that this is a great option for your first project.

In General, I decided to resign and concentrate on your project. My salary was good, so there was some savings. Therefore, Finance has not hung and could easily work for some time without profit, the more the wife continued to work. But when the conversation turned to resignation, the management has offered some interesting challenges, and I decided to stay for a while. The result was I just quit in June 2013. All this time I slightly led the development of the game in parallel with the work in their spare time, but a lot of time on it I paid could not. Then in July I have 3 weeks went to Iceland on vacation. So to complete the work I plunged in August 2013.

2D

I Originally developed the game in 2D in isometric projection. I used Cocos2D – the most common engine for 2D games for iOS today. Can't say that I liked him. The main problem is that it uses the model sprites. And this virtually eliminates the separation of the game into layers (model, controller, view) and makes it impossible to isolate state. I have not worked with him to achieve the code that I would like. Keep getting samozaryadnyj code. I tried to find equivalents, but all I found was built on the same principle. And Cocos2D still has a good documentation and an active community, which certainly is a plus.

For development I used JetBrains Indicates. XCode is also a good IDE, but it's hard to compare, I used the IDEA and got used to many things. I can say that Indicates the debugger is much more convenient. However, in XCode there is a great utility for debugging drawing in OpenGL. She can bring all operations of a single frame, which sometimes is very convenient, even trying to suggest something. So, you can tell XCode which I also had.
After a while I realized that Objective–C annoys me. The reasons are many, I wrote about it article (eng.). Of course, not all agree with me, but to my development methodologies, Objective–C, just not very well suited, although in Objective–C there are some interesting ideas. So I developed their language in parallel with the development of the game and called it Objective–D. I wrote about this in a separate article on habré.

For drawing sprites I used Sketch – vector editor for Mac. Overall good program, a little buggy, though. Besides for some reason it is not possible to upload the result in arbitrary resolution. Only that which is drawn or 2 times more for retina. Which is very strange and uncomfortable, especially for icons: you have to copy and save manually. And another drawback – unnecessarily large file size, which is inconvenient when working with VCS.

I was faced with a problem of turns of the trains. For this we have to draw the wagons at each corner that took a very long time. And the result was not very good, the train was jerking. To this effect, had, had to draw a lot of angles. Then I came up with the idea to use the 3D editor to do this. I chose Cheetah3D, bought a little trailer for a couple of dollars, put camera angles in isometric projection, the light was adjusted. I spun the van around and took pictures. It went much faster than painting, but a satisfactory result was achieved only when a very large number of rotation angles. So file these corners were enormous, especially for retina. With that file, my iPad did poorly frankly retarded.

3D


image
I decided to try to abandon 2D and go to 3D. Especially since I now know a little about 3D editor. I was looking for a engine for 3D and probably the most obvious choice would be Unity3D. It's a lot of documentation and it mostly praise. But I did not like that there are many operations done in the constructor, and I wanted to write code.

I tried Cocos3D – Cocos2D extension to 3D, but I like this library did not like. The same problems as in Cocos2D, plus the almost complete lack of documentation. As a result, I have not found any engine that would fit my needs, and decided to try just OpenGL.

I had a little trouble to achieve the withdrawal of the triangle and display cycle. Began to develop the game in parallel, highlighting the shared library for future games. The main idea is the separation of code into layers and isolation of mutable data. Thus, almost all modifiable data is isolated in the layer controller, and the display layer contains only pure drawing functions. In the layer display changing data is allowed, necessary only for caching or animations. The controller layer I covered with automatic tests. As a result, the code quality of the game I was satisfied, I am pleased that there is something to modify and I want the game to improve. When code is bad, this desire usually does not occur.

In the beginning I found not a very good guide on OpenGL. There used to be such things as a stack of matrices, for example. When I got to writing shaders, it turned out that the matrix in the Shader is not transmitted, and indeed it has long been obsolete, and much more. Had almost everything I have done up to this remodel with a modern twist. So it is important to find the right guide. I would advise this.

I originally developed just for Mac, it's easier to test: no need to connect your device to the computer. On emulator games test generally useless and terribly slow. When something began to take shape, I decided to try to transfer iOS. The main problem was that the Shader language in OpenGL ES is slightly different from the usual. But I got over it pretty quickly.
The game is quite simple lighting model – one global directional light (sun). Shadow I originally was not and I decided that it would be great to add them. For this I used shadow maps. It wasn't very difficult for my lighting, but the shadow map eats a lot of resources, as you have to draw things twice. The game began to slow down, and I was engaged in optimization.

In this case, pretty good help tools Apple: there is a special tool that shows you possible problems and advises how to solve them. A very useful tool for a novice developer OpenGL. For example, for me was the discovery that it is not necessary to call OpenGL functions, which change state with the same parameters. They are sent directly to the GPU, without verifying if it matches the condition with the current. So this test have to do yourself. Oddly enough, this small change greatly improved performance. In addition, the greatly improved using the Vertex Array Object (VAO).

For recovery pictures have added to the game wind, rain and snow. Wind tends the trees, blows smoke trains and precipitation. The main direction and the wind force does not change during the level, but occasional gusts of wind. The volume of the sound of the wind varies with the strength. In addition, for revival, added bird sounds. They are different for different locations and weather are played in random time specified for the specific sound of the middle frequency.

I screwed physics engine Bullet in order to simulate the projection of trailers in a collision. The first results were quite boring – trailers was only slightly derailed. Then I decided to apply the effect, which is often used in movies to enhance the entertainment tossed trailers into the air at the moment of collision and gave them a random rotation. I think it turned out great.
image

the End

Testing of the game was my wife. Her testing was not new – it deals with software development and test her before had done. She was able to identify many problems and defects. She passed the game on three different devices, which so far has failed me. I'm stuck on the 15th of the 16 levels, but sooner or later I expect it to pass. Oddly enough, I'm very interested to play Raildale. Honestly, I thought that by the end of development desires to play I will remain.

Closer to ready, I posted a version on TestFlight for organization of the beta testing. Great service and surprisingly, free. I integrated their SDK that allows you to set control points, in order to understand where came the testers. It also collects crash reports including an already working version. This is very useful, as these reports would appear in iTunesConnect, but it works very strange and not always they get there. Can't say, however, that beta–testing was very successful. I published a proposal for testing on the forums. People responded, but their goal was mainly not testing, but just to play. So the bug reports I received, but at least played on different devices, and the game didn't fall.

When the game was already close to ready, I ordered the transfer of One Hour Translation. I liked the service: fast, convenient and cheaper I have found. True about the quality of the translation it is hard to say. You can order very small texts. I dozakazat then a phrase of 5 words. The price is determined only by the number of words. I ordered a translation from English into Brazilian Portuguese, French, German, Italian, Spanish, Japanese, Korean and simplified Chinese. In English, I translated by myself and ordered proof reading, that is my text checked English speaking people. It turns out about 7 times cheaper translation, and better, I think. So a good way, if you have good command of English.
Localization has a little problem. To output the text I used bitmap fonts. That is, a picture with letters and the file, which says where each letter in this picture are located. But this method is not suitable for Asian languages. So I had to quickly change the system to output text and draw the first texture with the letters iOS methods.

In General, the localization turned out to be a rather slow process. iTunesConnect is very uncomfortable and running slowly. Seems to be a simple task to translate the name boards in GameCenter turns into torture. But I managed to find a solution – iTunesConnect Transporter. It allows to write everything in iTunesConnect, in the xml file and upload it with screenshots. It saved me.

During development I wrote down how much time and what I spent. At the time of this writing:
the
    the
  • Programming – 623 hours;
  • the
  • Design (3D model, texture, icon) – 60 hours;
  • the
  • Objective–D – 234 hours
  • the
  • Marketing – 249 hours;


This is my first game, so time at all it would be possible to spend less. About marketing, for example, I was forced to read a lot of information, try something that does not make sense. Still can't understand how it happened so much time. When doing marketing time flies, and it seems that nothing was ever done.

Apruv took 2 days for the Mac version and 5 days for iOS. At the moment the price is $1.99. 15 promo codes for the iOS version to here. It would be very interesting to know your opinion. I'm going to improve the game and so I would like to hear what would you improve in the game that I liked that.

I know that on Habre love to read also about marketing of the app. Of course it's interesting to get insight into profit, to learn from others ' mistakes and successes. But for now it is a bit early to say since the game came out recently. I think the findings can be done in about a month.

Download Raildale here.

Article based on information from habrahabr.ru

Комментарии

Популярные сообщения из этого блога

Car navigation in detail

PostgreSQL: Analytics for DBA

Google has launched an online training course advanced search