📜 ⬆️ ⬇️

As I wrote the game for 3 years

The other day I finished creating my own small game and I want to describe to you the way I walked. I want to make a reservation right away that my main goal was to gain knowledge and experience in creating 3D games for Android, and I successfully achieved this. For the same reason, I did not use ready-made engines.

image

I started by creating maps for Counter-Strike: I made a map with a bus stop from my city, I tried to make a school. Cool to shoot at home school? This gave me a basic understanding of what the virtual world consists of.
')
Somewhat later, I started to run OpenGL tutorials on Android. He was happy as a child when the coveted triangle appeared on the phone screen for the first time!

image
* Picture taken from here.

Then we got a cube with a superimposed stone texture and thoughts about creating our simplest game appeared. Transferring the Portal game to Android seemed like an achievable task for a newbie. I greatly underestimated the amount of work ahead. It’s good that Portal already existed on Google Play at that time, and I managed to create only one room.

Then I decided to do something simpler and, having seen billiards without gravity in Futuram, I decided to implement it quickly (while others did not have time). It turned out that I still underestimated the amount of work. And, by the way, billiards without gravity did have time to do before me.

image
* Screenshot from Futurama, season 7, episode 5

From this moment, about 3 years ago, the creation of my first Star Pool game started - billiards in zero gravity. In the beginning, I had a basic knowledge of Java and minimal image editing skills. I worked mainly after work, as well as with long breaks when there was not enough time.

Graphics engine


As I added functionality to the graphical “engine” borrowed from tutorials, it became less flexible and more fragile. By this time, I seriously reworked it 2 times, and now its structure is made “for C grade”. If I had the opportunity to return to the past, I would say to myself: “THINK ARCHITECTURE !!!”. Nevertheless, one of the advantages is fast loading and very good performance.

This part of the program was for me the most interesting, because everything that you do can be immediately viewed, felt, and I received a lot of positive emotions when the idea appeared on the screen. For example, the sky in games is a small cube around the camera, filled with the sky texture, which is drawn on the screen first. All other objects of the world are superimposed later, overwriting the sky, and it "appears through" in places where there were no objects. Since the cube is always drawn around the camera, it creates the feeling that the sky moves with it. And yet, in fact, the camera is not moving - it is always at (0, 0, 0); This is all other objects change their position relative to the camera.

image
* Picture taken from here.

Physics engine


Since the main goal was to gain knowledge, I also decided to do the physics engine myself. (And also because I was tired of reading manuals and understanding how to use other people's free engines in my application).

In it, I took into account the experience gained in writing the graphics engine, and from the very beginning I tried to think about the architecture. Compared to the graphics here, there was naaaaaamnogo more math, albeit school. In addition, I tried to write the code as optimally as possible so that no brakes occurred. When I started testing physics, I was very upset when, when breaking a pyramid, everything was terribly lagging, because I licked the code almost perfectly. I could not imagine how you can still increase productivity. To my luck, it turned out that the in-game audio player slows down, trying to lose a large number of collisions at the same time. I fixed the problem by playing a single collision sound of multiple balls instead of playing the collision sound of two balls many times.

image

Textures


When the game was already working stably, and the moment of release was nearing, I remembered that I used textures from other people's games. I could not find the texture of acceptable quality in the free access, and decided to paint them yourself (in Paint.net ). Why? Too experience! But since my fantasy is tight, I painted my textures similar to those I used at the beginning. Most of the time took the main icon. Seriously, she had to invent it herself; a few days doing it and interviewing friends, as they like it. Really cool?

image

Release


Much of what was originally planned had to be postponed. Each additional feature pulled a whole mountain of work behind it, and it is not known whether I would have finished this game at all. I chose the main set of functionality that entered the final version. I will not hide the fact that I am writing this article in the hope that you download the game and leave a review: good or bad - it does not matter. This will be my appreciation I deserve. So, if a miracle happens and there are enough downloads, I will continue to work and make an online mode with chat and spikes.



Thanks for attention!

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


All Articles