Source: http://habrahabr.ru/company/wargaming/blog/231065/ Hello everyone, recently, there was a Wargaming programming blog entry by the developers of the very popular XVM mod on how the mod was actually created. You might have heard about the Wargaming developer contest and these guys decided to participate in it as well, but they also decided to write series of posts about how one of the most popular WoT mods in the world came to be. One of the reasons this is posted in the WG programming blog is the fact that XVM developers and WG “buried the hatchet” and started cooperating more. I will not be translating the entire entry literally – instead, I will make it a bit more compact to make sense. Also, if some of the technical stuff could be translated or expressed better, feel free to let me know. The author of the post (nickname is iBat it seems, the habr blog is really bad in not showing the author identity without manual signature) stated that he started with mods as early as 2011, when he found World of Tanks and learned about the existence of mods for it in the first place. That drove him to try various mods (including UI-changing mods) but he wasn’t satisfied and deleted all the mods after one battle until he ran into the OTM mod. OTM means Over Target Markers and it changes the icons of the tanks (the class, hitpoints etc.) to other ones, created by players. This included for example the health bar, which at that point was not implemented into World of Tanks yet. This is how it looked: The healthbar was the main feature of the OTM mod – at least for iBat. It was a major upgrade, because the only way to read the amount of hitpoints of your and enemy vehicles at that point was to move your mouse over them and read the hint. That made finding “almost dead” tanks somewhat difficult and OTM made it much easier. Second big feature of the mod was that it allowed the player to actually customize its appearance via editing the OTMData.xml file. The amount of customizable things in the OTM mod grew from version to version and the mod itself was popularized in Russia a lot by various video-makers, who used it. In the end, for iBat, this was the first mod that he kept playing with, he customized it for his own needs and kept it as the only mod until he ran into the second mod that he liked, which was the noobmeter. Noobmeter (in Russian Olenemer, literally “deer meter”) was discovered by him at the point when he still was a WoT supertester. The mod was nice, but it has a very complicated installation process, which confused a lot of people: - download and unpack the archive - there was no res_mods folder in the game yet, so the contents of the archive had to be copied directly into the game folder, overwriting the official files - install some WAMP assembly (SS: not sure what that exactly means) - a script from another archive directory had to be inserted into the root of the web server. The script acted basically as a WebDAV server with some small changes. - create a Windows net disk and tie it to the command server, created by the previous step (“> net use t: http://localhost/local_server/server.php”) - install a piece of software by the name of Dokan (FUSE equivalent for Windows) - using the mirror.exe utility from the Dokan software, a mirror of the disk “t:” (previous steps) had to be created (called “r:” – another disk thus appeared in the system, a mirror of the net disk created earlier, but considered local by the system - in the res\gui\flash folder of game client, a symbolic link with the name of “stat” had to be created, doing… something (SS: sorry, again, very technical) via the following command: “> mklink /D c:\games\World_of_Tanks\res\gui\flash\stat r:\user\” And only at this point it was possible to make the client work. This mod showed the player winrate directly in the player lists on each side of the screen, using colors to differ them in their quality. After the installation, there was genuine surprise that this thing is working at all and that it’s actually popular. Of course, the average WoT player couldn’t perform the installation without mistakes and so the Noobmeter topic on RU forums was one of the most frequented ones. At that point, it was decided that the process has to be simplified somehow. The first idea was to remove the WAMP step. It was realized that the PHP only basically needs the WebDAV server, which can be created in more ways. Coincidentally, the developer at that point was dabbling in NodeJS and wanted to write the WebDAV in it. There were however some issues and in the end, he googled and learned of the existence of user mode file systems in general and in Dokan in particular. He started working in Visual Studio and it took him half a night to create a .NET executable, which did the same thing as the “WAMP + Dokan mirror” construct – it created a local disk in the system. Why the disk was needed: World of Tanks UI worked with Action Script. The mod idea was to take the AS file that was needed, to decompile it, change what is needed within, to compile it and to return it where it came. That’s how the Noobmeter worked – it re-worked the player list in battle to include the winrate and colors. The question was how to get the statistics from the mod server. The obvious answer was to ask the server via http. There was however one catch: AS operates in a sandbox (and there are more than one sandboxes – each for various UI parts) and this sandbox had blocked net access. There exists however an access to the file system using relative paths. That’s what the entire mess with links, disks and servers was for. It worked like this: - the AS script recieved a list of players, who had to be rendered in the player list - for every player, a file “stat\” is accessed - since the stat part is a link, what really is accessed is “r:\user\” - the .NET application recieves a request to access the file, it creates a http request towards the mod server - when it recieves the answer, it gives it to the AS script as “file content” This simplification increased the amount of that mod users by an entire order. When asking for help with installation, Continue reading →

More...