📜 ⬆️ ⬇️

From idea to Google Play in 30 hours


Greetings, habrazhiteli!

Today I want to share with you the story of how I did a lot of all the right things to bring the project to create a small toy from beginning to end. Such things were: analysis, planning, design, TDD development and testing. And it all went along scrum. Yes, it is in this composition and order. In general, all this should be the rule, the ideal route for the project, but not all and not always understand it. Well, at least I often lazy and rush into the code, forgetting about the rest. It is not difficult to guess what comes of it. But not this time, I said to myself, and putting the keyboard aside, I took the sheet and the pen.

Disclaimer : this article is purely motivational. Technical details will be presented separately.

Motives

The main reason that spurred me to this project was the desire to go all the way to developing games, even in the context of such a small project and even in a vacuum. But in the end, I still wanted to feel every aspect of the game dev. For myself, I decided that in the past I had already done enough with home projects, and this time everything should be like in adults.
')
Idea

The type of upcoming software was already predetermined - the game (there was somehow nothing to think about, subconsciously everything was decided a long time ago). The target platform of the first version assumed Android, but only because it is closer in spirit and does not require additional knowledge. Then I thought about the genre. Despite the shooters and real-time strategies that pop up in my fantasy, I, pessimistically assessing my strength, decided to follow the principle of quick win and aimed at a simple puzzle. Among the abundance of puzzles, a filler appeared first in memory, a field of rhombs of different colors and the only goal: to capture more than half of all the cells. On this and stopped. Of course, as expected, the search gave similar results, but nevertheless, not so much, and the choice was approved.

Breakdown into tasks and their planning

Before considering the work and allocating tasks according to the calendar, it was necessary to review the final product from all sides, decompose it to the level of elementary tasks, pick up tools, libraries, estimate the testing process and production.

The first thing on a piece of paper (or rather a couple of tens of A4) were created preliminary mokapy. Then it was decided to fully depict them in Photoshop, thus there was a chance to prevent visual inaccuracies even when designing. No artist from me, so I finally had to look for lessons on the Internet (how well you managed to judge everything). But it was decided to build the sketches from the final versions of the resources, so I tried to kill two birds with one stone, and after the project is over I can say that this decision was a good one.

Further, I thought over business logic from A to Z (it is important to understand that even if small algorithms are not thought out at this stage, they will have to be fenced in a hurry already at the design stage, therefore I strongly recommend not to neglect it). Based on this information, I moved on to choosing a framework.

The spirit of the experimenter suggested that you need to try something new. So I met cocos2d-x. I will not list the benefits. Inquisitive users have already gone to Google, and those who are familiar with this platform will understand me in my choice. From myself I will only note - both the functionality and performance, and the license fit my requirements perfectly. Now that the framework has been known, it has become easier with the assessment of labor costs.

And the code is still early to write, but based on the available information, you can do UML. I strongly recommend to overlap with all the materials collected at the moment and build-build-build class diagrams. I spent the whole evening on this activity. The first option was as before, anyhow, and coped. But after all the class diagram should relieve the developer from design of architecture on the move. Therefore, all the squares went into the garbage and began the second round. Somewhere in the middle of it, I repeatedly made the mistake of oversimplification, and it was only the third time that I was able to draw up a very decent document. Looking ahead to say that it is more than 80% corresponds to the real code.

Summarizing and running through the entire writing, I determined 10 hours to work with resources (I took the music by the way, I don’t know how to do it), 20 hours of pure programming, and 10 hours for testing and bug fixing.

Getting started!

So, the task list is compiled, proceed to the execution. On the calendar, the beginning of the holiday, and the hands, not accustomed to the keyboard at work, were already itching and tearing into battle. But in order to continue to observe the best practices, I sat down at photoshop. And, oh, a miracle, I did not need to invent a job for myself. I have all been clearly decomposed and painted:
- In total, 5 screens.
- 1st day, menu screen, and game mode selection. They depict ..., ... buttons, ... elements and so on.
- 2nd day, the playing field, which shows ..., ... and so on.
- 3rd day, screen pause and end the game.
Wielding a scrum, I singled out tasks for myself, prioritized them, set limits and managed the backlog, in short, the king and god. All vkuche very well systematized my work. For myself, I made a small rule - do not take into the development of more than 2 interchangeable tasks. Stopped on one, turn to the other, and later return to the first.
Preparation of resources selected three evenings, totally 7 hours. Such advance graphics warmed the soul.

We proceed to the development. We have 20 hours. How do you monitor progress and at least indirectly understand whether I have time? And here is how: 20 hours is a rounded number consisting of the sum of labor costs for the implementation of each element of the class diagram. Now, in order to understand which parts of the program are ready, and what general progress has been made, the following method was invented:
- we implement all-all classes / methods, but inside we put dummies, we need only a successful compilation;
- for each method we throw Unit tests (3-5 pieces for each);
- now during the build you can see how many tests have passed, and this is the% completion of the project, and how many tests have dropped, and this is the part that has not yet been implemented.
Thus, we have a project progress indicator.

A separate paragraph deserves information about monetization. Of course, for the time and effort spent, I want a reward. Therefore, it was decided to tie a little advertising. Google AdMob has different types of advertisements. I chose this strategy: during the game - no advertising, but only a full-page banner after leaving the game. Here I also want to tell about a small architectural trick (this is from 20% of the code that does not correspond to the class diagram). Cocos2dx at the end of the game, does not go normal by finalizing the operation of the application, it does not call onDestroy, etc., it just kills the current thread with the application. At the same time, cramming advertising into the native library is also not a trivial task.
The solution is:
1) after the user closes the game (by clicking Exit), the main field of the game is hidden and the JNI comes to the rescue, which pulls the display of the new Activity with advertising;
2) when the advertisement is then closed by the user, then it collapses, then what other option (Back / Home / Menu buttons, etc.), again, JNI, but in the opposite direction sends a call to finalize the game and all closes.

Testing

For testing, I applied two strategies (again, even at this stage I had everything planned and went according to plan):
1) manual testing. Fortunately wife - QA engineer. Special thanks for the help.
2) automated testing. Now the Internet is actively developing services that provide remote access to real phones / tablets for the purpose of testing developed applications (here are the links). Also a positive feature of such services is the availability of a trial period of use. For myself, I identified three such services. The first is to be able to run the final application on different devices. The second is for performance and load measurements. And the third is for mass surface testing on a large number of devices.

Both strategies in total gave about ten obvious problems and again the pledged volume of labor costs was not fully utilized.

Production

It is better to see once than seven times to hear.


Total

- Invaluable experience!
- 18 hours of development + 7 hours of resource preparation + 5 hours of testing = 30 hours of real work, which is not a shame.
- Pride for the project which is brought to the end! And the wild desire to share the achievement (that is why, not having slept enough, I spoil this article).
- The hope that something will come of it (maybe empty, since I had no previous experience with a mini-commercial game dev).
- Motivation / tips for readers.

What remains to be done (if the project starts to show signs of popularity):
1) Increase the game for iOS and Windows Phone 8, well, and most likely the desktop version for Windows.
2) Tie google analytics to analyze the behavior of players.
3) Extend functionality: difficulty levels, field / cell sizes, total top (somewhere in the cloud).

If I have not covered any details of interest, write in the comments, I will definitely answer.

Useful links:
1) play.google.com/store/apps/details?id=com.xlab.ice.HexFiller - actually my “masterpiece”
2) appthwack.com - mass testing service
3) cloud.testdroid.com/web/home - application performance testing service
4) testobject.com - the ability to run the application on multiple devices with the subsequent interaction
5) developers.google.com/mobile-ads-sdk/docs/admob/advanced - interstitial ads

Behind the scenes were the nuances of preparing graphics, working with different displays, assembling, launching on an emulator, the algorithm of the AI ​​game strategy and all sorts of trivia. But this article is more motivational. And yet, if anyone would be interested to hear the unsaid - vote, I will write the second part of the article.

Thanks for reading!
As you can see, a serious approach even to small projects is bearing fruit. And saving time, and the final result, all this indicates the negative side of disregard for the pre-coding / post-coding stages, which must have everywhere. I learned that now.

PS Thanks to reenboog for tips on graphics and resources and coder1cv8 for tips on monetization.

Source: https://habr.com/ru/post/231981/


All Articles