Hello everyone!
After a small BUT very interesting utility program «GrannyConverter by ricky92» capable of adequately converting animation files of the «.GR2» format for later addition to the game was discovered, I did some digging online and practiced with this utility, and found out that a user under the nickname ricky92 wrote a very complex program, because the program can convert not only version 2.6 files but also later ones, under certain manipulations and settings when exporting from the 3D editor, which is what will be discussed below.
Oh, hold on, guys, Vova is going to explain everything to you now
To add a model and animation to the game, you don't have to resort to using the Maya program; you can use only 3DsMax (the version doesn't matter — the main thing is that you have the GR2 export plugin for it; I used 3DsMax2018) and the Map Editor that comes with the game.
I will briefly describe how I do this and what export settings I use.
1. After adding the model to the 3DsMax program and various manipulations (instead of the main bone, I create a Point helper in the form of a Box (more visual), with an arbitrary size, rename it to Global, and link everything to it — both the skeleton and the mesh.), I export the skeleton to GR2, then the model.
I select the settings file for importing the skeleton ->
In the File settings, I check two boxes
I press Export.
For exporting the model geometry, I use the same settings as when exporting the skeleton, and in the Meshes section I make sure that only the mesh itself is present and nothing else, and I don't change the settings (because I don't know what can be disabled) ->
2. After exporting the model geometry and skeleton, I load the animation. There are two types of animation: a) — simple, which does not contain attributes (for example, Idle and Move). b) — animations that must contain attributes that trigger in-game effects (such as Attack and Hit).
There are several attributes that can be added to an animation: 1) — B_cut and action. Here, "B_cut" is contained at the beginning of the attack animation and precedes the second attribute "action", which in turn will play the hit effect on the enemy (multiple "action" keys can be used in one animation). 2) — E_cut is contained in damage-taking animations (multiple "E_cut" keys can be used in one animation).
The full mechanics of the attributes are not entirely clear; for example, Zealot of Faith in the "Hit" animation has 3 "E_cut" keys.
To add an attribute to an animation, you need to add keys in Global -> open the Curve Editor ->
3. For exporting the animation, I select the settings file for animation ->
Just like before, I go to the Models -> Global settings and uncheck Include reference in export for everything except the skeleton bones and Global
In the File settings, I check two boxes
In the Animation settings, the values are as follows
I go deeper into the Animation settings -> there I find an unclear 01 - Default, and disable it too
I press Export.
There are cases when, in an animation, the model's legs seem to slide from side to side along the ground (especially noticeable in the Idle animation), or other similar deviations that were not in the original animation; this can be fixed by playing with the settings (for example, unchecking "Reduce curves where possible", and/or lowering the value of ".... curve tolerance" under the sliders (in my opinion, "Orientation curve tolerance" has a strong influence) in the root Animation).
I changed the "curve tolerance" value to the minimum, selectively for the required bones, in the last nested level of the Animation settings.
A small aside:
I also found another small utility (latest version 13) which supposedly can optimize GR2 files; I actually use it myself, no harm has been noticed from it, and the final file size is slightly reduced (let's hope it helps), so I'll show its functionality too, but you can also do without it.
Now copy the files into one folder, also put GrannyConverter_ricky92.exe and GR2Tool_by_Distraught_granny211_v13.exe into it.
Drag and drop each of our exported files one by one onto GR2Tool_by_Distraught_granny211_v13.exe (Optional) ->
Now the resulting file can be dragged (converted) onto GrannyConverter_ricky92.exe, after which the file is ready for use.
4. Further work is done in the Map Editor. We work as per the manual (I mean point 2.3 from the guide on the first page of this topic), open the editor and create a map, in the "Model" window create a "New Object", enter the path to the dummy file there (which needs to be extracted to the "\Homm5\Complete" folder) and specify Global in RootTransform, press "OK". After that, a folder named after the test map should be created "\Homm5\Editor\H5MMods\test_map". Inside it, create a "bin" folder, and inside it, subfolders "Skeletons" and "GrannyGeometries". Put our exported skeleton GR2 into the "Skeletons" folder and give it the name generated by the editor (uid) from the editor's "Skeleton" window. Also, put our exported model GR2 into the "GrannyGeometries" folder and give the file the name generated by the editor (uid) from the editor's "Geometry" window. Now return to the "Models" window. Select our .xdb model template. Right-click on it and select "Export". (An entry should appear in the editor log - "Optimized geometry dumped ......") Through these manipulations, a folder "\Homm5\Editor\H5MMods\test_map\bin\Geometries" with a file should appear, and we have completely abandoned the use of Maya 6.0. Now the folder "\Homm5\Editor\H5MMods\test_map\bin\Geometries" contains a file with the model's geometry, and the folder "\Homm5\Editor\H5MMods\test_map\bin\Skeletons" contains a file with the skeleton, and the animation files work perfectly after being processed with a HEX editor, and then converted using GrannyConverter_ricky92.exe.
GR2 plugin for 3DsMax2018
К. Прутков-инженер. Мысль № 77.
Многие вещи нам непонятны не потому, что наши понятия слабы; но потому, что сии вещи не входят в круг наших понятий.
© Козьма Прутков