How I wrote a game in 3 years

The other day I finished creating my little game and I want to describe to you the path that I followed. I want to immediately make a reservation 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: made a map with a bus stop from my city, tried to make a school. Cool to shoot at home school? This gave me a basic understanding of what the virtual world consists of.

A little later, I started going through OpenGL tutorials on Android. I was happy as a child when the first triangle appeared on the phone screen for the first time!

image
* The picture is taken from here.

Then we got a cube with a superimposed stone texture and thoughts about creating our simplest game. Porting the Portal game to Android seemed like an achievable task for a beginner. I greatly underestimated the upcoming workload. 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 in Futurama without gravity, I decided to quickly implement it (until the others had time). It turned out that I still underestimated the amount of work. And, by the way, they managed to make billiards without gravity before me.

image
* Screenshot from Futurama, season 7, episode 5

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

Graphics engine


As I added functionality to the graphic “engine” borrowed from the tutorials, it became less flexible and more fragile. At this point, I seriously remade it 2 times, and now its structure is made “in the middle”. If I had the opportunity to return to the past, I would say to myself: "THINK ARCHITECTURE !!!". Nevertheless, of the pluses are fast loading and very good performance.

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

image
* The picture is 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'm tired of reading manuals and figuring out 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 through the architecture. Compared to graphics, there was a lot more mathematics, albeit school. In addition, I tried to write the code as optimal as possible so that there were no brakes. When I started to test physics, I was very upset when everything was terribly lagging when breaking the pyramid - after all, I licked the code almost perfectly. I could not imagine how else to increase productivity. Fortunately, it turned out that the in-game audio player is slowing down, trying to play a large number of collisions at the same time. I fixed the problem by playing one collision sound of many balls instead of playing the collision sound of two balls many times.

image

Textures


When the game was already working stably, and the release moment was nearing, I remembered that I used textures from other people's games. I could not find textures of acceptable quality in free access, and decided to draw them myself (in Paint.net ). What? Too experience! But since my imagination is tight, I painted my textures similar to the ones I used in the beginning. The main icon took the most time. Seriously, I had to invent it myself; he did it for several days and questioned friends how they liked her. Really cool?

image

Release date


Much of what was originally planned had to be postponed. Each additional feature dragged along a mountain of work, and it is not known whether I would finish this game at all. I chose the basic set of functionality that went into the final version. I will not hide the fact that I am writing this article in the hope that you will download the game and leave a review: good or bad - it does not matter. This will be my mark that 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 goodies.



Thanks for attention!

Also popular now: