📜 ⬆️ ⬇️

As we did XVM. Part One: Start and Gather a Team




Welcome, dear habrasoobschestvo! On the occasion of the start of the Wargaming contest, we decided, firstly, to take part in it, and, secondly, to write a series of articles about how we reached the creation of one of the most popular modifications of World of Tanks and as a hobby with a couple of lines of govnokod the evening grew into what we have. The articles describe all the rakes encountered (and tested on themselves). Another reason for writing the article was the bury of the hatchet between XVM and Wargaming and the release of our relationship to a new level - we are pleased that this article was published on the WG blog. We hope that the reading itself turned out to be interesting, and other contestants will be able to learn something useful for themselves.

When I first started playing World of Tanks in early 2011, I naturally didn’t bother about mods. I did not even know that they exist. But I have such a habit: if I like some kind of game (that is, it doesn’t delete after the first game session), then I try to learn about this game as much as possible, why climb to the thematic forums. On this very forum, I learned about the existence of mods and decided to try. For a week I went through all these sights, skins, equipment icons, various voiceovers, and more and more I did not like it. It seems to be all good, but something is missing, I want to twist. Almost all mods were removed after the first test battle. But once I came across a mod under the simple name OTM.

OTM


He is - Over Target Markers. This thing replaced the standard tank markers with its own (the markers are those HP stripes, the class of vehicles and others that are above all tanks).
')


The most important chip at that time was that OTM added these same HP strips, which were not in standard markers. When using standard markers, the only way to find out the number of HPs of the enemy and allied vehicles was to move the mouse cursor over it and read the hint. It was difficult to find the “wounded animal” on which to focus the fire: you had to drag the mouse over the battlefield, instead of focusing on shooting and maneuvering. With OTM, the situation on the battlefield was literally in full view. But that's not all: the mod had a config in the form of an OTMData.xml file, which allowed us to customize the appearance and behavior of the markers! From version to version, the number of customizable items has grown. Config could share what the people are actively engaged in thematic resources. The mod stood at many tank YouTube, which contributed a lot to its popularity.

In general, it was the first mod that I did not delete after the first fight. Instead, for a couple of evenings I set it up exactly the way I wanted it, and played with pleasure until the next thing that interested me.

Olenemer


At that time, I was still the WoT supertester. These guys show the early versions of the client in order to get feedback. And one evening at a friendly pokatushkami in Teamspeak I heard snatches of a conversation: “have you seen THIS? ... Yes, how to put it? ... Syt! ... PAMAGITE !!!!! ". It turned out that we are talking about some kind of new fashion, which was distinguished, among other things, by a few, ahem, extraordinary installation process.

So, remember (and better write down!) What was needed for installation (close to the original instruction ):

  1. Download and unzip the archive.
  2. The contents of one of the archive directories are copied and replaced with the game client folder. (It should be mentioned here that at that time it was commonplace for all mods, since the res_mod folders and, accordingly, mods support from the game developers was not yet.)
  3. Install some WAMP build. (Yes, yes, this is where Apache, MySQL and PHP are. Actually, MySQL was not needed here, but it is clearly easier to install the assembly.)
  4. It was necessary to put the script from another archive directory into the root of the web server. The script was a WebDAV server with minor changes.
  5. Create a network drive in Windows and connect it to the server created in the previous step with the command
    > net use t: localhost/local_server/server.php
    either through the master.
  6. Install a thing called Dokan (similar to FUSE for Windows).
  7. Using the mirror.exe utility from the Dokan suite, perform a mirroring of the t: disk in r :. This led to the appearance of another disk in the system - an exact copy of the network one from step 5, but which the system considered local.
  8. In the res \ gui \ flash directory of the WoT client, create a symbolic link named stat showing the r: \ user directory with the command
    > mklink /D c:\games\World_of_Tanks\res\gui\flash\stat r:\user\
  9. At this point, finally, it was possible to start the client and enjoy the work of the mod.



The mod itself showed no less than the percentage of victories of teammates and opponents. And right in the battle and right in the ears (“ears” are the panels on the sides of the screen with the list of players), applying the most genuine color differentiation. Honestly, the first reaction, when I personally saw the work of fashion, was a sagging jaw: does this all work at all ?! Even lower, the jaw dropped when I was fighting to fight watching the number of those representatives of the fauna that gave the name of fashion.

Although stop. Do you imagine that a typical Central Asian “tank” could complete the first eight points of a mod installation without errors? As expected, the topic with this mod on the official forum was one of the fastest growing.

Having explained to several comrades how to set it all up, I realized that this is a dead end, and we must somehow simplify everything. My first thought was to get rid of WAMP. Then I thought that PHP, in fact, requires only a WebDAV server, which you can obviously do a lot of things with.

As luck would have it, then (and now) I was fond of NodeJS and seriously wanted to write WebDAV on it. Well type, then put Apache, and then Node. After all, this is a huge difference! As a result, I sat down at Google and found out about user mode file systems in general and Dokan in particular. I started Visual Studio and, at midnight, gave birth to a .NET file that did the same thing as the WAMP + construction from the Dokan mirror - created a local disk in the system.

A few words about what this disk was for. The user interface of World of Tanks is made on Action Script. The idea of ​​the mod is to take the necessary AS-file, decompile it, change what you want, compile it and upload it back. The olenemer was made the same way - he painted the ear strings in colors corresponding to the player’s statistics. The only question is how to get these statistics from the mod server? The most obvious answer: request by http! Yes, but there is one “but”: AS works in the sandbox (there are several of these sandboxes for different parts of the interface), and this sandbox has access to the network blocked. But there is access to the file system by relative paths. And because of this, I had to make a fuss with disks, servers and links.

The work looked like this:

  1. AS script receives a list of players who need to draw in the ears.
  2. For each player, the stat file is read \ <player nickname>.
  3. Since stat is a link, R: \ user \ <player's nickname> is actually read.
  4. The .NET application receives a request to read the file, forms an http request to the mod server (which is described in the next article).
  5. Having received the answer, it displays it in the form of a “file content” to the AS script.

This simple improvement has increased the number of users of the new mode by an order of magnitude. In the original topic, if a question was asked about the installation, it was most often sent to my topic with a “simplified installation”.

Team and XVM Gathering


In the meantime, the number of users of the mod grew, and in a hurry the server written, hosted on a cheap VPS, did not handle the load.

The result was:



Just at that time, I rented the cheapest “dedicated” server for my own needs at Hetzner (EQ4: Intel Core i7-920, 8 GB DDR3, 2x 750 GB SATA II HDD). Seeing such a disgrace with the mod I liked, I contacted comrade bkon and offered all possible assistance with hosting.

A few days later the server was safely installed, and for some time users got a relatively bug-free mod operation.

In February-March 2012, at the same time a forum was made on the same server for technical support and exchange of configs.

A small historical excursion. Initially, the idea and first implementations of OTM belong to Nicolas Siver . In November 2011, this business seemed to be fed up with him, and sirmax and bkon comrades took up the baton, releasing OTM for the client of version 0.6.7 of tanks. They also had the idea of ​​a reindeer. Sirmax ( sirmax2 ) is still the main developer of the client part of XVM.

In January 2012, I joined the team: first, as a hoster, a little later, as a server-side developer, and then, of auxiliary systems (for example, the statistics activation widget).

In the middle of 2012, bkon somehow imperceptibly left the team , but they appeared: Mr 13 ( Wayfarer ) - CEO and PR, XlebniDizele4ku ( ilit ) - client developer, Mr A - assistance in client development and building releases, Mixaill ( Mixaill ) - organization of continuous integration (nightly assemblies), interaction with client-side translators, q4x2 - * nix specialist and server-side developer.

And a few words about why, in fact, the topics were deleted with a description of the modifications on the official forum. With the growing popularity of fashion, the number of precedents, so to speak, of unsportsmanlike use has also grown: insulting players with low statistics, or, conversely, with too high. The offended players went to the same official forum and cried / demanded / threatened and in every possible way sought to ban this “offended” their fashion. After some time, “without declaring war” (that is, without any prior contact with the developers of the mod), all topics related to the reindeer and XVM were removed, and the forum rules would ban the publication of links to any mods displaying statistics. The official reason for such prohibitions: mods create additional load on the WG servers. Any attempt to somehow resolve the conflict and lift the ban came up against the janitor’s syndrome at the moderators (it’s said to delete - we delete), or managers ’formal replies.

We offered various tradeoffs: limit the frequency of requests to a given value. Enter the schedule when we send requests - it all came down on a blank wall. After a couple of months piling into it, we abandoned these attempts, and simply divided XVM into XVM-full and XVM-light. In the light version, everything related to the display of statistics was cut out. Thus, we formally did not fall under the ban (with the light version, of course): the janitors didn’t touch us much, and the channel of attracting new users through the official forum started working again.

Config and editor


As mentioned above, OTM and, accordingly, XVM had a config file. At first it was in XML format: OTMData.xml. There were few settings, and there were enough manual edits in any editor. Over time, the number of settings grew, as well as popularity, and two things became obvious:

  1. XML is not very convenient for manual edits.
  2. Whatever format we choose, we need a WYSIWYG editor.

The story turned out to be the same with editors: there was always not enough time for them (and even not enough now), because they often don’t keep up with the latest features in fashion itself. The very first editor was made on Adobe Air by the same Nikolas Siver . When the relay went to our team, we didn’t touch the editor for quite a long time, and, in fact, it no longer represented a serious value, because it didn’t contain a lot of actual settings. At some point I even tried to make the editor on HTML / JS, but nothing interesting came of it.

In addition to some inhibition, he had one fatal flaw: to make it WYSIWYG, it was necessary to do a decent amount of work on repeating AS + to keep it up to date. The applet variant made it possible to take a part of the code directly from the main branch and get visualization of the scrolling parameters “for free”. The current editor is located here .
Next, we had a migration from an XML config to JSON. The new config was named xvm.xvmconf. In truth, this is not a very strict JSON: comments are allowed in it. Thanks to this, more advanced users can edit the config without an online editor - just by reading the comments.

We did not forget about backward compatibility. First, the client, in the absence of a new format config, looked for and downloaded the old OTMData.xml (and this feature was recently cut out, so there was more than enough time to migrate). Secondly, until recently, the online format editor could be opened in the online editor, and saved in the new one.

In the spring of 2013, there is another need: due to the increase in the number of customizable features, the config with each version has grown and expanded. As a result, it became problematic to navigate it, plus it became problematic to find errors such as missing commas or parentheses. The division of a file with a config into several separate files suggested itself, but the JSON format, unlike XML, does not allow making links between files. The solution was an extension of the JSON format, which we called JSONx.

Actually, there was only one change - as a value, you can specify a link to an arbitrary object in this or in another file. There are two options for writing: short and extended:
short -
 “name”: ${“file”:”path”} 

advanced -
 “name”: { “$ref”: { “file”: “<filename>”, “path”: “<path-to-value>” }, [overrides] } 

The short format is a special case of the extended one. The extended format adds the ability to override values ​​inherited from the substitution. The “file” parameter is optional: if it is not specified, the value will be searched in the current file. The “path” parameter indicates the path to the value along the document hierarchy, separated by dots.

Consider this with an example:
root.xc:
 { "configVersion": "5.1.0", "colors": ${"colors.xc":"colors"}, "colors2": { "$ref": { "path": "colors" }, "ally_dead": "0x009900", "enemy_dead": "0x840500" } } 

colors.xc:
 { "def": { "al": "0x96FF00", //  "en": "0xF50800" //  }, "colors": { "ally_alive": ${"def.al"}, "ally_dead": ${"def.al"}, "enemy_alive": ${"def.en"}, "enemy_dead": ${"def.en"} } } 

Here we get the following:

  1. Begins to boot root.xc.
  2. The “colors” parameter of the root.xc file refers to the colors.xc file, and substitutes the “colors” object from it.
  3. The parameters in the “colors” section of the colors.xc file refer to the “def.al” and “def.en” values ​​of the same file.
  4. The “colors2” parameter of the root.xc file refers to the “colors” object, copies its value and overrides the “ally_dead” and “enemy_dead" values ​​by others.

The result is valid JSON, which is parsed according to standard rules:
 { "configVersion": "5.1.0", "colors": { "ally_alive": "0x96FF00", "ally_dead": "0x96FF00", "enemy_alive": "0xF50800", "enemy_dead": "0xF50800" }, "colors2": { "ally_alive": "0x96FF00", "ally_dead": "0x009900", "enemy_alive": "0xF50800", "enemy_dead": "0x840500" } } 

The extension of the config files was changed to .xc (from "xvm config"), and the config file was called xvm.xc. Individual files and folders with speaking names are responsible for individual interface elements. It also makes it quite easy to build your own config using the individual items you like.

Users support


We initially understood that XVM is somewhat more difficult to install than the majority of mods (this even gave rise to the meme “The Olenemer starts its work already in the installation process”), and that without the support of a lot of audience we will not gather.

To reduce the load on support, we even divided the XVM into XVM-full and XVM-light. In the light version, everything related to the display of statistics was cut out. Accordingly, these players did not need to install either a Dokan or a .NET application, which seriously simplified the installation.

The very first support was provided on the official World of Tanks forum. It was not very convenient - at least, we did not have the possibility of moderation and consolidation of topics, themes were mixed with others that had nothing to do with us. Therefore, almost simultaneously with the move to the first dedicated server (January 2012), the first technical support forum was installed on it. The most common phpBB out of the box. Nevertheless, he performed his function to one emergency.

The state of emergency was that we needed to redesign the partitions in the file system. Why - no one remembers, but it was necessary. We did not have any spetsov then, we decided to do it ourselves. The result of this action was a collapsed raid with (surprise!) The absence of a current backup.



The positive moment of this incident was the appearance in our team of Mr 13 (he makes backups!), Which also owns the Korean Random forum, on the basis of which the main resource of XVM support is now located.

In the fall of 2012, the mod had a face in the form of its own website http://www.modxvm.com/ . The site contains a gentleman's kit of any resource: description, links, news, FAQ. There also moved the online configuration editor. Over time, the site was translated into English, German, French and Ukrainian. The site also helped to reduce the cost of personal funds for the development of XVM, since donations from volunteers could not recoup even a small part of the costs of maintaining and developing the project. But there was some inconsistency. We saw by our metrics that the number of unique XVM users is increasing every month, at some point it has exceeded one million, and the number of unique users per month on the site was less than 100K.

We already knew the reason - modpacks. Modpacks are self-built mods that are promoted by different personalities. XVM itself was willingly included in these assemblies, but not with references to it. It even got to the point that the inscription on the battle loading screen with a link to our website was replaced with its own. This parasite did not get us tired, and we did voluntary-compulsory activation of the statistics module on our website.

It happens like this:

  1. The user visits the XVM website.
  2. Login using Wargaming.net ID (OpenID).
  3. Thanks to this, we recognize the game nickname and user ID and affix to it the sign “requested token”.
  4. After that, the user starts the game client with XVM installed. The mod at start sends a request to the /checkToken method. « » (GUID), «» « » — , . \res_mods\xvm\db\tokens.xdb .
  5. API .
  6. ( ) — , .
  7. , .

:

  1. .
  2. 30% .

: , , .

. ( ), ( , ).

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


All Articles