How I opened the Dota League. Part 1


It was the year 2006. These were good student years, the heyday and development of the game DotA Allstars . In those days, everyone played DotA through the official server from Blizzard - Battle.net. The industry was very scarce - there were no normal broadcasts, many still had adsl on the Internet, and of the events, there were few tournaments with prizes 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 it was accepted ...

Stealthbot


In those days, I was actively busy with chat bots that could sit on the channel in Battle.net, pretending to be a regular player in Warcraft. Then the most common and functional bot was - StealthBot. It had built-in functions like auto-picking unnecessary people from the channel (safelist), he could talk how much time it was 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 made it possible to expand this bot through a regular text file script.txt, in which you could write your own scripts in Visual Basic Script. Since my school years I loved to do programming, and the game Warcraft 3 itself was my passion. I knew this game almost by heart, I knew all the sounds of all units, I knew all the resources, textures and models of this game, riveted maps in the World Editor and proudly called myself a mapmaker.

Speaking of mapmakers and DotA
When the first full-fledged Dota Allstars 5.84c came out, the mapmaker community took this game very negatively and branded it unfit. More or less normal card-dealers criticized this “map” like this: it takes a very long time to load, it has a bunch of heroes with “ordinary” abilities, a very flat scenario, there is no plot, the towers are too strong, the scenery is arranged in a horrible way, etc. ... It’s a

sin to hide , I myself believed and criticized this card, I could not look at it.
But everything changed in 2005. Then version 6.01 was released, which was very cool optimized and redone. This card loaded even faster than any other card (even simpler). It was a real breakthrough! Unfortunately, many mapmakers never realized why DotA became popular, and this is not at all due to the lack of a plot. This card was balanced - it was possible to play any hero in it and win!


Life in Battle.Net


Chat on Battle.net was pretty poor:

  • It was impossible to open a separate private chat in it, you can not save correspondence in it
  • When you switch to another channel, you erase the entire previous
  • To enter Battle.Net, an official CD-KEY was needed - the key to the game. If you have a pirated Warcraft - you can not go into Battle.net.
  • Chat history was only on the last hundred lines, and later erased
  • No more than 40 people could sit on one channel
  • And in it it was impossible to copy or highlight text!
  • About links or emoticons, I generally keep quiet

To at least somehow diversify life in Battle.Net, I wrote bots. My first bots could remember when the last time such and such a member of the clan was online (visited the channel). Then through the bot it was possible to leave messages for a person who is now 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 that kicked everyone who was not on the white list. Getting there was not easy, although not difficult. But it was all wrong. There was no account of the “bad” players — those who swore a lot, or the most unpleasant thing — left 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 game level began to fall, the liveries came across in every game, and they simply did not have time to ban them on the channel.

As a result, all this suggested the idea of ​​taking the situation into our own hands and opening a cool Dota League that would suit everyone and solve these problems! My knowledge in botanical engineering was then enough to write data to text files, read from them, and communicate with people in Battle.Net. The whole mosaic of needs and opportunities took shape in my head, and I said to myself: “All I need is there, I can!” and rushed ...

Castles in the head


It was necessary to come up with a process of how players will participate in the league. C scratch from scratch.

Before creating the league, it was necessary to solve the first very important problem: only those players who have open ports or have white ip-addresses could host games in Battle.net. Such players were rare, and so that suddenly there would be no situations when people were going to play, and none of them had a white IP address, it was decided that only players who can host games could start recruiting players for the game. To them administrators and moderators will have to issue a special level of access "Hoster" (Hoster).

The next problem was that when players enter someone’s game, the bot can’t find out which team they went to - for 1.Sentinel or 2.Scourge.

Since school years, my computer science teacher has thoroughly driven the idea into my head that all programs should be as simple as possible, and I followed this example from the very beginning.

And then I decided: let the Hoster begin the set of the game, informing the bot about its intention (with the .create team). At this time, the bot starts chatting to everyone in the chat every 20 seconds that a game is being set up, with the name of the game:

QDL: There is a set to the game QDL012. Remaining places: 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 with the Hoster, and the Hoster had to create the game first and wait for the people.

The player could go over any free side, and when he made a choice, he had to inform the bot (with a very short nickname QDL and QD.) By sending a personal message with a short command:

/ w qdl .j1 - that means he went for the first the team
or
/ w qdl .j2 - for the second.
As a fact of confirmation of registration, the bot answered: 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 full and all the players entered, the Hoster had to check the list of players who had “registered” in the bot and check if all the players corresponded to their teams. To do this, he sent the command to the bot:

/ w qdl .check

and he received a long message in response, with a list of players by team:
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

host had to check the list, and if everything is ok, then inform the bot about the start:

/ w qdl .start

The game started, people played. At the end of the game, people returned to the channel and reported the result of who won:

.result 1 - the first team of The Sentinel
won .result 2 - the second team of The Scourge
.result 0 won - a draw. It could have happened for a variety of reasons, usually because of the liver.

When 51% + of the players voted for some kind of decision, the bot distributed points - it took it away from the losers, gave it to the winners, and recorded in statistics for the players +1 victory for the winners and +1 defeat for the losers to keep statistics.

As a way to deal with liveries, we also asked players to report about liveries:
.leaver Username . The player lost his points, got a ban, and if he exceeded a certain value, he was expelled from the league forever.

Some more bot mechanics
To make it more convenient for people to type the name of the bot, I registered them with very short nicknames:
QDL and QD.

What “chips” were in the bot:
There were situations when a player entered the game and registered with the bot, and the hoster kicked him from the game, then the player automatically got to the channel. When a player entered the channel, the bot checked to see if this player was registered in any game, and if so, automatically deregistered it, and the slot in the players’ counter was freed.

The hoster, sending the CHECK team and receiving a list of players, had to check whether everyone had registered correctly. It so happened that someone was kicked, but the registration was not canceled. And in order for the hoster not to enter long and complex nicks like y6uBaIIIe4ka, the hoster could enter only the serial number of the "extra" player, and the bot unregistered.
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 another hoster could announce a new game set . But this time could be extended by replying to the bot with warnings with the .continue command.

In fact, the bot sent more than one long message, due to which the bot often threw out 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 he broke it in half into two. The first message was sent by the first bot, and the second by 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 the bots and the battle.net no longer threw them.

The awakening of power


The code was written in about 2 months. It was a real brain break and transformation of thinking, I have never written so much code! I have never done a full-fledged project! It’s a shame to admit it (but now I’m not ashamed, because I know that everyone started with something): all the code was written in the usual Windows notepad.exe, and plain text files were used as the data store! Thousands of files! No databases, no queries! Hardcore only).

They decided to start in 2 weeks: in November 2006. For 2 weeks, they posted information on all the Dota forums where they could, and my fellow clan members prepared the rules of the game and scoring.

There remains the last week and ... my friend tells me that they hacked me, some dudes launched their Dota League! At first I didn’t believe that it was possible that someone knew me at all, much less was able to figure out my code. I went to the channel to scout them, and it turned out that these were indeed our compatriots, but who launched a strange dota-bot, which was a copy of the IRC dot-bot, serving the most powerful and most closed Dota League IHCS (about which no ordinary mortals like didn’t know us).

Breathing out with relief that no one was hacking me, and with the confidence that we still have the coolest bot, we did not change plans and started as expected.


Launch


And so we started! On the first day of November, we had about 10 games. People languidly played out and pulled their friends. We all happily added to the white lists and allowed them to play. To increase the flow of players, we immediately issued entire white lists to the name of the Clan, for example, “FADE” - if a player entered the channel and he was a member of this clan, he would automatically be whitelisted.

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 participants in the clan.

In a week, we already have 20 people on the channel with whom you can start the game.
Since there was a limit in Battle.Net - a maximum of 40 people per channel, the bot eventually learned to kick inactive users from the channel when the channel was 90% full so that others could easily enter.

After 2 weeks, it was possible to enter the league at any time and within 5 minutes to find normal players who did not pour.

Glasses effect


Do you know what we did not expect? And the fact that people who have never seen a virtual counter of points (points), victories and defeats, that they began to give all the best in games 100%! They understood that if they played badly, they would lose. That means they will lose winrate, points and will decrease in the ranking of players. These simple numbers that the bot says in the chat meant a lot to the players! Being a top 50 player of 1000 people meant something!

As a result, heated discussions began in our forum about who is right and who is to blame. We found that our rules were far from perfect and had to be constantly improved later on - to forbid collecting certain too strong items (the necromicon was forbidden, and some heroes to collect aganim and refrigerator), to paint the correctness in certain disputed situations, etc. Very quickly, we recruited assistant moderators who could resolve disputes every day, change game results and punish players.

The league lived the full life of the community that we have united! We created the Dota League, and people play on it, use our crafts! It was a true youthful happiness of self-realization!

Prospects and Monetization


Now it’s quite funny to recall this, but the project didn’t involve any monetization or commerce at all! Then we as pioneers worked simply for the glory of the Internet :). Neither I, nor the administrators-clan members, nor the moderators recruited, received a dime. And the times were such that of the virtual money there were only WebMoney, which few were able to use.

Over time, we became friends with the guys who created the league ahead of us, and began to be friends. It turned out that the organizers personally know all the best Daters, and they hoped to create a closed league, purely for the top players, and they promised us to throw off everyone else who did not suit them. We are given additional advertising, they are given the opportunity to politely “refuse” unsuitable players.

We agreed, but in reality it didn’t work out as intended: since they had quite a few players, in order to play, the players had to wait a long time until 10 top-ranking doters gathered. This worked only at peak hours - from 18 to 22 hours, and at other hours we had to wait 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” ones. Sometimes this led to scandals, intrigues and investigation, for example, they in one summer (the most inactive season) lured almost all of our admins and moderators to themselves. There was no one to work, I had to re-enter the team.

Everything seemed to be going well, but I felt that something was wrong. It seems that I no longer knew how to improve the league, by virtue of my abilities. Over time, the league revealed quite a few problems

Problems again


1 year has passed:

- Battle.Net lagged . Games hosted via Battle.net caused delays of at least 80ms, while LANs had a delay of 40ms (this is the standard delay of a game if the game is hosted through the official Warcraft client. Much later, the host bot: GhostBot, which radically reduced ping)
- There were cheaters . Alas, for every new patch from Blizzard, there was a new version of MapHacka (to see the whole map and characters out of sight), or DropHack (the hoster could throw any player (who he didn’t like, or really shook the hero) right in the middle of the game , and that would have been given a ban for liveriness). It was difficult for moderators to consider such cases, it is very difficult to determine a cheater by replay.
- Method of entering the gamewas imperfect. Very often abuses occurred on the part of the Hosters - they recruited good players into their team, and left the most miserable in opponents. It turned out that if you are a hoster, then you can win with a 90% probability. The wave of indignation grew.
- The chat was poor , it did not allow bots to write too much private messages or chat. Then I had to run 2 bots, and send some messages through the second. Let me remind you that the bots worked through regular text files - one for each player, and for each game played.
- HDD slowed down - then I didn’t even know that HDD works slowly when it needs to determine the best player from 1000 players, open 1000 files and pull out the 3 best. It was necessary to solve this problem ...

Fate


Do you believe in fate? And I believe. More precisely, I believed in it. Here is my first example:

Remember, I wrote above about the DCE league, which was pretty simple? So, then 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 could not write bots (and did not want to). He asked the bot to be able to work with the database through the MySQL ODBC client, and even found code samples on VBS. We spent a month with him, he taught me SQL, explained what databases are, and how the data lies in them. He also showed me a magical unixtime, with which it is very easy to add days, minutes or seconds to dates, especially when you had to give a ban for a time, for example, an hour and a half.

I made him the bot that he wanted, which had a direct link to the database from the site, and he was able to manage player lists directly from the forum.

Having said goodbye and armed with new technology, in a couple of weeks I rewrote my bot from scratch to "new technology" - MySQL. It was a real breakthrough for me. It was possible to get the best player in one second, count points from the entire clan, or display statistics for the entire game! The bot began to fly, and the players received a new bot with new mechanics for a set of games, 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 the chance acquaintance with him during the game), then 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 push towards the knowledge of databases and the understanding that even from this frail StealthBot you can cling to large and cool databases!

Development


I found an interesting AutoIt language with which I wrote my first league client program. Built in a detector of the most common cheats, and said that players who play with it will receive 50% more points. Those interested were found, and this was the first interesting experience in client-server programming.



Given all the disadvantages that spoiled the good impression of the game, I started looking for alternative clients and platforms on which to play.

Among the first subjects was Hamachi. Alas, it did not work out with him - it’s too difficult to configure, admin rights are required (a virtual network card is installed), but the communication quality was good, ping was lower than in Battle.Net.

The next test was the Battle Lan (Lancraft) program, a small program that broadcast broadcast udp packets by scouts to the entered addresses, and thus, if someone with a white IP created the game directly on the local network, then other NAT players could see it 'ohm. 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 host, and the other part did not.


Among the latter, a certain Good Game Client (GGC, in the future - Garena) came into view. In it, it was very easy to play games such as Counter Strike 1.6, or Warcraft 3 (over LAN) much later (DotA was added much later). Ping was very happy! The crown chip was the ability to establish direct udp tunnels between players located behind NAT so that they could play with each other without even having a white ip, moreover, they were ardent fans of regular Warcraft 3 and they had a built-in updated anti-cheat. To play here, the official key to Warcraft III was not required. In general, everything is cool, but no bots were written for it. Well, I could be the first!

Using my knowledge in AutoIt, I was able to get a Handle from the chat window, and with normal reading get the current text. In the same way, I received the handle of the message input field, 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 happened. Technically, I was ready to launch a bot there. But there were no players on this platform. Nobody played there, everyone is used to Battle.Net.

It was 2008, it seems that not much time has passed, but then many had paid traffic for every megabyte! And it was unpleasant - playing through a regular Battle.Net game session consumed about 1 MB, and playing through GGC - the game was already worth 2 MB (due to encapsulation of data going in a virtual communication tunnel), which was critical for some players to play DotA became more expensive!

I saw prospects in this platform, adapted the bot for it, launched it there, appointed several local players as administrators to monitor, and announced a transitional period of 1 month. The people were reluctant, and until the last day they played in Battle.net. After disabling the bot in battle.net, the people announced a demarche, and did not pull themselves up in the GGC, instead, the people began to play in that neighboring "closed league" from our compatriots.

I believed in success, and within a month we again began to actively play games on the new platform. A year later, there was no one in Battle.Net, the GGC was now called Garena , and we had 2 times more players than before in Battle.Net.

To be continued ...

update: As I opened the Dota League. Part 2

Also popular now: