Back to Home

The story of another game on Libgdx + Box2d

Android · java · libgdx · box2d

The story of another game on Libgdx + Box2d

I got the idea to write a game back in 2011. In August 2011, having no development experience in PHP, having overlaid with books and these your Internet, at night I wrote a small browser-based space strategy in real time. A sort of clone of OGame. Of course, with their ladies and preference. But this project was not destined to be born, in December 2011, the Motherland suddenly asked for a loan.

Returning in December 2012, he first got a job at a local large IT company. It was necessary to re-enter the working rhythm as quickly as possible. By spring, I could no longer sleep peacefully - I dreamed of writing games. The second attempt was to write a simple TD on Unity. Something even happened - the guns fired, the mobs moved. But I was constantly tormented by the fear that I could not finish the job. And so it happened. Family, work - there was no free time at all. And it was only in the fall of 2014 that I firmly decided - I will make a game, period. I won’t sleep, I won’t eat, but I will. A sort of challenge to "weakly." What came of this read on.

How it all began


In 2013, they gave me a tablet. That's when I found out that there is such a miracle as Google Play. When he first got there, there was no limit to delight. Eyes ran up from the number of sentences. After some time, some outlines of the future game began to appear in my head. I wanted something simple, but interesting. Since childhood, I loved to play Chapaev. It was on this game that I stopped.

Since I didn’t have any fighting knowledge of Java and Android , the books “Developing games for Android” , “Programming games for Android” , “Android for programmers. We create applications " and " Java Philosophy ". After reading, confidence increased. Armed with a notepad (as advised in books), I issued two sketches:
and time

and two

On this the muse left me. The artist of me, as you yourself may have noticed, is none. But a friend from the old work came to the rescue - the great master of Photoshop. Looking at my masterpieces, he issued
first version of design





I was wildly delighted. I just could not believe that the game was about to appear. Then these models were shown to a friend-programmer, with whom we had long studied in the same class. And now there are already two of us burning. But I didn’t have to rejoice for long, having installed IntelliJ IDEA, we realized that we did not know what to do next. A rather long period of searching for information began - how and on what to write the game. In the end, we came across Libgdx . Quickly ran through the documentation - it is. Exactly what you need.

But here, like a bolt from the blue, the idea comes to us to attach historical facts to the game. Since we are writing Chapaev, the design should be appropriate. So it should be Red and White (these colors were in the first version of the design, but there they are by chance). There must be symbolism of that time. There should be a tactical map (by the way, it is also in the first version, and it was it that pushed us to a historical reference). There must be a rating. Must be pvp. Must be a tricky AI.

Our designer comes to the rescue (for the umpteenth time) and issues
a completely different concept
Screensaver:



Main screen:



Ratings:



Settings:



Preparing for battle: Battle



screen:



Screen in the choice of control type (in the future we removed it, but it will appear in the 2nd version):



Pause:



The battle is over!




From layouts to code


Everything was written in his spare time. I must admit that the main work occupied and takes most of the day. Plus family and home fuss. In the end, we were happy if it turned out to work on the game for at least 2-3 hours. But sometimes a miracle happened and at an accelerated pace, almost in Stakhanov style, at night we created game screens one by one. In fact, it turned out to be easier than we expected. And after a couple of weeks we had a working prototype that we launched on our devices. It's time to write the game world itself with physics. Of course, inspired, we threw all our strength into our bike. But the longer we wrote and polished it, we understood that we were falling into an endless cycle. They wrote something new - they tested it, found errors - they corrected it. And so on ad infinitum. Sometimes what worked yesterday fell off. This could not continue for a long time, and we went in search of a physical engine. To our great surprise, we found what worked in Angry birds, namelyBox2d . Now the reasons for this enthusiasm are somehow incomprehensible. Now all this is obvious, but then we rejoiced as children.

But here one more obstacle lay in wait. Box2d is very well suited for platformers (there are enough articles with examples on the hub) We have a game with a top view. We turn off gravity and make a very serious mistake, namely, we choose the wrong scale of the game world, it turns out to be VERY large for us. As a result, the checker moves very slowly. Later, when we corrected this error, it turned out that when converted to physical quantities, the checker moved at a speed close to the speed of light.

The second month of development was coming to an end. Experience accumulated. The game was becoming more interesting. But we have not yet implemented a lot. As a result, we decided to temporarily abandon the network game and take out the pvp mode in the second version of the game. Instead, we fasten the local rating. We use SQLite and just read the statistics on games by AI and each player (when two people play on the same device).

To play with the "computer" we wrote a simple AI. But it turned out that he made moves in a patterned way and after several games the player already knows what kind of checker the bot will play. I had to improve, and at the same time add a turn in turn and a control inversion.

We translated the game into English and German.

Total


December 30th is the time for Ch. Having spent a week testing and fixing bugs, we brought the matter to an end. Now the game in the Market is gaining downloads and ratings. It took 2 months to write the whole game. They wrote together. In total, the team has 3 people.

It does not make sense to lay out charts, since the game is only two days in production, but almost $ 3 has already been earned on advertising. This is not an achievement. This is just a fact.

What have we brought for ourselves

Maybe for beginners like us some tips are useful.

1. Learn competitors. Search, analyze, read reviews.
2. Start collecting errors at the testing stage, it saves a lot of time. We use Crashlytics in our project .
3. Design. Design. And design again.
4. Prototype. Take the paper. Draw, cut. Try playing the paper version. Too many points will be decided at this stage.
5. Think over ways of monetization at the stages from points 3 and 4. Since we have nothing to sell (at least for now), we have managed only to show ads.
6. The best is the enemy of the good. There never will be a moment, “Well! Everything is finally ready! ” Know how to prioritize tasks. If the implementation of a new feature takes more than a week and it’s quite comfortable to play without it - lower the priority. Transfer the task to the next iteration of development. Better to release a version that you can play than to drown in the sea of ​​"Wishlist". Do not complicate, be simpler.
7. Feel free to show the intermediate versions to friends, colleagues, acquaintances. They have a fresh look. They have no bias towards the product. Listen to criticism. Do not be offended if the criticism is harsh. All people are different. Do not rush to realize what some people think will be a bomb. Take on a pencil. Who knows, maybe it really will be a bomb.
8. I always carried a notebook with me. Ideas came sometimes quite unexpectedly. Try to record everything. It is much easier and more correct (IMHO, of course) to select several worthwhile ideas from a bunch of drafts.
9. Never! Do you hear? Never stop. Do not be afraid of failure. Failure is wonderful. This is an indication that you are moving. This is an experience. You can’t buy it.
10. Believe in yourself. Even if no one else believes in you or in the idea (yes, it happens). This is your idea. And you must bring it to the end.

That’s all for me. Thanks for attention.

Update
At the time of the publication of the article, we have 1.5k unique installations from the market and a little less than 4k thousand users in total.

In our category we were in the top 4

Read Next