📜 ⬆️ ⬇️

Game development: 4 years and two new people

“Work is paid for by experience, but it is not taxable” Hank Hill

Hello, Habr! In this article, we would like to tell the story of the creation of the mobile game “Robot Alan”, motivated by the simple desire to “Make the game!”, Which resulted in more than three years of alterations, throwing and undertaking anew. We will try to show our whole way and how my friend and I developed and changed under the influence of this small toy. Caution! A lot of scary pictures from the past, a lot of traffic !


In short about us, my name is Alexander, and my friend Yang. At that time (2011) I was mainly engaged in automating some bureaucracy in Java and system administration of Solaris systems, and accordingly in the future game I was responsible for the development. Yang is a more creative person with a technical education who risked taking the path of an artist (we will consider this a collective concept of a person working with graphics in all its manifestations), and in our mini-project he was responsible for all images, sounds, animations and other beautiful things. It is worth noting that, as I had no experience in the game dev-e, Yang didn’t have any “professional” experience in his business, or almost didn’t (in hungry student times, we did a bit of website creation, but whoever hunted ?!). Nevertheless, I wanted to make the game completely on my own, without attracting other people.
')
In the end, it happened.

The desire to create a game came long before the concrete idea of ​​game mechanics. I tried 3-4 ideas until the same one came to mind. The game was inspired by schoolchildren from 8th to 9th grade, where we worked in the “Robotland” environment at computer science lessons (this is such a set of software for teaching children). In this environment, several performers were represented, one of which was the incomparable “Cucaracha”. “Cucaracha” is a cockroach on a two-dimensional field, able to carry out simple commands “FORWARD, BACK, LEFT, RIGHT, REPEAT, IF”, with the help of which he moved the letters. Actually, with the help of such commands it was necessary to force the cockroach to make certain words. A sort of variation on the Turing machine.



Influenced by nostalgia, I wanted to do something similar in the form of a mobile toy.

Being under the emotional impression of the idea of ​​the prototype of the game was implemented over half a day off. I wrote in Java using the libGDX framework (arguing for myself the choice of language - they say, minecraft wrote it and nothing ...

It looked something like this



The essence of the game is simple. The player must collect stars in the level. The level consists of multi-colored blocks. In order to control the character you need to create commands of the form:

IF <TOP, BOTTOM, LEFT, RIGHT> <RED, GREEN> THAT MOVE <LEFT, RIGHT, DOWN, UP>

After the gameplay was tested and we really liked it (well, I wouldn’t like it, there was so much endorphins in the blood that I would pray for crosses with zeros) it was necessary to invent a character and his surroundings. Curiosity was just about to go to Mars, and we decided - well, that's a great topic: the rover! And just release the game to a significant event! (it was the first mistake in terms - somewhere for 3 years).

As part of the creation of the character “moonwalker”, a prototype was drawn, later called “vacuum cleaner”: not only did it look like a modern “smart” vacuum cleaner, but also as a demonstration of future animation Yang prepared a video where the “vacuum cleaner” was traveling against all laws of physics (note the direction of movement of the tracks and the surface). For comparison, the very first and final versions:



Of course, now it all looks very funny, but then it seemed that you need to remove only a few rough edges.

In the meantime, the development of the game continued, and at that time, Android smartphones, by the way, we were not the owners of the game, as a target platform. But the ability of libGDX to develop a standard desktop application, and then just build it for Android, was very encouraging, and the device was thought to be found when needed. The naivety of our perception of being became clear only when I tried to assemble a toy in order to show a friend on his smartphone. Instead of 2.5k fps on the desktop, I saw 17 fps on one of the latest smartphones of the time. This was due, of course, to the lack of intelligible experience in game dev. The game had a lot of places that could be optimized (at least not to draw the whole game, but only what falls in the viewport). Optimization work started and I managed to achieve 60 fps on the same smartphone, but it became clear that it was very stupid to further develop the game without a device.

As it turned out, the universe simply notify your desire. On the new year, I was contacted by representatives of one company, for which we did research and development that year, and reported that they give souvenirs to all participants as an additional “gratitude”. I went to the hotel to their representative, who for this purpose arrived in St. Petersburg and, to my surprise, turned out to be a souvenir tablet Samsung GT-P1000. And now for the new year and the January holidays I had a brand new Android device.

As soon as I put our toy on it, I immediately realized that with such a screen (as much as 7 inches =)) the toy can look much cooler! Taking possession of my mind, this thought led to an almost complete alteration of the game (expansion of the playing field, design and mechanics of the game). It should be noted that Yang perceived my constant proposals to rewrite the game with enthusiasm, either because I vividly described how much cooler this would be, or he understood that what is now, in all senses, is not what I want to show to others.

As a result, that alteration for unknown reasons overgrown with various add. capabilities (like O_o lasers) and looked like this:



Since that time, the game is already pretty fed up and there was almost no motivation to engage in it. Well, if you managed at least a couple of days a month to pick something up in it. The main motivator then was the renewing art from Yang.



Needed a change, a breath of fresh air. This change was the purchase of my first iPad by me (2-ka). The device was much more productive than Samsung, and of course I wanted to run our game on it. The creators of libGDX from the very beginning promised in the future to make the possibility of compiling java games on iOS (in transit through Mono), but then it wasn’t yet (as far as I know now you can). There is no possibility, but I really want to - I started looking towards Objective-C. I looked at it for three days, with reference to cocos2d, made a small, very basic prototype and realized that this did not bring me a drop of pleasure. I did not like the language and the desire to study it did not arise. Partly because I understood that except as a hobby, and more specifically for this particular game, I hardly need it anymore.

Then I stumbled across CocoonJS. This is a commercial product that allows you to pack an HTML / JS game developed on Canvas into an iOS application with performance “close” to native. A kind of analogue of PhoneGap, but for graphics. There is also an open source version of a similar tool called “Ejecta”, but I decided that once CocoonJS is a commercial product, the quality will probably be better, especially since it was a bit of a beta and was free (by the way, it still remains guys are not in a hurry too).

This event began the time of rewriting the game in JavaScript. I was familiar with JavaScript, but not on “you”, rather from the “jQuery series - that's all I need”. I wrote an almost complete analog of the java version in 3 days (as it turned out, having materials, images and sprites, knowing what needs to be implemented - the matter moves very quickly). During the development process, I was increasingly interested in the JavaScript language. After the world of C and Java, all these features of it like: the special behavior of this, prototypes, closures, (NaN! == NaN) == true - were perceived, at first, as a kind of puzzle, which made the process of studying it very interesting. As a framework for the game, I chose CAAT JS. Now, as far as I can judge, this is not the most famous and popular framework, but then it was promoted by CocoonJS guys (as I understand it, they are somehow related to its development). The framework is very simple and solved all the problems we need (good in our game, there is nothing supernatural).

After rewriting the game in JavaScript, after a couple of days I came across one ES6 “transpiler” in ES5 (I don’t remember which, it seems like a google traceur) and realized that I really want to work with the generators and rewrite all the asynchronous moments in the game with them (and they are all there). Fortunately, at that time I had a lot of work, and there was not enough free time for the next alterations, and I somehow got cold with this idea, reassuring myself, but then we will soon release the game.

But fate decided otherwise. This time the blow came from Yana. Revising the cartoon “Wall And”, Jan really liked the contrast between technology and nature.



Having discussed, we firmly decided that we need to add this contrast to our game, which led to the appearance of various green menu elements:



In addition to adding greenery, Jan decided to try his hand at 3D modeling. So the prototype of our character, later called the “chair”, turned out:



The main point here is that Yang began to engage in 3D, which later became very exciting for him and led to a number of new options for our character:



In addition to changing the purely graphic component of the game, this also changed the direction of our thinking. If earlier we tried to diversify the game as much as possible, to add new entities (lasers, portals, and many, many garbage), then now we are seized with complete minimalism. We cut out almost all the elements that seemed at least slightly contrived, which made the game less diverse, but much more “complete”. The apogee of minimalism was the rejection of the text in the game. The only text that can be found is our names and the old school phrase “GAME OVER”. It is worth noting that such zealous minimalism made the game much less understandable for a person who was not yet familiar with it, but this way we felt some kind of inner satisfaction ...

Those friends and acquaintances to whom we showed the game treated her differently. In general, everyone liked it, but for most, especially non-technical people, it was extremely incomprehensible. Of course, this brought a share of despondency, but those who still liked her changed the situation. As a result, we added some of the first training levels. The final version of the game is still not ideal, which is somewhere in our imagination, but this is something that is not a shame to show other people.

The final version of the game looks like this:



Summary

What can be said in the end. We altered the game very often under the pretext of various reasons: new technologies, new colors, new ideas. If it were not for these modifications, the game would have been simply buried before birth. As for us, Jan’s progress, it seems to me, is especially visible in the contrast of his first and final works. Since then, Jan has already seriously engaged in 3D-animation and is now working in one of St. Petersburg studios as an animator. I migrated from the backend to the frontend and am working as a lead developer, now I program mainly in JavaScript.

The game brought us not so much experience as pleasant memories and knowledge about new directions for personal development.

Of course, there is nothing masterpiece in the game, its main value, apparently, will remain only between us, but it was great and very nice if there are people who will like it for its intended purpose.

Thanks for attention!

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


All Articles