Shel 2006y year. These were good student years, the heyday of the
DotA Allstars game. In those days, everyone played dota through the official Blizzard server, Battle.net. The industry was very scarce - there were no normal broadcasts, many of the Internet was still on adsl, and of the events there was little coverage of tournaments with prizes of up to $ 5000. Then the initiative players gathered in groups and organized into clans. It was then that my friend called me and offered to organize the first Dota League in the CIS. It was a real challenge for me, and he was accepted ...
Stealthbot
In those days, I was actively messing around with chat bots who could sit on a channel in Battle.net, pretending to be a regular Warcraft player. Then the most common and functional bot was - StealthBot. He had built-in functions like autokick unnecessary people from the channel (safelist), he could talk how much time now and pretend to be a “smart bot”, responding to pre-wired answers to commands.
And there was a great thing in it - the author of this bot provided the ability to extend this bot through a plain text file script.txt, in which you could write your own scripts in Visual Basic Script. From my school years I loved programming, and Warcraft 3 itself was my passion. I knew this game almost by heart, I knew all the sounds of all units, knew all the resources, textures and models of this game, riveted the cards in the World Editor and proudly called myself a mapmaker.
Speaking of mapmakers and dotaWhen the first full-fledged Dota Allstars 5.84c came out, the company of map makers took this game very negatively and denounced it as unsuitable. All more or less normal cartodels criticized this “map” so much: it loads for a very long time, there are a lot of heroes with “ordinary” abilities, a very flat script, there is no plot, the towers are too strong, the scenery is arranged like horrible, etc.
')
What a sin to conceal, I myself thought so and criticized this card, I could not look at it.
But that all changed in 2005m. Then version 6.01 was released, which was very cool optimized and redone. This card was loaded even faster than any other card (even more simple). It was a real breakthrough! Unfortunately, many mapmakers never realized why DotA became popular, and this was not at all due to the lack of a plot. This card was balanced - you could play it with any hero and win!
Life in Battle.Net
Chat in Battle.net was pretty poor:
- It was impossible to open a separate private chat in it, it is impossible to save correspondence in it
- When you switch to another channel, you have erased all the previous ones.
- To go to Battle.Net needed an official CD-KEY - the key to the game. If you have a pirate Warcraft - you can not go to Battle.net.
- The chat history was only on the last hundred lines, and the later ones were erased.
- On one channel could sit no more than 40 people.
- And it was impossible to copy or select text in it!
- About links or smiles, I generally keep quiet
In order to somehow diversify life in Battle.Net, I wrote bots. My first bots could remember when the last time a certain clan member was online (visited the channel). Then, through the bot, you could leave messages to a person who is currently offline (a kind of mail).
At that time, the only more or less normal dota-league was the European channel Clan DCE, where there was a simple bot who kicked everyone who was not on the white list. Getting there was not easy enough, although not difficult. But it was all wrong. There was no accounting for "bad" players - who swore badly, or the most unpleasant - was leaving the game before its completion (liver). Playing in the minority is extremely difficult, and in 90% of cases it is a loss. Over time, in DCE, the level of the game began to fall, the leavers came across in every game, and they simply did not have time to ban on the channel.
In the end, all this suggested that we should take the situation into our own hands, and open a cool DotA League that would suit everyone and solve these problems! My knowledge of botbuilding was then enough to write data into text files, read from them, and communicate with people in Battle.Net. The whole mosaic of needs and opportunities was in my head, and I said to myself: “All I have to eat, I can do it!” And rushed ...
Locks in the head
It was necessary to come up with a process of how the players will participate in the league. C zero from scratch.
Before creating the league, it was necessary to solve the first very important problem: only those players with open ports or white ip-addresses could host games in Battle.net. Such players were rare, and so that suddenly there were no situations when people were going to play, and none of them had a white ip-address, it was decided that only players who could host games could begin to recruit players for the game. Admins and moderators will have to give them a special level of access "Hoster".
The next problem was that when the players came to someone in the game, the bot could not find out which team they entered - for 1.Sentinel or for 2.Scourge.
From school years, my computer science teacher had a good idea in my mind that all programs should be as simple as possible, and I followed this example from the very beginning.
And then I decided: let Hoster start the game, telling the bot about his intention (using the .create command). The bot at this time, everyone in the chat starts every 20 seconds to report that the game is currently being set, with the name of the game:
QDL: QDL012 game is set. Places left: Sentinel: 4, Scourge: 5
The name of the game is a kind of IP address where to connect. Entering the name of the game in Battle.net, the player got into this game to Hoster, and Hoster had to pre-create the game and wait for the people.
The player could go for any free side, and when he was determined with a choice, he had to inform the bot (with a very short nickname QDL and QD.) By sending a personal message to the short team:
/ w qdl .j1 - it means he went for the first command
or
/ w qdl .j2 - for the second
As a fact of registration confirmation, the bot responded:
Success! QDL012; team1
One team of 9 characters was remembered rather quickly, moreover, the players told each other what to do. When all the slots were clogged and all the players came in, Hoster had to check the list of players who “registered” in the bot, and check if all the players match their teams. To do this, he sent the bot command:
/ w qdl .check
and he received a long message in reply, with a list of players by teams:
QDL012 {Sentinels: [1] Quad.Tims [2] Quad.5min [3] AlfaCriostat [4] y6uBaIIIe4ka [5] remi} {Scourges: [6] Piragok [7] zagalex [8] Fade.Killer [9] Ums .Acc [10] upska}
The hoster had to check the list, and if everything is okay, then tell the bot about the start:
/ w qdl .start
The game began, people played. At the end of the game, people returned to the channel and reported the result, who won:
.result 1 - First Sentinel team won
.result 2 - The Scourge second team won
.result 0 is a draw. It could have happened for a variety of reasons, usually because of the overhead.
When 51% + players voted for some decision, the bot distributed points - took away the losers, gave the winners, and recorded in the statistics for the players +1 winners and +1 losers to lose statistics.
As a way of dealing with livers, we also asked players to report livers:
.leaver username . The player lost his points, received a ban, and when exceeding a certain value he was driven out forever from the league.
Some more bot mechanicsTo make it easier for people to type the name of the bot, I registered them with very short nicknames:
QDL and QD.
What "tricks" were in the bot:
There were situations when the player entered the game and registered with the bot, and the hoster kicked it out of the game, then the player automatically went to the channel. When a player entered the channel, the bot checked whether this player was registered in any game, and if so, then automatically removed the registration from him, and the slot in the player's counter was released.
The hoster, sending the CHECK team and getting a list of players, had to check whether everyone was registered correctly. It so happened that someone kicked, and the registration did not act. And in order for the hoster not to enter long and complex nicknames like y6uBaIIIe4ka, the hoster could enter only the sequence number of the “extra” player, and the bot would remove the registration.
QDL: QDL012 {Sentinels: [1] Quad.Tims [2] Quad.5min [3] AlfaCriostat [4] y6uBaIIIe4ka [5] remi} {Scourges: [6] Piragok [7] zagalex [8] Fade.Killer [9 ] Ums.Acc [10] upska}
Hoster: / w qdl .kick 4
The bot kept a timer for each game, and the hoster had 5 minutes to start the game, otherwise the game was canceled, the hoster received a penalty, and the other hoster could announce a new game set. But this time could be extended by answering the bot to the warnings with the .continue command.
In fact, the bot sent more than one long message, because of which the bot often threw out for spam
QDL012 {Sentinels: [1] Quad.Tims [2] Quad.5min [3] AlfaCriostat [4] y6uBaIIIe4ka [5] remi} {Scourges: [6] Piragok [7] zagalex [8] Fade.Killer [9] Ums .Acc [10] upska}
And broke it in half into two. The first message sent the first bot, and the second - the second.
QDL: QDL012 {Sentinels: [1] Quad.Tims [2] Quad.5min [3] AlfaCriostat [4] y6uBaIIIe4ka [5] remi}
QD .: {Scourges: [6] Piragok [7] zagalex [8] Fade.Killer [9] Ums.Acc [10] upska}
This unloaded bots and the batl. No more did not throw them.
Awakening power
The code was written in about 2 months. It was a real break in the brain and a transformation of thinking, I have never written so much code! I have never done a full-fledged project! I am ashamed to admit it (but now I’m not ashamed, because I know that everyone started from something): all the code was written in the usual notepad.exe Windows, and plain text files were used as data storage! Thousands of files! No databases, no queries! Only hardcore).
They decided to start in 2 weeks: in November 2006. For 2 weeks they posted information on all Dota-forums where they could, and my fellow clan members prepared the rules of the game and scoring.
It remains the last week and ... my friend tells me that I was hacked, some dudes launched their DotA League! At first, I didn’t believe that it was possible that someone knew me at all, much less able to understand my code. I went to explore for them on the channel, and it turned out that they were indeed our compatriots, but who launched someone else’s dotabot, which was a copy of IRC, which serves the most powerful and most closed dota league IHCS (about which no one among mere mortals did not know us).
Having exhaled with relief that no one had cracked me, and the confidence that we still had the coolest bot, we did not change the plans and started as expected.
Launch
And here we are! On the first day of November, we had about 10 games. The people sluggishly-fluid played out and pulled their acquaintances. We all happily added to the white lists and allowed them to play. In order to increase the flow of players, we immediately issued entire white lists in the name of the Clan, for example, “FADE” - if a player entered the channel and it was in this clan, then it automatically got into the white list.
And in order to increase competition, in addition to the list of the best players, we kept a list of the best clans, which took into account the points of all the participants in the clan.
In a week, we have already 20 people on the channel who can start the game.
Since Battle.Net was limited to a maximum of 40 people on the channel, the bot eventually learned to kick inactive users from the channel when the channel was filled by 90% so that others could easily enter.
After 2 weeks, it was possible at any time to go to the league and within 5 minutes to find normal players who did not play.
Effect glasses
Do you know what we did not expect? And the fact that people who have never experienced a virtual point counter (points), victories and defeats, that they began to give all the best in games 100%! They understood that if they played poorly, they would lose. So, they will lose winrate, points and decrease in the rating of players. These simple numbers that the bot says in the chat meant a lot to the players! Being the top 50 player in 1000 is something that meant something!
As a result - in our forum, heated debates began to be fought, who is right and who is to blame. We found that our rules were far from perfect and had to be constantly improved afterwards - to forbid collecting certain too strong items (the necromicon was forbidden, and some heroes to collect aphanim and refresher), to paint the truth in certain disputable situations, etc. Very quickly, we recruited moderator assistants who could sort out disputes every day, change the results of the game and punish the players.
The League lived the full life of the community we united! We created a dota-league, and the people play on it, use our crafts! It was a real youthful happiness of self-realization!
Prospects and monetization
Now it's pretty funny to remember this, but the project did not provide for any monetization or commerce! Then we, as pioneers, worked simply for the glory of the internet :). Neither I, nor the clan managers, nor the recruited moderators received a penny. Yes, and times were such that from virtual money were only WebMoney, which few were able to use.
Over time, we became friends with the guys who made us a league ahead, and began to be friends. It turned out that the organizers personally know all the best Doters, and they expected to create a closed league, purely for the most top players, and they promised us to throw off all the others who did not suit them. We are additional advertising, they have the opportunity to politely "refuse" to unsuitable players.
We agreed, but in fact it turned out quite differently from what was intended: since they had quite a few players, in order to get ready to play, the players had to wait a long time until 10 top doters were gathered. This worked only during the peak hours - from 18 to 22h, and in other hours it was necessary to wait for 20-30 minutes, and in order not to wait, they just came to us. As a result, everyone plays with us - both the best doters and the “not the best.” Sometimes this led to scandals, intrigues and investigations, for example, in one summer (the most inactive season) they lured almost all of our administrators and moderators to themselves. There was no one to work, I had to re-type the team.
Everything seemed to be going well, but I felt that something was not right. It seems that I did not know how to improve the league, because of its capabilities. Over time, the league revealed a lot of problems
Problems again
1 year has passed:
-
Battle.Net lagged . Games hosted via Battle.net caused delays of at least 80ms, while the LAN delay was 40ms (this is the standard game delay if the game is hosted through the official Warcraft client. The host bot came out much later: GhostBot, which radically reduced ping)
-
There were cheaters . Alas, for each new patch from Blizzard, there was a new version of MapHacka (to see the entire map and characters out of sight), or DropHack (the hoster could throw out any player (who did not like it, or swung the hero very strongly) right in the middle of the game , and that would give a ban for liberism). It was difficult for moderators to consider such cases, it is very difficult to determine the cheater by replay.
-
The method of recruitment into the game was not perfect. Abusy happened very often on the part of the Hosters - they recruited good players to their team, and left the poorest among the opponents. It turned out that if you are a hoster, then you can win victories with a 90% probability. A wave of indignation grew.
-
Chat was poor , did not allow bots too much to write private messages or chat. Then I had to run 2 bots, and send some messages through the second one. Let me remind you that the bots worked through ordinary text files - one for each player, and for each game played.
-
HDD slowed down - then I didn’t even know that the HDD is slow when it needs to determine the best player from 1000 players, open 1000 files and pull out 3 best ones. We had to solve this problem ...
Fate
Do you believe in fate? And I believe. Surely convinced her. Here is my first example:
Remember, I wrote above about the DCE league, which was pretty simple? So, I was nevertheless added to the white list by my German friend, whom I met in one of the games. He somehow found out that I was writing bots, and asked them to upgrade their bot. This guy knew PHP and MySQL, but he couldn’t write bots (and didn’t want to). He asked the bot to work with the database through the MySQL ODBC client, and even found code examples on the VBS. We spent a month with him, he taught me SQL, explained what databases are and how they contain data. He also showed me the magic unixtime, with which it is very easy to add days, minutes or seconds to dates, especially when it was necessary to give a ban for a time, for example, an hour and a half.
I made him the bot he wanted, which had a direct connection with the database from the site, and he was able to manage the list of players directly from the forum.
I said goodbye and armed myself with a new technology, and in a couple of weeks I rewrote my bot from scratch to a “new technology” - MySQL. It was a real breakthrough for me. It was possible to get the best player in one second, count points for the entire clan, or display statistics for the whole game! The bot began to fly, and the players got a new bot with a new set of game mechanics, auto-balancing teams on points.
So what about fate? Now I understand that I then wandered into a dead end, and did not know where to develop further. And if it were not for this German (and not that casual acquaintance with him during the game), he would not have taught me MySQL, and I myself would hardly have suddenly googled "how to work with mysql".
I can’t call it an ordinary coincidence, which led to an acquaintance 2 years ago, and led to a jolt towards knowledge of databases and an understanding that even from this tiny StealthBot you can cling to big and cool databases!
Development
I found an interesting AutoIt language with which I wrote my first league client program. He built in it a detector of the most common cheats, and said that the players who will play with him will receive 50% more points. Those who wanted were found, and this was the first interesting experience of client-server programming.
Considering all the disadvantages that spoiled a good impression of the game, I began to look for alternative clients and platforms on which to play.
Among the first subjects was Hamachi. Alas, it did not work out with him - it is too difficult to configure, admin rights are required (a virtual network card is installed), but the quality of the connection was good, the ping was lower than in Battle.Net.
The next subject was Battle Lan (Lancraft), a small program that broadcast scheduling udp packets to the addresses you entered, and so if someone with a white IP created the game directly on the local network, then other players could see it. 'om I built and automated it in my client, and some players were able to play with each other. Alas, the solution turned out to be unstable - some of the players saw the hosting provider, and the other part did not.

Among the latter, a certain Good Game Client (GGC, in the future - Garena) came into view. It was very easy to play LAN games like Counter Strike 1.6, or Warcraft 3 (DotA was added much later). Ping is very pleased! The crown chip was the ability to establish direct udp-tunnels between the players behind the NAT, so that they could play with each other, even without a white ip, moreover, they were ardent fans of the usual Warcraft 3 and they had built-in anti-cheat updates. To play here did not require the official key of Warcraft III. In general, everything is cool, but no bots were written under it. Well, I could be the first!
Using my knowledge of AutoIt, I was able to get Handle from the chat window, and get current text using normal reading. Likewise, I received a handle to the input fields of the message, could enter text, and send a virtual click on the “Send” button. It remains only to receive a list of users on the channel, and this also turned out. Technically, I was ready to launch a bot there. But there were no players on this platform. Nobody played there, everyone got used to Battle.Net.
It was 2008 year, it seems not much time has passed, but then many had paid traffic for each megabyte! And it was unpleasant - playing a regular Battle.Net game ate about 1 MB, and playing through the GGC, the game already cost 2 MB (due to data encapsulation, walking in a virtual communication tunnel), which was critical for some players to play DotA It became more expensive!
I saw the prospects in this platform, adapted the bot for it, launched it there, appointed several local players as admins to monitor, and announced a transition period of 1 month. People reluctantly, and until the last day played in Battle.net. After disabling the bot in battle.net, the people announced a demarche, and did not pull up on the GGC; instead, the people began to play on that neighboring “closed league” from our compatriots.
I believed in success, and within a month we began to actively pursue games on the new platform. A year later, there was no one in Battle.Net, GGC was now called
Garena , and we had 2 times more players than before in Battle.Net.
To be continued…
update: How I opened the DotA League. Part 2