📜 ⬆️ ⬇️

How WarCraft 3 helped me in programming

Good day, dear readers. In this article I would like to share the story of how the well-known computer game WarCraft 3 helped me in learning programming. I just want to say that in no case do I urge anyone to repeat my path and start learning programming from this game. It just so happened that after I became addicted to creating custom scripts for this game, further programming training (at school and university) was given to me with incredible ease.

Everyone who is interested, welcome under cat.

Before you start


Computers have been interesting to me since childhood. Unfortunately, I got my own rather late, and all I had before was an old computer with a BASIC in the local radio station where I was recorded, as well as hiking with friends to computer cafes where we played the already mentioned WarCraft 3 Finally, the dream came true - in the eighth grade I had a computer. Of course, the first thing I did was immediately run to a friend for a disk with the third WarCraft. The installation was followed by several days of campaigns, battles for orcs, an alliance, night elves and undead. I also tried a lot of cards that the same friend recorded on the same disc. Even then, I was surprised how much you can create on the engine of this wonderful game. Soon I was bored with the battle, and I, like a curious eighth-grader, went rummaging through folders on my hard drive.

When I opened the folder with WarCraft 3, my attention was attracted by the icon of the file called "World Editor.exe". With a sinking heart, I double-clicked it. The launch of this program has changed my future.
')

Introduction to the interface


image

Running the program, I saw it. Buttons, panels, drop-down lists and an area in which you can change the terrain, put units for different players, trees, houses and other decorations. Of course, I started to play with all this, but when I launched my creation, the standard battle began. I immediately wanted to start managing events in the game, changing the behavior of the warriors, creating my own non-standard heroes with a non-standard set of abilities. Exploring the World Editor further, I came across a script editor, which turned out to be very easy to understand.

image

Triggers with GUI


The map script consists of the so-called. Triggers, each of which has three parts - events, conditions and actions. Items can be added to each part by clicking the appropriate button. It is not difficult to guess that at the specified event in the game and the fulfillment of the specified conditions, the specified actions will be performed. Using a fairly convenient GUI, you can customize these same events, conditions and actions as needed by the creator of the map. Since the game was very interesting to me, I again began to play with all this, unknowingly learning the concepts of cycles, branching, etc. Then I needed to somehow keep the units between the triggers so that at certain events the actions took place with the units I needed . I found a variable editor.

image

Here I found that you can save not only units, but almost anything - numbers, lines, abilities, events, special effects, players, buffs, points on the map, and much more. You can store the necessary objects in the arrays - I immediately thought that it is very convenient to store the hero for each player in the array, because the player’s number will correspond to the index of his hero in the array. Well, again, invisibly, I learned what a variable is and its type, what an array is, how and when it can be used.

Opening the object editor, I found a tool to modify and create new warriors, abilities, buffs, scenery and objects. Of course, the assignment of most of the object’s characteristics was incomprehensible to me, especially since the translation of some of them from English leaves much to be desired.

What happened next


Gaining enthusiasm, I immediately wanted to do something of my own. For several days I made a map a la "three corridors". Almost all the characters there were standard, as I was more interested in the scripting part - I made the popular “firefly hero” system at that time, the invulnerability of towers, until a lower level tower was destroyed (those who played the popular Dota Allstars card would understand ), the increase in creeps over the course of the game, as well as the random appearance of bonuses in the form of runes or objects in random places. Since there was no Internet, one had to entertain oneself by attaching enemy heroes on all lines and occasionally forcing them to cast spells. This, of course, not AI, but added at least some interest)

How it helped me


The following year, we started learning programming at school. The language to learn was Pascal. The lessons with the study of variables, conditions, cycles and arrays seemed boring to me - I already knew all that, I could only remember the syntax and the names of the built-in functions. And programming units, items and spells was much more interesting than looking at a boring black and white console. All tasks were done with ease, in a couple of minutes, I did them for half of the class. The teacher, noticing this, offered more difficult tasks, which I also easily coped with. As a result, I went to defend the honor of the school at the city Olympiad, where I won first place. Then I went to the Republican, where I occupied, if my memory serves me, the 15th place out of 200. Not a bad result, especially considering that I went there without any preparation at all.

That's not all


Soon I got the internet. I got access to a huge number of resources dedicated to creating maps for WarCraft 3. I tried to make simple 3D models and insert them into the map, draw icons for spells and objects, open other unprotected maps and watch how everything is implemented there.

Making scripts by clicking on buttons became boring, I wanted to do something more “programmer”, and I learned that these GUI forms are just a shell for the JASS scripting language, which opens up more opportunities for the map developer. Creating various systems, spells, special effects - it all turned into a fairy tale, and I became even more interested in programming. But I would like to tell about JASS in a separate article.

You can talk a lot about creating custom maps for WarCraft 3. It includes many aspects from creating a beautiful landscape, drawing icons and creating models to writing systems and protecting the finished map from discovery, which allows people who are interested in this to gain experience in various areas: 3D modeling and animation, landscape design (funny sounds), programming, drawing, testing (yes, maps, after all, also need to be tested).

Now I am a fourth year student at university and I enjoy programming. At the university I touched Delphi and Visual Basic, then Java, now I touch C. All the PLs I studied were given to me with ease. Thank you, WarCraft 3.

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


All Articles