PDA

View Full Version : For programmers: sample texture file from Caliban



Epistolary Richard
12-05-2006, 21:51
From Caliban - no time to explain more at present, but I thought I'd whack it up and let the programmers amongst us at it.

NB - these are for research purposes only, you will not be able to get this stuff into game at this time

NB2 - this file is in rar format, if you can't uncompress rars then download a free programme such as IZarc.

DOWNLOAD (http://files.mizus.com/files/M2TW/documentation/M2_unit_xmls.rar)

_____ Caliban:
Heres the assets for a .texture example and the battle_models xml setup.
I will quickly run through how the system works. At the moment it may not be that usefull but should give a little insight into how the export process has changed from RTW.

export\unit_models\battle_models.battleXml - A standard xml format file that references the different type of unit setups. When this file is built (coverter process), it goes through the list of individual xml unit configs for each unit listed ( Export\unit_models\_Units\XML ), builds lods and pieces, and copies to the corrosponding data\unit_models\_units\ folder that is specified in the unit .xml config.
The individual unit xml files contain the unit type, its bonemap reference (list of bones in order from the skeleton), attachments, mesh lods (.gr2 from 3dsmax7) , torch params, diffuse normal and sprite textures for each faction and the associated skeletons (mounts and weapon types).

*note that we use \export\ folders for source artwork and configs which are then built and to the corrosponding \data\ folder. When the battle_models.battleXml file is processed, it creates the data\unit_modelsbattle_models.modelDB database file as well as processes all the individual unit xml setups contained within.


The Attachments (and where they live)

export\unit_models\battle_models.battleXml
export\unit_models\_Units\XML\Border_Horse.xml (this folder contains all the unit types and thier individual .xml files)
export\unit_models\_Units\EN_Peasant_Padded\textures\EN_Peasant_Padded_England.tga (original .tga from the source folder, this is the border horse rider)
data\unit_models\_Units\EN_Peasant_Padded\textures\EN_Peasant_Padded_england.texture (the converted result. very similar to .dds, contains mip-map levels much like a .dds)

___

Some examples from in the file:
https://img178.imageshack.us/img178/8203/enpeasantpaddedenglandrp6.th.jpg (https://img178.imageshack.us/my.php?image=enpeasantpaddedenglandrp6.jpg)

border_horse.xml

<Model>
<Type>Border_Horse</Type>
<BoneMap>unit_models\BoneMaps\soldier_bone_map_new.xml</BoneMap>
<AttachmentSet>unit_models\AttachmentSets\Final Kite.attSetXML</AttachmentSet>
<AttachmentGroups>
<Group>Cav Spear</Group>
<Group>Sword Secondary</Group>
</AttachmentGroups>
<Meshes>
<Mesh>
<FileName>unit_models\_Units\EN_Peasant_Padded\EN_padded_basic_lod0.gr2</FileName>
<Distance>11</Distance>
</Mesh>
<Mesh>
<FileName>unit_models\_Units\EN_Peasant_Padded\EN_padded_basic_lod1.gr2</FileName>
<Distance>30</Distance>
</Mesh>
<Mesh>
<FileName>unit_models\_Units\EN_Peasant_Padded\EN_padded_basic_lod2.gr2</FileName>
<Distance>50</Distance>
</Mesh>
<Mesh>
<FileName>unit_models\_Units\EN_Peasant_Padded\EN_padded_basic_lod3.gr2</FileName>
<Distance>80</Distance>
</Mesh>
</Meshes>
<Torch>
<Bone>bone_lhand</Bone>
<OffsetX>-0.09</OffsetX>
<OffsetY>0.0</OffsetY>
<OffsetZ>0.0</OffsetZ>
<WorldOffsetX>-0.35</WorldOffsetX>
<WorldOffsetY>0.8</WorldOffsetY>
<WorldOffsetZ>0.6</WorldOffsetZ>
</Torch>
<Textures>
<Texture>
<Diffuse>unit_models\_Units\EN_Peasant_Padded\textures\EN_Peasant_Padded_scotland.tga</Diffuse>
<Normal>unit_models\_Units\EN_Peasant_Padded\textures\EN_Peasant_Padded_normal.tga</Normal>
<Sprite>unit_sprites\scotland_Border_Horse_sprite.spr</Sprite>
<Faction>scotland</Faction>
</Texture>
<Texture>
<Diffuse>unit_models\_Units\EN_Peasant_Padded\textures\EN_Peasant_Padded_rebels.tga</Diffuse>
<Normal>unit_models\_Units\EN_Peasant_Padded\textures\EN_Peasant_Padded_normal.tga</Normal>
<Sprite>unit_sprites\slave_Border_Horse_sprite.spr</Sprite>
<Faction>slave</Faction>
</Texture>
</Textures>
<Skeletons>
<Skeleton>
<Mount>Horse</Mount>
<Primary>MTW2_HR_Spear</Primary>
<Secondary>MTW2_HR_Non_Shield</Secondary>
<PrimaryAttachment>MTW2_HR_spear_Primary</PrimaryAttachment>
<SecondaryAttachment>MTW2_Sword_Primary</SecondaryAttachment>
</Skeleton>
</Skeletons>
</Model>

the_mango55
12-05-2006, 22:17
Very cool. It's good to know that all the variations of a unit are in one file.

Is the tool used to convert to .texture going to be included with the upcoming patch/unpacker?

methoz
12-05-2006, 22:27
server dont work for me :(

Bwian
12-07-2006, 21:36
This all makes a lot of sense. It is, to be honest, exactly what I was expecting to see. It is a fairly common approach to use a text file to 'assemble' various mesh elements together. BF1942, for exaple, does this.

The flexibility it gives you allows the varioations in mesh to be done by changing the references for the added parts.

The texture layout is also interesting. There are a lot of variations on that texture for the units, which was not expected. I was expecting different textures to be referenced to change the look of the unit was it was upgraded, but it now looks more like different meshes referenced but using common texture files. 1024x1024 means there is a whole lot more texture for the artists to play with though. Beats 256x256 by....er....lots of pixels!

Methoz... right click and 'save as' worked for me.

carricanta
12-11-2006, 11:46
Server no work for me :help:

Thanks

Bandwidth Limit Exceeded

sjohund
12-13-2006, 14:43
What about Medieval 2 and pack files. How to unpack it to enter the world of textures??:juggle2:

scsscsfanfan
12-16-2006, 05:51
hi, now we have the unpack and there is "battle_models.modeldb" file there in the data\unit_models, but how how can I edit this file? use note pad or word/excel to open it dose not give an ordered text, do I need another tool?

thanks.

Casuir
12-16-2006, 12:20
When the battle_models.battleXml file is processed, it creates the data\unit_modelsbattle_models.modelDB database file as well as processes all the individual unit xml setups contained within.

You dont.

Casuir
12-16-2006, 12:34
Just looking through the files that came with the unpacker, it seems the games supports normal mapping. Sorry if this was already known, didnt notice it with my crappy pc. Means a hell of a lot more work for modellers though

how do you edit your posts here?

Epistolary Richard
12-17-2006, 23:10
You should get the ability soon.