Results 1 to 20 of 20

Thread: Updated formatted modeldb file and associated syntax checker

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Gognard Member MikeV's Avatar
    Join Date
    Jan 2005
    Location
    Sunny Melbourne (Florida, USA)
    Posts
    203

    Lightbulb Re: Deciphering the battle_models.modeldb file

    A more interesting example:
    Code:
    27 mount_teutonic_barded_horse 
    1.12 3 
    60 unit_models/Mounts/Barded_Horse/mount_barded_horse_lod0.mesh 121 
    60 unit_models/Mounts/Barded_Horse/mount_barded_horse_lod1.mesh 1225 
    60 unit_models/Mounts/Barded_Horse/mount_barded_horse_lod2.mesh 10000 
    1 
    3 hre 
    77 unit_models/Mounts/Barded_Horse/textures/horse_barding_teutonic_order.texture 
    69 unit_models/Mounts/Barded_Horse/textures/horse_barding_normal.texture 
    57 unit_sprites/teutonic_order_Mount_Barded_Horse_sprite.spr  
    0 
    1 
    5 Horse 14 fs_heavy_horse 0  
    0 
    0 
    -1 0 0 0 0 0 0
    The mount_teutonic_barded_horse entry (available only the hre faction) is meant to be used from another entry in this file. Although the animation Record lists the mount name as "Horse" and Primary weapon as "fs_heavy_horse", is has neither a Primary nor a Secondary weapon animation. Note that the animation timing line starts with a -1 and has all zeros. Presumably, the code "knows" what to do with this situation.

    Interestingly, even the upgraded Teutonic Knights unit only mentions a generic Horse as a mount:
    Code:
    20 teutonic_knights_ug2 
    1 3 
    65 unit_models/_Units/EN_Pplate_Plate/teutonic_knights_ug2_lod0.mesh 121 
    65 unit_models/_Units/EN_Pplate_Plate/teutonic_knights_ug2_lod1.mesh 1225 
    65 unit_models/_Units/EN_Pplate_Plate/teutonic_knights_ug2_lod2.mesh 6400 
    1 
    3 hre 
    70 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_hre.texture 
    73 unit_models/_Units/EN_Pplate_Plate/textures/mtw2_EN_Pplate_normal.texture 
    45 unit_sprites/hre_NE_Late_Bodyguard_sprite.spr 
    1 
    3 hre 
    64 unit_models/AttachmentSets/Final Heater Special_hre_diff.texture 
    64 unit_models/AttachmentSets/Final Heater Special_hre_norm.texture 
    0  
    1 
    5 Horse 13 MTW2_HR_Lance 12 MTW2_HR_Mace 
    2 21 MTW2_HR_Lance_Primary 14 fs_test_shield 
    2 17 MTW2_Mace_Primary 14 fs_test_shield 
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    Forums are good for sharing questions, wikis are good for sharing answers:
    Spoiler Alert, click show to read: 
    Check out the Online ETW Data in the Totalwar.org wiki.

  2. #2
    Gognard Member MikeV's Avatar
    Join Date
    Jan 2005
    Location
    Sunny Melbourne (Florida, USA)
    Posts
    203

    Lightbulb Re: Deciphering the battle_models.modeldb file

    How about siege units and their crews? Here's a Greek Trebuchet crew's definition:
    Code:
    20 greek_trebuchet_crew 
    1 4 
    70 unit_models/_Units/ES_Greek_Greek_Heavy/greek_trebuchet_crew_lod0.mesh 121 
    70 unit_models/_Units/ES_Greek_Greek_Heavy/greek_trebuchet_crew_lod1.mesh 900 
    70 unit_models/_Units/ES_Greek_Greek_Heavy/greek_trebuchet_crew_lod2.mesh 2500 
    70 unit_models/_Units/ES_Greek_Greek_Heavy/greek_trebuchet_crew_lod3.mesh 6400 
    1 
    9 byzantium 
    80 unit_models/_Units/ES_Greek_Greek_Heavy/textures/mtw2_es_greek_byzantium.texture 
    77 unit_models/_Units/ES_Greek_Greek_Heavy/textures/mtw2_es_greek_normal.texture 
    53 unit_sprites/byzantium_Greek_Ballista_Crew_sprite.spr 
    1 
    9 byzantium 
    70 unit_models/AttachmentSets/Final European Light_byzantium_diff.texture 
    70 unit_models/AttachmentSets/Final European Light_byzantium_norm.texture 
    0  
    1 
    4 None 14 MTW2_Trebuchet 0  
    1 18 MTW2_Knife_Primary 
    0 
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    They have only a Knife for a Primary weapon animation, and no Secondary -- clearly, no match for a serious melee unit!

    But note that their Primary weapon is listed as a Trebuchet. Hmm...

    Over in the export_descr_units.txt ("EDU") file, this entry references the Greek_Trebuchet_Crew:
    Code:
    type             GR Trebuchet
    dictionary       GR_Trebuchet      ; Trebuchet
    category         siege
    class            missile
    voice_type       Heavy
    banner faction   main_missile
    banner holy      crusade
    soldier          Greek_Trebuchet_Crew, 16, 2, 1
    engine           trebuchet
    attributes       sea_faring, can_withdraw, hardy, artillery
    formation        1.5, 1.5, 3, 3, 3, square
    stat_health      1, 0
    stat_pri         7, 3, no, 0, 0, melee, artillery_mechanical, piercing, knife, 25, 1.8
    ;stat_pri_ex      0, 0, 0
    stat_pri_attr    no
    stat_sec         55, 3, trebuchet, 285, 30, siege_missile, artillery_mechanical, blunt, none, 25, 1
    ;stat_sec_ex      0, 0, 0
    stat_sec_attr    ap, bp, area, launching
    stat_ter         12, 3, cow_carcass, 215, 3, siege_missile, artillery_mechanical, blunt, none, 25, 1
    ;stat_ter_ex      0, 0, 0
    stat_ter_attr    ap, bp, area, launching,
    stat_pri_armour  2, 5, 0, leather
    ;stat_armour_ex   2, 0, 0, 0, 5, 0, 0, leather
    stat_sec_armour  0, 0, flesh
    stat_heat        1
    stat_ground      0, 0, 0, 0
    stat_mental      9, disciplined, highly_trained
    stat_charge_dist 30
    stat_fire_delay  0
    stat_food        60, 300
    stat_cost        1, 430, 250, 60, 140, 430, 1, 120
    armour_ug_levels 1
    armour_ug_models Greek_Trebuchet_Crew
    The Trebuchet is one of the few EDU entries to have a 3rd (tertiary) weapon (the cow_carcass -- so much fun! ).

    And we have this comment in that file about the stat_pri entry:
    Details of unit's primary weapon. If the unit has a missile weapon it must be the primary
    So, apparently, the "_crew" unit type is a special case.
    Forums are good for sharing questions, wikis are good for sharing answers:
    Spoiler Alert, click show to read: 
    Check out the Online ETW Data in the Totalwar.org wiki.

  3. #3
    Gognard Member MikeV's Avatar
    Join Date
    Jan 2005
    Location
    Sunny Melbourne (Florida, USA)
    Posts
    203

    Lightbulb Re: Deciphering the battle_models.modeldb file

    Here's another interesting example, the basis for General units:
    Code:
    16 northern_general 
    1 4 
    78 unit_models/_Generals_and_Captains/Northern_General/northern_general_lod0.mesh 121 
    78 unit_models/_Generals_and_Captains/Northern_General/northern_general_lod1.mesh 900 
    78 unit_models/_Generals_and_Captains/Northern_General/northern_general_lod2.mesh 2500 
    78 unit_models/_Generals_and_Captains/Northern_General/northern_general_lod3.mesh 6400 
    18 
    7 england 
    89 unit_models/_Generals_and_Captains/Northern_General/textures/late_general_england.texture 
    88 unit_models/_Generals_and_Captains/Northern_General/textures/late_general_normal.texture 
    0  
     ... 
    18 
    7 england 
    61 unit_models/AttachmentSets/Final General_england_diff.texture 
    61 unit_models/AttachmentSets/Final General_england_norm.texture 
    0  
     ...
    4 
    4 None 15 MTW2_Non_Shield 0  1 18 MTW2_Sword_Primary 0 
    5 horse 18 MTW2_HR_Non_Shield 0  1 18 MTW2_Sword_Primary 0 
    8 elephant 18 MTW2_Elephant_Crew 0  1 18 MTW2_Sword_Primary 0 
    5 camel 18 MTW2_HR_Non_Shield 0  1 18 MTW2_Sword_Primary 0 
    -1 0 0 0 0 0 0
    Note that there are no sprite files. And the animation section has a List of 4 entries -- one for dismounted, and one for each known type of mount. But no animation timing. Looks like another special case, or a stub of earlier work no longer used?

    For comparison, here's the entry for a Northern European Bodyguard unit:
    Code:
    12 ne_bodyguard 
    1 4 
    56 unit_models/_Units/EN_Lmail_Hmail/ne_bodyguard_lod0.mesh 121 
    56 unit_models/_Units/EN_Lmail_Hmail/ne_bodyguard_lod1.mesh 900 
    56 unit_models/_Units/EN_Lmail_Hmail/ne_bodyguard_lod2.mesh 2500 
    56 unit_models/_Units/EN_Lmail_Hmail/ne_bodyguard_lod3.mesh 6400 
    10 
    7 england 
    73 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_england.texture 
    72 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_normal.texture 
    44 unit_sprites/england_NE_Bodyguard_sprite.spr 
     ...
    7 england 
    60 unit_models/AttachmentSets/Final Heater_england_diff.texture 
    60 unit_models/AttachmentSets/Final Heater_england_norm.texture 
    0  
     ...
    1 
    5 Horse 13 MTW2_HR_Lance 13 MTW2_HR_Sword 
    2 21 MTW2_HR_Lance_Primary 14 fs_test_shield 
    2 18 MTW2_Sword_Primary 14 fs_test_shield 
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    This time there's an entry for a sprite file, and sensible values for Primary and Secondary (Horse Rider) weapon animations.
    Last edited by MikeV; 05-21-2008 at 00:37. Reason: Added that "HR" stands for "Horse Rider"
    Forums are good for sharing questions, wikis are good for sharing answers:
    Spoiler Alert, click show to read: 
    Check out the Online ETW Data in the Totalwar.org wiki.

  4. #4
    Gognard Member MikeV's Avatar
    Join Date
    Jan 2005
    Location
    Sunny Melbourne (Florida, USA)
    Posts
    203

    Lightbulb Re: Deciphering the battle_models.modeldb file

    Finally, you should know that there are various "test" entries in the file. Here's one example, for a 2-handed Swordsman unit:
    Code:
    19 baltest_2hswordsman 
    1 4 
    63 unit_models/_Units/EN_Lmail_Hmail/baltest_2hswordsman_lod0.mesh 121 
    63 unit_models/_Units/EN_Lmail_Hmail/baltest_2hswordsman_lod1.mesh 900 
    63 unit_models/_Units/EN_Lmail_Hmail/baltest_2hswordsman_lod2.mesh 2500 
    63 unit_models/_Units/EN_Lmail_Hmail/baltest_2hswordsman_lod3.mesh 6400 
    2 
    7 england 
    73 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_england.texture 
    72 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_normal.texture 
    0  
    6 france 
    72 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_france.texture 
    72 unit_models/_Units/EN_Lmail_Hmail/textures/EN_Lmail_Hmail_normal.texture 
    0  
    2 
    7 england 
    60 unit_models/AttachmentSets/Final Heater_england_diff.texture 
    60 unit_models/AttachmentSets/Final Heater_england_norm.texture 
    0  
    6 france 
    59 unit_models/AttachmentSets/Final Heater_france_diff.texture 
    59 unit_models/AttachmentSets/Final Heater_france_norm.texture 
    0  
    1 
    4 None 16 MTW2_2HSwordsman 0  
    1 24 MTW2_2HSwordsman_Primary 
    0 
    16 -0.090000004 0 0 -0.34999999 0.80000001 0.60000002
    It's useful as a starting "blank," adding your own factions, textures, etc. You'll need to add the right sprite file, though.

    --
    That's it, for now. If anyone deciphers other details of this file, please feel free to add your comments.

    Happy modding ...
    Forums are good for sharing questions, wikis are good for sharing answers:
    Spoiler Alert, click show to read: 
    Check out the Online ETW Data in the Totalwar.org wiki.

  5. #5
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: Updated formatted modeldb file and associated syntax checker

    Hi MikeV,

    Thanks for the bump, this post has slept for a long time.
    You probably know this but up at the top is a unit count as well,
    that's the 701. When you add entries you need to increment this
    or they don't get read. That is, if you add at the bottom.
    You can cut and paste entries in the middle and those baltest
    units roll off the bottom and you don't get in trouble until you add
    enough units to hit those in game. Also, check out descr_skeleton.txt
    which defines the animation families that the modeldb file uses for the
    units.

    Anyway, not the point of the reply. Your user name carries programmer
    under it. Do you have any experience with binary files? What do you like
    to program in? C, Java, Python, any of the above? I have a question in
    mind, would you be interested in looking at settlement files, specifically
    the .world files that define the structures you see on the battlefield like
    villages, towns, large towns, etc. I've spent several months looking at these
    but just don't have the time to carry it through. Don't commit now but
    have a look at these threads to look at the issue.

    https://forums.totalwar.org/vb/showthread.php?t=88241

    https://forums.totalwar.org/vb/showthread.php?t=89573

    No kidding, these .world files are huge and complex so I don't think any
    sort of complete understanding is possible. However, they do define the
    the structures used by the game for making the buildings and this is
    understood. The hope is to pull this information out, import to 3ds Max
    and modify it, export out again, and reassemble the .world file. A lot of
    modders would love to be able to get at this data and mod it so see
    what you think.

    Best Regards,

    KE

  6. #6
    blaaaaaaaaaarg! Senior Member Lusted's Avatar
    Join Date
    Feb 2005
    Posts
    1,773

    Default Re: Updated formatted modeldb file and associated syntax checker

    -0.34999999 0.80000001 0.60000002
    Those are the torch offset values(hence why set to 0 for mounts).

  7. #7
    Member Member KnightErrant's Avatar
    Join Date
    Jan 2007
    Location
    Huntsville, Alabama USA
    Posts
    458

    Default Re: Updated formatted modeldb file and associated syntax checker

    Ah, thanks Lusted. Yes, that reminds me, we were given the
    xml layout for this. It's in ER's thread:

    https://forums.totalwar.org/vb/showthread.php?t=74083

    This gives the way CA views the creation of modeldb entries
    and shows what those termination floats represent for offsets.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO