📜 ⬆️ ⬇️

History of MdlVis, Warcraft III Model Editor

MdlVis - a curve, but still quite popular model editor for WarcraftIII. Editing meshes, texturing, working with the skeleton, placing keyframes, creating animations, importing and merging models - all in a single file with a weight of 500Kb. In addition, MdlVis was the only utility capable of converting models from World of Warcraft to Warcraft III format.
Editor's story - under the cut.


The game of the new millennium

The third Warcraft reached our city at the turn of 2004-2005. More precisely, it was possible to get it before, but only in the form of a pirate with a curved translation, ripped rollers and ejected cards.
And suddenly the world turned upside down. Arthas Erysipelas adorned every computer store. In Warcraft were cut in every computer club. Many even forked to buy new computers, if the old did not suddenly pull the toy.
Warcraft III is generally the first computer game that seriously hooked me. And the first, which fell into my hands in a licensed form. Prior to this, it was considered a standard when games go on disks of 100 rubles each. apiece, they are installed one time, they are buggy, and besides setup.exe, on that disk there are certainly a crack directory and a keygen.exe file.
Immediately the buyer understood at first glance that we had a license: two boxes in stylish packages, plus all this is covered with a film, i.e. discs are not opened and not used. Inside was a license key. The price really bit, 580r., But everyone took and did not complain: the game was worth it.
Take at least the quality of the translation. It just fascinated. Until then, I did not even suspect that such a thing was possible: all the inscriptions, even in splash screens, were translated, and the translation was human, not machine-based. All characters, all units - re-voiced. In general, then it seemed unreal cool. Even years later, at least something similar did not lie in the stores, and even then, against the background of Fargusov and Akell, everyone there, a normal localization caused a feeling close to euphoria.
(The second time I got the same quality localization only after 2007, and it was Sudeki).

Modmaking

The map editor for the toy is simply awesome. I especially liked the opportunity to create videos on the Warcraft engine. Then they did not just lazy. Kinematics cards were passed from hand to hand on floppy disks or downloaded from the network (by those who had this network at all. Surprisingly, even a simple home phone didn’t come to every home). There were just music clips, and individual multi-stories, and even whole cartoon series (for example, “The Tale About Ilyich and the Conquest of Elven Mineral Waters”).
I was fascinated by the approach itself: nothing needs to be drawn frame by frame, as in ordinary cartoons. It is enough just to arrange the scenery and our virtual actors, and then just command them what to do: sit down, stand up, run over to that tree, swing the sword - and then they themselves, using standard animation, did it all. Then for some reason I was sure that in a couple of years, when this technology develops, in general, all the cartoons will be made that way, and creating a cartoon will be as easy as writing a story. The future seemed so close and so attractive ...
But when I started modmaking, I ran into a problem: very often there were simply no suitable models in the game. The game editor allowed importing models created by third-party developers, but another problem arose: there was no normal tool for creating these models.
Blizzards have been offering the so-called ArtTools. This is a plugin for 3DSMax version 5. Yes, yes, it was required Max5. It did not work with either 4 or 6 versions. Well, I could not get this very 3DSMax then. I ran around all the shops, looked at all the collapses ... No. On the same torrent at those speeds and those networks could only dream of. Suffice it to say that I first went on the Internet only in 2004. And at that time I got into the network through the university gateway, where even 5MB was a whole problem to deflate. At the jump of the same ArtTools, which weighed about 30MB, went almost all day.
And, what is the most annoying: it was often not even required to have a completely new model. I just wanted to tweak the existing one. Well, there, remove the elf coat, or turn the lantern on the pole upside down ...
Is there really no suitable tool for such simple, necessary actions? It turned out no. There was a true set of tools from Oinkerwinkle, but the editor there looked like this:
VertexModify
Yes, no possibility of rotation, only the simplest projections.
And then I remembered that I actually know how to program a little.
')
Coding

Well, "I can" - perhaps, it is strongly said. Just superficial knowledge of Delphi and a little deeper - assembler, but under DOS. The latter studied Yurov’s textbook read to holes. On the other hand, I thought, I don’t really need a clone of 3DSMax, but, in essence, a simple program. Just like VertexModify, only with the possibility of free rotation of the camera.
I formulated the basic requirements for the program:


As a programming language, I chose Delphi5. Why exactly the fifth? Because it is there that dynamic arrays first appear, and the size of the finished binaries is still relatively small (later on the forum they repeatedly asked why the empty form compiled in Delphi2005 weighs more than my entire editor).
There was also the question of choosing an API: OpenGL or DirectX. I think everyone already guessed what I chose. Yes, the DX code seemed to me stupid and overly complicated. “For some reason, the COM interfaces were screwed up there, Microsoft is definitely an evil empire,” I thought. But in OGL everything is clear, simple, understandable and works guaranteed everywhere at all, while DX may still not be installed. Or installed, but not the version. In general, GL is the best.
How was I wrong then ...

The first difficulty was the format of the models. Warcraft's models come in two forms: binary (MDX), which was actually imported into maps, and text (MDL). No data on the binary format existed at all, and the text was partially described, and all the mod-makers editors worked with it. From one format to another, they were translated by a special tool (Yobguls converter), the author of which the format device did not know either, but simply used pieces of Warcraft code for conversion directly from the binary. Naturally, the rip worked unstably in terms of departures, but it converted absolutely everything.
In general, I also decided to work with MDL. And he proudly called his program “MDL Visualizer”, giving the project the name MdlVis .
The half-heartedness of the MDL documentation did not bother me at all: I was planning to work only with geometry, i.e. tops and mesh. And all sorts of animations, textures, materials, cameras, particle sources, trace sources, light sources, sound effects, etc. the objects did not interest me. Only sections of geometry were loaded into memory, and they were also overwritten later, and I didn’t touch the rest.

Start

Kodil during his free time from studying, in the evenings, often staying up late. The original version of the program was born exactly one month after the first line entered the code editor.
About
Window "about the program" one of the initial versions of the editor.

Having worked a bit with the resulting program, I decided to share it with other mod-makers.
In those days, Blizzard did not even think about coming to Russia, so the largest Russian-speaking community was located on the site blizzard.ru.
There I laid out my editor, designating the assembly as an alpha version.
Reviews were not long in coming. At first, they were very negative: as expected, the program was very buggy, hung up and had a very non-intuitive interface, and I somehow did not bother with tutorials to it.
However, MdlVis, compared to VertexModify, did provide a much more intuitive way of working with models. Therefore, although experienced modmakers only frowned, newbies selflessly fought with program glitches.
Meanwhile, in parallel with the bugfixes, I mastered texturing.
The textures in Warcraft III were in BLP format, which was a pretty badly wired BMP hybrid with JPEG. For decoding textures, Blizzas used an Intel codec. Accordingly, I had a choice: to write the decoding procedure myself or use the library ijl15.dll, which was installed by default with Warcraft. I chose the second way: why produce glitches and increase the size of exe, if the module you need is guaranteed to be on each mod-maker's computer?
However, taking care of those who for some reason did not have access to the game, made ijl15.dll dynamic download. MdlVis checked for the presence of this module, and if it was not found, it still started up, just did not allow to enable the display of textures.
I designated the corrected version as beta.
At about the same time I received a letter from another game resource, xgm.ru, with a request to lay out the editor. I agreed.
If blizzard.ru was a community site, then xgm was positioned as a modmaker site: less ordinary players, but more modmakers. Therefore, in the future it was he who became my main working platform.
The beta version of the editor, laid out on both resources at once, befell the fate of alpha:

Beat me with sticks, but for now this is just a promising project, but the vertex is no better than the vertex modifay, and even more so the animations of the merger.
A rather obscure interface (for me). Non-working option "general view", no, it certainly works, but then hangs the computer. Impossible selection modes, I did not manage to remove the selection.
The only thing that pleased - at least some no prospect.
In general - for revision.

I certainly rules the bugs, but not too active, because a new titanic idea struck me: add an animation editor to the program! Even though it is easy to realize the playback of these very animations, the time is gone mass. I had to shovel a lot of material, figuring out what quaternions are, how they interpolate, and what skeletal animation is. Here, for the first time, I slightly regretted that I did not choose DX - there everything is done with a couple of clicks, since All functions for working with quaternions and matrices are in the library. I also had to fill all this math with pens. At that time, he mastered only partially - Bezier curves interpolation, which, moreover, were set by the angles of inclination, could not be implemented, as well as Hermite splines. As a result, the models that used these types of interpolation looked pretty tangled in MdlVis.
Well, better at least something than nothing at all.
So, in May 2005 the first (1.0) version of MdlVis is finally out. In it, as usual, they immediately found glitches (for example, textures in the tga format were loaded for some reason upside down), so I had to release a couple of bug fixes (1.01, 1.02). After that, the editor finally became efficient and began slowly but surely gaining popularity among the modmeykerov.
Animeditor
MdlVis animation editor

The first version of MdlVis already knew how to work with the clipboard and even allowed copying fragments from one model to another, along with all the materials. True, not without shamanism: in order to insert a fragment from another model, it was necessary to first select one and exactly one point (the so-called insertion point), to which the inserted fragment was “tied”, copying all of its movements.
So, if it was planned to insert a sword, then a point was marked on the hand. If a head or helmet was inserted - a point of the neck, etc. Agree, the actions are not quite intuitive.
Despite the fact that all this was detailed in the FAQ to the program, the question “how to attach the head of Arthas to the dryad” soon became one of the most popular on the forum. He was asked again and again, literally vybeshivaya modders ...

In the meantime, a disk with a fifth 3DSMax was mysteriously found on the ruins among other pirates. Happily seized it, I immediately ran to install Art Tools, and very soon the full description of the MDL format literally fell into my hands. Now I loaded not only the sections with which the editor worked directly, but in general the whole model. So, it is time to implement the work with the binary format, getting rid of the Yobgul converter and turning MdlVis into a universal combine for the model maker.
In general, as it turned out, the community is not only a generator of ideas that I myself would never have thought of, but also an excellent source of information. If you need to get some docks, articles, algorithms, rare materials - you just need to throw a cry. I had only to say that I really need the MDX docks, as they magically materialized.
The binary format turned out to be much simpler than the text one: when you don’t need to parse, it’s enough just to map the structures, it’s such a buzz
And the August version of the editor already allowed to load MDX, at the same time supporting the conversion of MDL / MDX. The import of 3DS models was also added there, but this function turned out to be unclaimed. It became clear that MdlVis is used precisely for quick and easy editing of existing models.

Support

But the community has its drawbacks: in particular, people are rather reluctant to report on minor glitches. If everything fell at all, and falls on this model is stable - then yes, they will. And if it falls once out of ten, or it pushes a bit, most likely I don’t know about it. No matter how he swore on the forum, nothing helped. He even expressed the idea that it would be good to distribute MdlVis as Shareware, where the registration key would be sent in exchange for a bug report.
And there were glitches. And a significant part of them was not connected with the editor himself, but ... with video drivers. The OpenGL standard actually turned out to be a complete lack of standard. Individual vendors interpreted its specification so peculiarly that I just had my eyes on my forehead. The cards were especially different from ATI and their Chinese clones, among which, for example, I came across an instance that does not support double buffering. As a result, the 3D engine over time has acquired a web of numerous tricks, hacks and checks for every sneeze, just to make it all work on the numerous “zoo” of video cards. And this is despite the fact that I then used pure OpenGL1.0, without any extensions at all!
Difficulties added themselves modelers. Since the editor was still very limited, they often ruled text MDLs directly in Notepad. In this case, something turned out that was not provided for by the specification, and it was incorrectly interpreted by the editor (that is, not in the way it was in the game engine). I had to adapt. I spent a lot of time, generating the wildest combinations of flags and elements, “feeding” all this to War and watching his reaction.
MdlVis itself was also not very stable. When I started it, I didn’t plan that it would grow so much (in the figurative sense, of course - the entire editor’s binary did not reach the 500k mark to the very end, and it always went with a single file, without additional dependencies). As a result, there was no smell of any architecture there, the memory flowed into all the holes, Access violations fell out in batches, and each fixed bug could easily activate a couple of new ones.
I also ran into another, completely unexpected problem: I had no time for modeling! Programming devoured time in any quantities, and it turned out to be an absurd situation: I created the editor specifically to hit the people with cool maps, and as a result, modeled completely different people.
But, despite all the difficulties, MdlVis was approaching the peak of its glory. Especially since the end of 2005 is the heyday of Warcraft III. Maps were made in batches, packs of models were compiled, kinematic contests were held, projects multiplied like mushrooms after rain. People experimented with the gameplay, creating incredible, fantastic maps (like FPS on the WC3 engine). Work was in full swing.

Wow! It's coming ...

And then he came. The first of the gods of the new era, the online era. The forerunner of the apocalypse and the death of singles as such.
World of warcraft .
More precisely, it appeared even earlier, but in Russia it was familiar only by hearsay and by emulators personally raised on its own desktops. Not with the networks of that time to be chopped into it. More or less lucky, except for Muscovites, it was rumored that the Internet was already relatively good there.
In general, at that time WoW was useless for Russian gamers. But in it were models. And what! High poly, with tons of super-quality animations, with detailed textures. And, which is especially valuable, all on the theme of Warcraft. The idea of ​​ripping these models into MDX format was literally in the air.
So, a script for importing M2 (WoW model format) written by one of the skilled craftsmen appeared in 3DSMax, but it worked so crookedly that not everyone could run it. In addition, he imported only meshes and a skeleton, which in addition was required to cling to the vertices manually.
And then Blizzard released a new WoW patch, and the script stopped working altogether.
The situation was complicated by the fact that I did not have the opportunity to download WoW (the grid was upgraded, yes, but still dial-up with 33.8kbit / s at the peak), or buy it. And here again the community has come to the rescue. At my request, the mail was filled up with models and textures, as well as screenshots, of how all this should look like in a game. Somewhere mined and a sketch of the documentation on the format of M2. As it turned out, those docks in many ways did not correspond to reality.
I spent weeks in the HEX-editor, understanding the intricacies of the new format. The WoW engine turned out to be much more advanced than the WC3 engine, so many features of the M2 models simply did not have analogues in MDX. I had to improvise: to figure out how, on the basis of M2 analysis, to generate the most similar MDX model from scratch.
I had to tinker with the texture format, BLP2. They used a whole set of compression algorithms, from JPEG to DXT (I ran into the latter for the first time, and also smoked forums for a long time, figuring out how it is decoded at all).
And then came the historic moment: November 9, 2005. MdlVis 1.2 comes out. The first program in the world that can convert WoW models and textures for the third Warcraft.
I myself was so imbued with the importance of the moment that I even wrote a detailed tutorial where I literally chewed every detail of the process.
To say that the converter was in demand - just to say nothing. Forums exploded. People for days on end convertible models, asking seems to be the goal of converting all WoW content entirely.
Moreover, an English-speaking community suddenly learned about MdlVis. This somewhat surprised me: until now, I somehow didn’t even think about the fact that there are also players and modmakers abroad, and that there are even more of them than in Russia. Therefore, the editor was made exclusively for the Russian-speaking audience. The interface, readme, FAQ and tutorials - everything was in Russian. A non-intuitive interface almost completely eliminated the chance to understand the program by typing.
However, an English-language tutorial on converting WoW models appeared on wc3search and a number of other resources (in the style of "and now click on the third top row of hieroglyphs in the menu, then do not read - right click on the left button ..."), and at the same time - the models themselves .
The latter, however, disappeared the next day from wc3search, but a topic filled with flame appeared, “is it legal to use WoW models in WC3 mods?”
I remember, then for a long time I laughed at this discussion. Even deliberately threw the entire branch into his working folder, it hurt the mood. Oh yes, Blizzy will certainly be offended that fans stole models from one of their games in order to insert them into the same company and on the same subject. In those days it sounded like a joke, because we all absolutely sincerely believed that signs like ©, tm , ® are intended solely to make the name look more solid.
Wow model
WoW model imported into the MdlVis workspace

MdlVis, by the way, was under a “no” license. That is, it never occurred to me to demand money for it, or at least to add a multi-kilometer header with the text of a free license to each source file.
Be that as it may, the flame widened, and Blizzard kept significant silence. Either speechless, or (most likely) they really didn’t care.
However, two weeks later, their support replied that it was possible to upload it, but not to Battle.net cards. A month later - what is possible in battle.net, but only if the model with all the textures does not exceed 1Mb. And then they gave up completely, especially since by that time only DotA was left from the whole Battle.net.
I was faced with the problem of optimization: it was necessary to shove a hefty WoW model in the declared 1Mb.
The issue of reducing the size was solved gradually and unhurriedly, by collecting different tricks and hacks. For example, numbers in MDX were set by 4-byte float. Two bytes of these four, as it turned out, can be safely zeroed out, which only led to a decrease in accuracy and usually did not affect the quality of the model. But in the archive, such modelki were already pressed much better ... Well, everything is in the same style.
Overly "pokhachennye" in a similar way, the model was normally eaten by both the game and MdlVis, however, third-party modeller tools on them fell only on the way. As a result, such models were not edited by anything other than my program, the community began to be outraged, and I had to add an “canonizer” to the editor — an anti-hack that brought the models back to standard appearance, albeit by increasing their size.
In addition to M2, another format was used in WoW, WMO. If in M2 the models of different active mobs were stored mainly, then in WMO there was an environment. Pillars, buildings, even entire cities. The structure of WMO resembled a mini-map: it contained a description of the method of assembling a model of pieces and a reference to "building blocks".
In the end, I, not without the help of the community, figured out this format, adding its support to the next version of the editor.

Competition

Around that time, MdlVis has a competitor: the Warcraft III Model Editor (W3ME). This one was written in C ++, went immediately with open source, used DirectX, English interface language, and weighed six times more than MdlVis (at that time I was very proud of such a miniature of my editor).
The author of W3ME is clearly not new to programming, and was familiar with the architecture not by hearsay: very clear, understandable even without comment, readable code, high modularity and incredible stability. W3ME turned out to be a kind of antipode of MdlVis, everything was the opposite: DirectX vs. OpenGL, C ++ vs Delphi, modularity vs spaghetti. , , : W3ME , , , . MdlVis, , , .
- : MdlVis , , W3ME, .
, « – ». MdlVis, , ( , ). Git , , .
Blizzard' WoW, , . , . MdlVis . , WoW-… . .
W3ME . MdlVis, . : , , .
MdlVis. , W3ME, -, .


: - . , - . What to do?
Having smoked a bit of the forums, I decided to add the possibility of removing minidumps to the VEH program. Then, when you receive a dump from the user, you can load it into the debugger and at least try to understand what caused the problem.
No sooner said than done. MdlVis 1.39 came out with a new functionality. All exceptions were additionally intercepted by VEH, and a dump was taken in the handler. At the same time, I again took into account that neither VEH nor work with dumps is present in Win98. Therefore, MdlVis first checked the availability of the necessary functions, loading the required modules dynamically. If the system did not support VEH and dumps, MdlVis still worked fine, just without this added functionality.
« » , , , Windows Vista. W3ME , , MdlVis - .
, . : MdlVis , . , .
. 1.39c, .


? – , , , , . MdlVis , Warcraft , Battle.net .
StarcraftII. : MdlVis Starcraft! , 100% . , «» Blizzard – . StarcraftII , , . MMO. , , .


, MdlVis:


, , . , , , .
: , , - . , . , .

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


All Articles