First thing is you need to understand the modeldb file that is the key file of the game.
Lets take an example of armored swordsmen entry in the BMDB or modeldb file:-
Code:
17 armored_swordsmen
The first line is the name of the unit and is the one that is written in the armor_ug line in the EDU. This name is 17 characters big (including the “_”). This number is shown before the name. This format is repeated throughout the file: first the length of the line, then the line itself. If the written number is different from the amount of characters in a line then the game will crash at start up. Using the modeldb checker in this case helps.
Code:
1 3
62 unit_models/_Units/EN_Pplate_Plate/armored_swordsmen_lod0.mesh 121
62 unit_models/_Units/EN_Pplate_Plate/armored_swordsmen_lod1.mesh 1225
62 unit_models/_Units/EN_Pplate_Plate/armored_swordsmen_lod2.mesh 6400
The first line in the above code stats that a 1 character string is about to come. Things string (“3”) tells the game how many model lines there are to come. In this example there are 3 model lines. If we take a closer look at the first model line we see that it is 62 characters big, and that it points to a .mesh file. The number 121 represents the distance at which the model is last shown. The game takes the square-root of 121 (or whatever number there is) to calculate the distance. So here the distance in meters is 11 in game meters. Notice that the distance number is not counted with the 62 characters. When you zoom out in the game, it goes to the next model at a distance of 121 which continues to be shown till a distance of 1225, and so on. The reason for this is that the game, like many other games, uses a LoD system. LoD stands for “Level of Detail”: the lower the lod number (lod0) the more faces, or polygons, the model contain. The reason for this system is to optimise the performance. After a distance of 6400 the games does no longer show 3d models, but 2d representations called Sprites which are very light in comparison laying stress on your GPU.
Code:
2
7 england
74 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_england.texture
73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
49 unit_sprites/england_Armored_Swordsmen_sprite.spr
5 slave
73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_rebels.texture
73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture
47 unit_sprites/slave_Armored_Swordsmen_sprite.spr
The first number tells us that now comes two faction entries for the unit’s main textures. The two factions are England and the slaves (rebels). Each of these faction names, as always, have a number in front of them with the length of the string. The texture entries consist of 3 lines:
- The first line is the “diffuse map”, or simple the ordinary textures.
- Next up is the normal map.
- Lastly is the link to the sprites.
Code:
2
7 england
60 unit_models/AttachmentSets/Final Heater_england_diff.texture
60 unit_models/AttachmentSets/Final Heater_england_norm.texture 0
5 slave
58 unit_models/AttachmentSets/Final Heater_slave_diff.texture
58 unit_models/AttachmentSets/Final Heater_slave_norm.texture 0
The next entries concern the attachmentsets. These are textures used mainly for weapons and shields. The lines are built up pretty much the same way as the main texture entries, with a diffuse and a normal map.
Code:
1
4 None
19 MTW2_Slow_Swordsman 0
2
18 MTW2_Sword_Primary
14 fs_test_shield 0
16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
These are the animations used by the unit. They are probably the hardest part of the ModelDB to read. The “4 none” states that the unit doesn’t now use a mount. Next up it says that he uses the slow swordsman animationset and the “fs_test_shield” line says that he uses a shield animation for his off hand.
Now you are interested in changing textures of this unit so see the red and blue highlighted part red part is the texture faction wise for the figure of the unit while blue about attachments that is sword, shield etc etc.
So you have to edit those textures types to make a difference. Also you will find that this file is used by many units so if you change the texture it will affect say 5-6 units. To skip this from happening you will save the texture with a different name and then put the info in the modeldb, how?
Say you changed
Code:
74 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_england.texture
After that rename the file to something else like "mtw2_EN_Pplate_england.texture" to "mtw2_TWC_Pplate_england.texture"
Now you can see i increased the characters by one and the file name is changed so put them back and increase the count by 1.
Code:
75 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_TWC_Pplate_england.texture
So that's the max i can tell you and if you still don't get it then let me go to Sahara desert first and do this
