Page 1 of 9 123456789 LastLast
Results 1 to 20 of 170

Thread: VariantMeshDefinitions files

  1. #1

    CA Developer Icon VariantMeshDefinitions files

    As you lot are really getting stuck into your modding I thought I'd provide some help by documenting the VariantMeshDefinition file format. I'll also do one on the unit tables as well.

    These file control the visual look of a unit and the equipment they hold. This is change from Shogun 2 where the unit_variant files control the visuals and the equipment was specified in the db.

    The VariantMeshDefinition files live in the VariantMeshes folder, most in the VariantMeshDefinitions folder but others throughout the folders in the _VariantModels folder.

    Let's take a look at what these files look like, they can be opened in notepad or any other text editor unlike the unit_variant files from Shogun 2. I will use Gre_Hoplites.VariantMeshDefinition as an example.

    Code:
    <VARIANT_MESH>
        <SLOT name="skin" >
            <VARIANT_MESH>
                <SLOT name="hair" >
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/skin/greek_game_skin.VariantMeshDefinition" />
                </SLOT>
                <SLOT name="beards" />
                <SLOT name="helmets" >
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/helmets/hellenic_thracians_basic.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/helmets/hellenic_thracians_crests.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/helmets/hellenic_attic.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/helmets/hellenic_attic_crest.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/helmets/hellenic_phyrgians_basic.VariantMeshDefinition" />
                </SLOT>
                <SLOT name="clothing" >
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/armour/linothorax.VariantMeshDefinition" />
                </SLOT>
                <SLOT name="cloaks" />
                <SLOT name="greaves" >
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/greaves/greaves.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/greaves/graves_basic.VariantMeshDefinition" />
                </SLOT>
                <SLOT name="shield" attach_point="weapon_03" >
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/shield/hellenic_hoplon_painted_hoplite.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/shield/hellenic_hoplon_painted_hoplite.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/shield/hellenic_hoplon_painted_hoplite.VariantMeshDefinition" />
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/shield/hellenic_hoplon_hoplite.VariantMeshDefinition" />
                </SLOT>
                <SLOT name="weapon_1" attach_point="weapon_01" >
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/weapons/short_spears.VariantMeshDefinition" />
                </SLOT>
                <SLOT name="weapon_2" />
                <SLOT name="weapon_3" />
                <SLOT name="weapon_4" />
            </VARIANT_MESH>
        </SLOT>
    </VARIANT_MESH>
    As you can see this file does not reference any model files itself, instead it references other VariantMeshDefinition files that have been setup as certain collections of armour, shields, weapons, helmets and so on. This is how the vast majority of units in Rome II were put together visually, and many reference the same VariantMeshDefinitions. This system allows for much faster construction of these definitions and for easier updating of files as an update in one of the reference VariantMeshDefinitions will filter through to all the files that use it.

    It is important to note that whilst most of the slot names up there are arbitrary, there are some which are required for most definitions and those are the shield and weapon slots.

    Each one is mapped to a weapon bone, which you can see set for the shield and weapon_1 slots for the hoplites. The mapping is:

    Code:
    "weapon_1": bone_1
    "weapon_2": bone_2
    "shield": bone_3
    "weapon_3": bone_4
    "weapon_4": bone_5
    Weapons are then assigned to those bones in this way:
    Code:
    Sword              Weapon bone 2 
    Gladius            Weapon bone 2 
    Spear              Weapon bone 1
    Javelin             Weapon bone 5
    Shield              Weapon bone 3
    Pike                 Weapon bone 1
    Falx                 Weapon bone 1
    Standard         Weapon bone 1
    Bow                Weapon bone 4
    Arrow             Weapon bone 5
    Sling               Weapon bone 1
    Stones                 Weapon bone 5
    Rhomphaia        Weapon bone 1
    Club                Weapon bone 2 
    Dagger           Weapon bone 2 
    Sword              Weapon bone 2 
    Gladius            Weapon bone 2 
    Spear              Weapon bone 1
    Javelin             Weapon bone 1
    Shield              Weapon bone 3
    Pike                 Weapon bone 1
    Falx                 Weapon bone 1
    Standard         Weapon bone 1
    Bow                Weapon bone 4
    Arrow             Weapon bone 5
    Sling               Weapon bone 1
    Stones                 Weapon bone 5
    Rhomphaia        Weapon bone 1
    Club                Weapon bone 2 
    Dagger           Weapon bone 2
    If you don't stick to this you could see weapons appearing in the wrong place or not at all.

    The next step is to look at some of the referenced files, starting with the linothorax file referenced in the clothing slot.

    Code:
    <VARIANT_MESH>
        <SLOT name="tunics" >
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/hellenic_tunic_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/hellenic_tunic_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/hellenic_tunic_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/hellenic_tunic_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/hellenic_tunic_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  mask0="1"  mask1="0" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/hellenic_tunic_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  mask0="2"  mask2="0" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/italian_tunic1_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/italian_tunic1_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/italian_tunic1_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  mask1="2"  mask2="1" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/italian_tunic1_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  mask1="2"  mask2="1" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/italian_tunic1_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  mask0="1"  mask1="0" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/italian_tunic1_cut.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  mask0="2"  mask2="0" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_01.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_02.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_03.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/linothorax_basic_04.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/carthaginian_linothorax_a.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
        </SLOT>
    </VARIANT_MESH>
    Here you can see where models are referenced along with the models that are used to construct the imposters. Important note: please only use the existing modles that are specified for imposters, adding in different ones will affect the amount of texture memory used for imposters and could affect the quality of them.

    You can see that there are multiple of the same entry in this file, this is to set the variety in a unit, generally it set so 60% of a reference use the primary colour, 20% the secondary colour and 20% the tertiary colour. The last two are set via the
    Code:
    mask1="2"  mask2="1"
    you can see. Unlike in Shogun 2 where the colour masks used by a part were set by the textures now it is specified in the definition. This allows for a lot more flexibility and reduces the amount of textures needed.

    A look at a helmet mesh ref helps show more on how the files are setup:

    This is the one for roman_montefortinos.
    Code:
    <VARIANT_MESH>
        <SLOT name="helmets" >
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino.rigid_model_v2" >
                <SLOT name="top_crests" probability ="0.8" attach_point="crest_centre" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_03.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_03.rigid_model_v2" />
                </SLOT>
                <SLOT name="side_crests" />
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino2.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino.rigid_model_v2" >
                <SLOT name="top_crests" probability ="0.8" attach_point="crest_centre" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_03.rigid_model_v2" />
                </SLOT>
                <SLOT name="side_crests" />
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino3.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino.rigid_model_v2" >
                <SLOT name="top_crests" probability ="0.8" attach_point="crest_centre" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_03.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_03.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_horsehair_split_01.rigid_model_v2" />
                </SLOT>
                <SLOT name="side_crests" />
            </VARIANT_MESH>
        </SLOT>
    </VARIANT_MESH>
    Notice that you can set a probability for slots that will dictate the chance of it being shown for an individual soldier in a unit.

    hellenic_phyrgian_crests meanwhile shows how crests are specified:
    Code:
    <VARIANT_MESH>
        <SLOT name="helmets" >
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/helmets/hellenic_phyrgian_2.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino.rigid_model_v2" >
                <SLOT name="top_crests" probability ="0.4" attach_point="crest_centre" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/phyrgian_crest_1_black.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/phyrgian_crest_1_red.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/phyrgian_crest_1_white.rigid_model_v2" />
                </SLOT>
                <SLOT name="side_crests" probability ="0.5" attach_point="crest_left,crest_right" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_01_base.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/red_feather_01_base.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/white_feather_01_base.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/helmets/hellenic_phyrgian_cheekplates.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino.rigid_model_v2" >
                <SLOT name="top_crests" attach_point="crest_centre" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/phyrgian_crest_1_black.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/phyrgian_crest_1_red.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/phyrgian_crest_1_white.rigid_model_v2" />
                </SLOT>
                <SLOT name="side_crests" attach_point="crest_left,crest_right" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/red_feather_01_base.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/white_feather_01_base.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_01_base.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/helmets/hellenic_phyrgian_simple.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/helmets/roman_montefortino.rigid_model_v2" >
                <SLOT name="top_crests" attach_point="crest_centre" />
                <SLOT name="side_crests" attach_point="crest_left,crest_right" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/white_feather_01_base.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/black_feather_01_base.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/crests/red_feather_01_base.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
        </SLOT>
    </VARIANT_MESH>
    Almost every single helmet has crest_centre and crest_left/right attach points though there are some exceptions.

    The other big change from Shogun 2 is texture arrays and shield patterns. They are not part of the shield texture but are instead a decal that gets applied on top.

    hellenic_hoplon_painted_hoplite shows how they are linked to a shield:
    Code:
    <VARIANT_MESH>
        <SLOT name="shields" >
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted2.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted2.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted2.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask1="2"  mask2="1" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted2.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask1="2"  mask2="1" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted2.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask0="1"  mask1="0" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted2.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask0="2"  mask1="0"  mask2="1" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted1.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted1.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted1.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask1="2"  mask2="1" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted1.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask1="2"  mask2="1" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted1.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask0="1"  mask1="2"  mask2="0" />
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon_painted1.rigid_model_v2"  decal_diffuse="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_diffuse"  decal_normal="VariantMeshes/_VariantModels/man/patterns/hellenic/decal_normal"  imposter_model="VariantMeshes/_VariantModels/man/shield/hellenic_shield_hoplon.rigid_model_v2"  mask0="2"  mask2="0" />
        </SLOT>
    </VARIANT_MESH>
    The texture_array looks like this:
    Code:
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_dolphin_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_elephant_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_goat_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_gorgon_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_horse_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_horse_head_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_lion_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_octopus_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_pegasus_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_poseidon_spear_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_scorpion_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_snake_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_zeus_lightning1_diffuse
    VariantMeshes/_VariantModels/man/patterns/hellenic/oval_shield_hellenic_zeus_lightning2_diffuse
    With texture_array files you need to make sure there are the same number of entries in the diffuse and normal files.

    I'm hoping you can see the flexibility there is in setting up VariantMeshDefinitions with a huge variety of options in how they can be setup and in how the look of units is controlled. I hope this information is a useful starting point for you all.
    Senior Designer

    Disclaimer: Any views or opinions expressed here are those of the poster and do not necessarily represent the views or opinions of The Creative Assembly or SEGA.

  2. #2
    Indefinitely Banned
    Join Date
    Nov 2011
    Location
    The western part of an Island They thought a kind of Coffee...
    Posts
    1,932

    Default Re: VariantMeshDefinitions files

    ...This means a unit can use different weapons, if the differing weapons uses the same bone and animation...and shares the stats..

  3. #3
    Noif de Bodemloze's Avatar The Protector of Art
    Content Emeritus

    Join Date
    Apr 2009
    Location
    Finland
    Posts
    5,733

    Default Re: VariantMeshDefinitions files

    Hey Lusted! I noticed one trick in this, I have tried this and I took sample about Hastati. Ingame, I see they wearing two different roman breastplate but in variantmesh, it show only 1, does it mean that we can't separate two different breastplate from each other?

  4. #4

    Default Re: VariantMeshDefinitions files

    Hey Lusted! I noticed one trick in this, I have tried this and I took sample about Hastati. Ingame, I see they wearing two different roman breastplate but in variantmesh, it show only 1, does it mean that we can't separate two different breastplate from each other?
    Remember that they use a reference:

    Code:
                <SLOT name="torso" >
                    <VARIANT_MESH_REFERENCE definition="VariantMeshes/_VariantModels/man/armour/roman_chestplate.VariantMeshDefinition" />
                </SLOT>
    Navigate to that file and you will see:

    Code:
    <VARIANT_MESH>
        <SLOT name="tunics" >
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/italian_square_muscled_cuirass_A.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/italian_square_muscled_cuirass_A.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
            <VARIANT_MESH model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/tunics/e3_tunic.rigid_model_v2"  mask0="2"  mask2="0" >
                <SLOT name="armour" >
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/italian_square_muscled_cuirass_A.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                    <VARIANT_MESH model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2"  imposter_model="VariantMeshes/_VariantModels/man/armour/Italian_Square_Muscled_Cuirass_C.rigid_model_v2" />
                </SLOT>
            </VARIANT_MESH>
        </SLOT>
    </VARIANT_MESH>
    This is how most units are setup, you will need to edit the referenced definitions, or setup new ones and then reference those in the VariantMeshDefinition for a unit.
    Senior Designer

    Disclaimer: Any views or opinions expressed here are those of the poster and do not necessarily represent the views or opinions of The Creative Assembly or SEGA.

  5. #5
    Noif de Bodemloze's Avatar The Protector of Art
    Content Emeritus

    Join Date
    Apr 2009
    Location
    Finland
    Posts
    5,733

    Default Re: VariantMeshDefinitions files

    Thanks Lusted! I will start look and learn these stuffs.

  6. #6

    Default Re: VariantMeshDefinitions files

    Excellent!

    I'll start modding to Pontic Bronze Shields by updating their armor to scale one.

    Very good!

  7. #7

    Default Re: VariantMeshDefinitions files

    Appreciate the assistance, thanks Lusted.

    Curious - since you used the e3 models/textures as the example. I'll take a look at them myself soon but are they very different from the current variants of those armor?

  8. #8

    Default Re: VariantMeshDefinitions files

    Appreciate the assistance, thanks Lusted.

    Curious - since you used the e3 models/textures as the example. I'll take a look at them myself soon but are they very different from the current variants of those armor?

  9. #9

    Default Re: VariantMeshDefinitions files

    Quote Originally Posted by Ahiga View Post
    Appreciate the assistance, thanks Lusted.

    Curious - since you used the e3 models/textures as the example. I'll take a look at them myself soon but are they very different from the current variants of those armor?
    The e3 tunic is the one the Roman units wear. One of the first parts made and was redone during development but kept its name.
    Senior Designer

    Disclaimer: Any views or opinions expressed here are those of the poster and do not necessarily represent the views or opinions of The Creative Assembly or SEGA.

  10. #10

    Default Re: VariantMeshDefinitions files

    I just wanna ask you one thing dear Jack, if you show me a way id be delighted!

    I'm looking for colorize individual units apart from then general faction color scheme. Which document the file is needs to reviewed to achieve that.

    Thank you, and i apoligize if i've been off topic,


  11. #11
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: VariantMeshDefinitions files

    Something I experimented with yesterday was dual wielding, doesn't work perfectly, there are slight animation problems, but overall it was pretty funny.


  12. #12

    Default Re: VariantMeshDefinitions files

    Is there a way to edit models or add own models?

    Also when I edit a texture, it always appears glitched in the game with lots of colours I didn't even use.
    Prof's Mods (Attila Mods)
    Creator of Polemarchia: Total War
    Under the patronace of Epistolary Richard
    <- Now with Attila screens

  13. #13

    Default Re: VariantMeshDefinitions files

    double post
    Last edited by Prof; September 09, 2013 at 12:37 PM.
    Prof's Mods (Attila Mods)
    Creator of Polemarchia: Total War
    Under the patronace of Epistolary Richard
    <- Now with Attila screens

  14. #14

    Default Re: VariantMeshDefinitions files

    Hell yea!

    I made it at last

    Here we go lads.

    Pontic Bronze Shields
    Difference is scale armor set
    Spoiler Alert, click show to read: 






    Pontic Peltasts
    Difference is eastern head models
    Spoiler Alert, click show to read: 




    I'm so proud of me! So excited!

    And big thanks goes to jack for guidance and the tools of our beloved community!

    Now, i'm fully dedicated to make a Pontic army mod!
    Last edited by Little Legionaire; September 09, 2013 at 06:29 PM.

  15. #15

    Default Re: VariantMeshDefinitions files

    Lusted

    Thank you for the support
    Last edited by L'aigle; September 09, 2013 at 06:04 PM.

  16. #16

    Default Re: VariantMeshDefinitions files

    Thank you very much Jack Justed! Your help is appreciated and most welcome! Little Legionaire, I cant see your images
    Don't smoke the seed

  17. #17

    Default Re: VariantMeshDefinitions files

    Alrighty, so a slightly on topic question. I've successfully modified the crests on a helmet, replaced armor, shields, and helms for a unit, but now I'm stuck on one more thing I'm looking to add. Is there an actual full length cape/cloak somewhere in the models pack? All of the ones I've tried so far are thigh/knee length, I'm looking for one thats floor length. Failing that, is there any simply way to create a floor length cloak?

  18. #18

    Default Re: VariantMeshDefinitions files

    Ok, edited

  19. #19
    Kinjo's Avatar Taiko
    Join Date
    Oct 2003
    Location
    United States
    Posts
    5,753

    Default Re: VariantMeshDefinitions files

    Thanks Lusted!

    I was able to fix your Parthian swordsmen

    http://www.twcenter.net/forums/showt...-Swordsmen-mod

  20. #20
    Hrobatos's Avatar Tribunus
    Join Date
    Dec 2009
    Location
    Berlin, Germany
    Posts
    7,454

    Default Re: VariantMeshDefinitions files

    Great! Love to see that CA is supporting modding.

Page 1 of 9 123456789 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •