📜 ⬆️ ⬇️

Tower defense do it yourself

Good day!

I would like to tell you about my personal feelings about the game after a year of working on my own project.

As long as I didn’t touch the game engines for the first time, I thought it was fun to make games. A team of talented people gathers and in some definite time they make a game without any problems, write its code and fill the environment with beautiful things. Yeah ... from some side this is all true, but I did not expect that in reality everything is much more complicated.
')
Let me remind you once again, this article is just a feeling from my acquaintance with the igrostroi, and a story about my own little experience.

image

So here. It all started a long time ago - in March 2012. It was then that I first became acquainted with the game engine, or rather, with what can be done there. And as it turned out, you can do everything! To do this, “only” requires some kind of knowledge of a programming language (JavaScript or C #). And this is where I got stuck - before that I had never programmed in my life (Warcraft III editor with its triggers and Thinking Particles do not count - this is a completely different level), even at school there were never programming lessons. Although it was, it seems, Pascal or something similar, but it was so long ago and not true that all knowledge from those times has evaporated without a trace. I had to go online for educational articles and video tutorials. The first lesson I learned every 5 minutes was like watching the official script-writing help, and this rule helped me very, very much later. Still a complete shock for me was the need to write a few lines of the script for an absolutely elementary thing - getting out of the game through Esc.

As a result, as it turned out, programming is not so difficult. The main thing is to understand the logic of the program and programming language (by the way, my choice fell on C #. It seemed to me more understandable and flexible). My first crafts were not very unique - to run somewhere, inspect something, press somewhere. Over and over again, I felt better and better at writing scripts, and at some point everything became so “native” that I almost without hesitation and errors wrote one script after another. And here I am set on fire to the idea of ​​doing something big! To begin with, it is rather small, but with rich functionality - this is how the project was born, on which I spent a month and a half, four weeks of which I was busy writing scripts! That was really cool - but I understood that this was not enough. Yes, I was able to realize the change of day and night, the switching of cameras, many different modes of the "game" and some other chips. But all the functionality was tied only to the use of various components in the editor, and only. It was then that the idea of ​​creating a full-fledged game was born.

The idea (type) of the game was determined instantly - it would be a Tower Defense type game. Yes, of course, not very original, but there are practically no real and full-fledged TD games (and even in 3D!). The first weeks of development went into creating the basic mechanics of the game, which subsequently changed more than once.

Still, scripts are the engine of the game, and without them, the beautiful models will remain simple models, and the enraged peasants will remain standing at the point of spawn (and even without a script they won't even spawn) in a silly pose.

image

Having figured in my mind what opportunities I would need at the tower, I began to write scripts. First, two scripts were written - the first allowed the mob (the enemy) to have some specific health and blush as it diminished, and the second was responsible for the shots at the tower. Everything would be fine, but it really looked very silly how the tower deals damage to the mob, but the shell has not reached it yet. I had to rule ... and later not just return to the attack script to upgrade it. But what kind of TD without the ability to install your own tower? Another script, and we can put the tower in the place indicated by the mouse. After a couple of days, the game took the form of a screenshot above, and it was time to take up a more detailed study of the game.

And the first thing on the task list was to force the mobs to follow a predetermined path. I have never come across this before, and I had to spend this task with half a day before I remembered Pathfinding. Now that game has played with new colors! With my eyes burning with happiness, I watched as my cubes ran along the new map, more precisely along the track of the new map! But then the first shoals with a turret appeared - she was simply not able to hit a far-running mob, and she also took only the closest target to herself. I had to change the scripts ... enter the second array and make a selection of the most distant, but at the same time within the range of the tower, targets. Having rejoiced at the correct work of the script, we had to return to the problem, when the towers simply did not fall on too distant targets. This is where school geometry came in handy :) Yes, now one less universal question - mathematics with geometry has found its place in life. Having fiddled with sines, cosines, several variables and typing the tick "shoot for preemption", the towers began to successfully hit targets, no matter where they are! And for this it did not take any “car navigation” - the shells flew in a straight line to the target and hit it! At this point, the game has acquired a rather beautiful appearance and it was finally possible to play, although only 5 minutes.

image

But ... something is missing. It is not enough. The game lacked depth - the monotonous shooting of mobs was not very interested for the players. Here the first ideas of a global game began to appear ...

The first thing I decided on was to tie the game to the social network. This gave me the ability to "authorize" the user to store his records and any other information. After this, the thoughts went in a huge stream, to grasp which was sometimes very difficult.

The result of reflection was that the player will have his own settlement, the development of which he will be engaged in all his free time from the game. Also, there will be three professions, one for each type of resource (tree - forester, stone - mason, magic - magician). The towers can already be bought not only for gold, but also for resources - to choose from.

Until the middle of winter 2013, I tried to make a working game with all the bells and whistles that I invented. Even announced a closed beta test, which was signed by 20 people. The development went on as usual, I had to learn how to work with MySQL + PHP. It was a long time, it was difficult. VK.API became one more stone on the way. Oh, how much time was spent on understanding the principles of his work ... let me remind you, at that time I was engaged in programming for just less than a year, and there was still not much experience to understand what was written in the certificate. However, albeit with a delay, the game entered the PTA stage, and people were able to play it for the first time.

Obviously, the first pancake came out lumpy. A bunch of bugs, unobvious (but for me, they were obvious, because I did all this) opportunities, lack of training and a clear understanding of what is happening, made me nervous - the players were not happy, although they liked the game itself. The development went on as usual, testers report on the bugs found, some of the bugs were promptly corrected, others were put in a “queue”. At that time, I first felt that I was a developer — without testers, there was some dissatisfaction with what I was doing.

image

But then it only became more fun. OBT announcement and blind vision of the "completeness" of the game. An emergency pace of work on a project, sometimes I went to bed only at 3-4 o'clock in the morning (I was playing the game in my spare time). But nevertheless, many important features of the project were finalized - editing the village, building construction, the market, and much more. Added 4 game levels to the game, now at least there was something to play with.

image

On my birthday, I decided to open access to the game to everyone and look at the reviews. At that moment, about 70% of the core of the game was “ready”, and it was really possible to allow people to test.

The result was quite funny again - everyone had the same bug related to my decision to change one of the models a little without checking the result. In the end, when everyone started the game, they watched a warehouse in the village floating in the air.

In two days, 330 people played the game, and according to a survey, the average score was 7.82. I do not know whether this is good or bad, but I think that you can make a discount on the incompleteness of the game and ...

The concept is not dramatic, but has changed. On the basis of the testing, the weaknesses of the project were identified. And one of the most obvious is the absence of “avtive” gameplay. Players just came into the game, started the level and set up wherever possible, towers. Then they went away for a few minutes from the computer, and upon returning they had passed the passed level and reward. It was necessary to change something ...
Again, thinking, thinking about the situation. Also, many complained about the wretchedness of the interface (I admit, it really looked miserable), and it was necessary to take urgent measures.

From this moment began the "real" development. Based on the accumulated experience, some important conclusions were made, and the game moved to a new stage - the alpha version. Beta here did not even smell.

Before continuing, I would like to give a couple of tips to novice developers:

1) First of all - complete thinking about the idea and concept of the game, recording all the possible features of the gameplay. It seems like this is called a design document, and I strongly recommend that you think about it before starting development. Critically recommend.

2) After drawing up a design document, think about all the possible models in the game. Make a clear plan for modeling - what you need first and foremost, and what can wait. A clear plan will always help you navigate when the development thread is lost.

3) While writing scripts, think about the “scalability” of the project. Provide places that might be useful in the future and provide for the possibility of using them outside the script where you are writing this whole thing. I hope the thought was clear.

By the way, one of the very unexpected development stages for me was the interface. This is what I did not expect - so that they can do forever. I started to redo the interface at the end of the summer, and I still do it. Of course, not as active as it could be, but the interface takes a surprisingly long time. This should also be taken into account by many novice developers, because sometimes they do not even think about it the same way as I had never thought about prescribing the Esc button to exit the game.

image

Now, I’ll probably voice another obvious thought, but when creating a multiplayer game (especially for social networks), try to do as many checks as possible on the server of those actions that the player does. During development I, of course, looked at competitors. And the huge problems with protection against hacking in some of them were present.

I also highly recommend using interpolation for smooth action. In Unity3D, almost any variables can be interpolated between each other ( Mathf.Lerp (), Vector3.Lerp (), Color.Lerp (), etc. ), which allows you to transform the interface in a few lines, or various movements in the game. Honestly, this was also one of the revelations during development.

image

Well, the last thought: game development is difficult . This is not the rainbow inventing of a “zombie apocalypse with an open world, World-PvP and caravan robbery,” it’s really hard work, especially for a loner. You need to be able to do a lot (programming, modeling, animation, possession of photoshop, knowledge of post-effects, shaders, software tools, the ability to create music, a beautiful voice for voice acting and much more) to complete the complex project alone. That is why I am now trying to attract a small amount on a domestic starter - I really miss the composer, the sound engineer and the translator. Few people are interested in browser games, and I do not think that I will be able to collect the required amount. By the way, first of all I will start the game on Facebook, and there will also be a lot of problems with it. They say that without expensive PR there will be very difficult.

Thank you for your attention, I hope you liked the article and maybe you will take note of some of my thoughts.

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


All Articles