Results 1 to 30 of 652

Thread: A start on the .MESH file format

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member Senior Member Caliban's Avatar
    Join Date
    May 2005
    Location
    Brisbane, Australia
    Posts
    66

    Default Re: A start on the .MESH file format

    Quote Originally Posted by KnightErrant
    Do you have any more information concerning the mystery block(s)?
    Can we really ignore it or is it in fact some other type of information?
    Engine guy is still on holidays, I'll prod him again next time I see him. My guess is that they are unused and can probably be ignored. A test should be able to tell but I'll find out for sure.

    Quote Originally Posted by Andromachus Theodoulos
    @Caliban...
    Thanks for your help on this and your gentle guidance...
    Aww shucks

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

    Default Re: A start on the .MESH file format

    Thanks Caliban! Casuir has reported a test a few
    posts back, where he removed the mystery blocks and changed
    the 3 to a 0 in the header/footer line above where they appeared,
    and suffered no ill effects with the game. I'll assume they
    can be safely ignored.

    Casuir also reported that there is at least one variant mesh format
    where the vertex bone assignment block follows the mystery block
    rather than proceeds it. I've only partially found all the changes but
    the very first header/footer line is different between "regular" units
    and these variants so I think it can be programmed around. Is this a
    granny thing or just different ways that your guys assemble the
    mesh files? Just wondering if we should be on the lookout for other
    variant type meshes. (It's the az_body_suit types where he says
    most of these variants are.)

  3. #3

    Default Re: A start on the .MESH file format

    Hi Guys

    Lots of great things happening here, great to see!!

    I've written some code, at the moment there is an alpha .MESH to .MS3D converter that exports bones and weights as well as the mesh and groups, there is also a pre alpha utility to load a .MESH file to screen and texture it with .TEXTURE files. Here's a screen pic https://i150.photobucket.com/albums/...estingmesh.jpg
    . The texture in the background will be for UV adjustments but the code I've written for that is very slow and cluncky - major rewrite here.

    The figures in the Aztec bodysuit folder are different in that the initial header is 4 bytes shorter, could be because there is only a body group and no leg group? - Could be a clue to the make up of the initial header. I've put an error trap in the converter to take care of this. Some of the figures in the folders seem to be WIP or base figures.

    I've PM'd a few guys to test the converter, and I'll see what happens with their results.

    If you're looking at alternative formats there is the .SMD format that's also supported by milkshape, it has vertex weighting (HL2) and allows export of animations only.

    Cheers

    GrumpyOldMan

  4. #4
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: A start on the .MESH file format

    Holy reverse engineering, Batman!

    GOM isn't kidding, there's a lot of great things happening here. I'm a bit amazed at how quickly everything is getting figured out and implemented. I'm probably never going to edit a mesh for this game, and yet you guys have me all fired up for the importer/exporter tool to be done. It's almost like I can feel how badly everybody wants it, and see all the awesome visual mods that'll happen following briskly on the heels of this project.

    Keep up the good work so I can keep on being amazed


    See my Sig+ below! (Don't see it? Get info here)

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

    Default Re: A start on the .MESH file format

    Kudos! congratulations, a balloon , and more.
    Really great work! I'll look at more meshes
    tomorrow but so far no problems at all. If there's anything
    you need for the reverse process, unit surveys looking at
    header/footers etc. please don't hesitate to ask.
    I know the entire modding community is going
    to be thrilled at what you've done.

  6. #6
    Senior Member Senior Member Caliban's Avatar
    Join Date
    May 2005
    Location
    Brisbane, Australia
    Posts
    66

    Default Re: A start on the .MESH file format

    Quote Originally Posted by GrumpyOldMan
    The figures in the Aztec bodysuit folder are different in that the initial header is 4 bytes shorter, could be because there is only a body group and no leg group? - Could be a clue to the make up of the initial header. I've put an error trap in the converter to take care of this. Some of the figures in the folders seem to be WIP or base figures.

    If you're looking at alternative formats there is the .SMD format that's also supported by milkshape, it has vertex weighting (HL2) and allows export of animations only.
    Your right about not having leg variations. Models can be setup with many variations, or very few. This particular guy has a few body variations which include the legs all in the same mesh. Some units have seperate body, arm and leg variations.

    I'll list the different types of variations and attachment types that we can 'markup' in 3dsmax. Mesh variations are numbered such as 'arms01' 'arm02' 'arm03' in 3dsmax and then simply set by selecting the mesh and then the type of variation with our plugin/exporter tool.

    Variation Types:
    (all meshes except the bones are marked in 3dsmax as one of the following)

    Head
    Leg
    Arm
    Body
    Hands
    Helmet

    Attachment Types:
    (these can have different variations per set. Usefull for adding things like pouches, bags etc)

    Attachments
    Attachments1
    Attachments2
    Attachments3

    Weapons
    (this markup is used for exporting weapons and shield seperatley, these are not setup within the character file)

    Shield
    Sword

    Below is a 3dsmax7 character example with variations and attachments. Should work with 3dsmax7 or higher. It may prompt for our plugin, you should be able to simply press open to bypass it.

    http://www.filefactory.com/file/64e26c/

    .SMD format is not a bad idea, I'm also pretty familiar with it. It's quite widley documented and supported by all the big 3d Packages. I'm pretty sure the guys at Valve wouldn't mind you using it ;)
    Last edited by Caliban; 03-02-2007 at 08:00.

  7. #7

    Default Re: A start on the .MESH file format

    Generals and captains are another example of meshs with few variations. Any hard limit on the number of variations caliban or is it limited to what you can fit on a texture? Cheers for the maxfile too :)

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

    Default Re: A start on the .MESH file format

    @ GOM and Casuir
    I took your and Caliban's advice and looked at the
    .smd format (documented thank goodness!)
    I've got my script so it outputs all the uv, vertex weights,
    primary bone and secondary bone, plus the vertex normals
    in the .smd format by triangles.
    I'm confused by the node tree and skeleton pose data though.
    I just copied the bonestrings part of the .mesh file and put
    it in .smd format like

    Code:
    version 1
    ! Node tree or bone ID assignment section
    nodes
    0 "bone_pelvis" -1
    1 "bone_rthigh" 0
    2 "bone_rlowerleg" 1
    3 "bone_rfoot" 2
    4 "bone_abs" 3
    5 "bone_torso" 4
    6 "bone_head" 5
    7 "bone_jaw" 6
    8 "bone_eyebrow" 7
    9 "bone_rclavical" 8
    10 "bone_rupperarm" 9
    11 "bone_relbow" 10
    12 "bone_rhand" 11
    13 "bone_lclavical" 12
    14 "bone_lupperarm" 13
    15 "bone_lelbow" 14
    16 "bone_lhand" 15
    17 "bone_lthigh" 16
    18 "bone_llowerleg" 17
    19 "bone_lfoot" 18
    20 "bone_weapon01" 19
    20 "bone_weapon" 20
    21 "bone_weapon02" 20
    22 "bone_weapon03" 21
    22 "bone_shield01" 22
    22 "bone_shield" 22
    end
    but this probably isn't right since the first number is supposed to
    be the bone id and the second number is the parent id. Should
    the first number just go up monotonically or should I just remove
    duplicate weapon and shield entries?

    Second question is the skeleton pose block which is
    ID Posx Posy Posy Rotx Roty Rotz
    The spec says bones that are children of other bones
    report position and rotations in their parent's local space.
    The rotations are spec'd as Euler rotations in radians.
    I'm assuming this means body frame roll, pitch, and yaw (for x, y, and z).
    For now I'm just putting in 0's but this probably won't work.
    Can't test until I get home.

    Code:
    !Skeleton pose data
    Skeleton
    Time 0
    0 0.0 0.0 0.0 0.0 0.0 0.0
    1 0.0 0.0 0.0 0.0 0.0 0.0
    2 0.0 0.0 0.0 0.0 0.0 0.0
    3 0.0 0.0 0.0 0.0 0.0 0.0
    4 0.0 0.0 0.0 0.0 0.0 0.0
    5 0.0 0.0 0.0 0.0 0.0 0.0
    6 0.0 0.0 0.0 0.0 0.0 0.0
    7 0.0 0.0 0.0 0.0 0.0 0.0
    8 0.0 0.0 0.0 0.0 0.0 0.0
    9 0.0 0.0 0.0 0.0 0.0 0.0
    10 0.0 0.0 0.0 0.0 0.0 0.0
    11 0.0 0.0 0.0 0.0 0.0 0.0
    12 0.0 0.0 0.0 0.0 0.0 0.0
    13 0.0 0.0 0.0 0.0 0.0 0.0
    14 0.0 0.0 0.0 0.0 0.0 0.0
    15 0.0 0.0 0.0 0.0 0.0 0.0
    16 0.0 0.0 0.0 0.0 0.0 0.0
    17 0.0 0.0 0.0 0.0 0.0 0.0
    18 0.0 0.0 0.0 0.0 0.0 0.0
    19 0.0 0.0 0.0 0.0 0.0 0.0
    20 0.0 0.0 0.0 0.0 0.0 0.0
    20 0.0 0.0 0.0 0.0 0.0 0.0
    21 0.0 0.0 0.0 0.0 0.0 0.0
    22 0.0 0.0 0.0 0.0 0.0 0.0
    22 0.0 0.0 0.0 0.0 0.0 0.0
    22 0.0 0.0 0.0 0.0 0.0 0.0
    end
    It seems like we would lose the triangle mesh type names
    and mesh group names in this format. Would this matter?

  9. #9

    Default Re: A start on the .MESH file format

    Hi All

    Caliban

    Thanks for the information. I've noticed that as well as Attachment groups there are Equipment type groups - is there any difference? Also (probably getting ahead of myself) but with the shields some are shown as shieldpassive and some as shieldactive. I was looking at the Lithuanian cavalry man in particular and the active shield is strapped to the back and the passive shield is on the left forearm. Is the active shield used with active weapons, or is the active shield used with the primary weapon and the passive shield used with secondary weapon .

    Thanks again for all the information.

    Cheers

    GrumpyOldMan

  10. #10

    Default Re: A start on the .MESH file format

    Hi @KE

    I've just emailed you the node and skeleton information in smd format, you should be able to cut and paste. It was fairly simple to extract and export it in Milkshape from a converted .ms3d figure. I can give you instructions if you need them. The only drawback with smd and Milkshape at the present is that Milkshape is not importing smd with multiple weights, but this is due to change with the next release.

    Cheers

    GrumpyOldMan

  11. #11
    Senior Member Senior Member Caliban's Avatar
    Join Date
    May 2005
    Location
    Brisbane, Australia
    Posts
    66

    Default Re: A start on the .MESH file format

    Quote Originally Posted by GrumpyOldMan
    Thanks for the information. I've noticed that as well as Attachment groups there are Equipment type groups - is there any difference? Also (probably getting ahead of myself) but with the shields some are shown as shieldpassive and some as shieldactive.
    GrumpyOldMan
    I don't think there is a difference for equipment. You can have upto 4 different attachment types.

    For example:

    gunpowder pouch (attachment)
    sword shieth (attachment1)
    jewlery (attachment2)
    quiver (attachment3)

    Each of these attachment types can have multiple variations. There is no limit on variations for any of the meshes. They are simply marked as thier mesh type (attachment, attachment1, head, body etc etc) and then the individual variation meshes are named with a sequential numbering. Head01 head02 head03 head04, pouch01, pouch02, pouch03 etc. The engine then knows to choose one of each variation by its numbering.

    Passive and Active shields are exactly what they state. However, I really don't think it makes too much difference. Passive shields are supposed to be for being attached to the back and active attached to the fore-arm. (if they are around the other way it probably doesn't matter)

    There are no hard limits on variations. You can have 50 variations or more if you really wanted to but you would have a hard time fitting them onto a texture. It's possible to up the texture size to allow for more variations but you will be increasing memory usage a fair whack as you need to do this with normal maps too.

    You can get an .SMD importer/exporter for 3dsmax here: http://www.chaosincarnate.net/cannonfodder/cftools.htm
    Created by Cannon Fodder, this tool allows you to import the .smd mesh and then the .smd skeletal file. It will automatically rig the skeleton upto the imported mesh. It's probably alot more complete than the milkshape importer/exporter. Autodesk also offer 30 day trials on 3dsmax if you need to have a play around with it: http://usa.autodesk.com/adsk/servlet...112&id=5972446

  12. #12

    Default Re: A start on the .MESH file format

    Quote Originally Posted by GrumpyOldMan
    The figures in the Aztec bodysuit folder are different in that the initial header is 4 bytes shorter, could be because there is only a body group and no leg group? - Could be a clue to the make up of the initial header. I've put an error trap in the converter to take care of this. Some of the figures in the folders seem to be WIP or base figures.
    Sorry havent done much with this but been having major pc probs. Got a few converted off today with no errors and noticed that some are as you said base figures. Seem to be the models that were exported sans primarys and secondarys and recompiled later via the xmls. Compared a couple for changes in the initial header and noticed a few things. These are the headers from the jannisary_gunner and jannisary_musketeers meshs, models are identical bar the missing primary and secondarys:
    (leaving out the serialization::archive bit)

    Code:
    Musketeer:
    00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 00 04 00 01 03 01 00 00 
    00 00 00 07 00 01 00 02 00 00 00 00 00 15 00 00 00 00 00 0B 00 01 03 03
    00 00 00 04 00 00 00 
    
    Gunner
    xx xx xx xx 00 00 00 00 00 00 00 01 00 00 00 00 00 04 00 01 03 00 00 00
    00 00 00 07 00 01 00 01 00 00 00 00 00 0E 00 00 00 00 00 0B 00 01 03 02
    00 00 00 04 00 00 00
    I've marked the parts that are different in red, x'x at the start of the gunner code are there to represent the 4 bytes that are missing. I had a look at the guys in the az_body_suit folder and the guys in there missing 4 bytes look like base figures, theres corresponding meshs with weapons and the missing 4 bytes for them all, same goes for generals. It looks like every model thats used ingame has them. Only other bytes that change from file to file are the 15/0E which corresponds with the number of seperate meshs in the file and the 04 at the end, doesnt change between these two but I've noticed some mesh files have an 0C here instead. Other than that the header looks to stay the same between files.

    @Bwian, dunno about limits but the bosnian archer has 45 seperate meshs with 8 head variations

  13. #13

    Default Re: A start on the .MESH file format

    Bit more on the 04/0C value, it seems to relate to the mesh type that follows, all with 0C have an attachment as the first mesh in the file while those with 04 have a body part. Guessing its mesh variation header rather than the actual .mesh file one. Primary weapons have an 0E here, secondarys 10 and shields 07. Guess that makes the rest of the part between mesh variations footer rather than header.

    btw the geometry value for weapons and shields is added to the base model, meaning anyone who feels like tackling the hexediting should be able to make weapon kitbashs without needing an importer/exporter.

  14. #14

    Default Re: A start on the .MESH file format

    My apols GOM, see you already figured out the byte for the number of meshs in the file and what the byte before the mesh name is for, really should pay more attention The rest of the footer seems to just be a sequence of numbers which increases by meshand is constant between files

    Code:
    04 00 00 00 Body	Body		00 00 00 0A 00 01 00 04 00 00 00 0B 00 03 00 00 00 0B 00 05 00 00 00
    04 00 00 00 Legs	Leg		00 00 00 00 00 0A 00 06 00 00 00 0B 00 05 00 00 00 0B 00 07 00 00 00
    0B 00 00 00 Attach	Cylinder02	01 00 00 00 00 0A 00 08 00 00 00 0B 00 07 00 00 00 0B 00 09 00 00 00
    04 00 00 00 Arms	Arm		00 00 00 00 00 0A 00 0A 00 00 00 0B 00 09 00 00 00 0B 00 0B 00 00 00
    0B 00 00 00 Attach	Cylinder03	01 00 00 00 00 0A 00 0C 00 00 00 0B 00 0B 00 00 00 0B 00 0D 00 00 00
    0B 00 00 00 Attach	Box014		00 00 00 00 00 0A 00 0E 00 00 00 0B 00 0D 00 00 00 0B 00 0F 00 00 00
    0B 00 00 00 Attach	Plane02		01 00 00 00 00 0A 00 10 00 00 00 0B 00 0F 00 00 00 0B 00 11 00 00 00
    0B 00 00 00 Attach 	Plane04		00 00 00 00 00 0A 00 12 00 00 00 0B 00 11 00 00 00 0B 00 13 00 00 00
    06 00 00 00 Helmet	Hat04		00 00 00 00 00 0A 00 14 00 00 00 0B 00 13 00 00 00 0B 00 15 00 00 00
    04 00 00 00 Head	Head1		00 00 00 00 00 0A 00 16 00 00 00 0B 00 15 00 00 00 0B 00 17 00 00 00
    05 00 00 00 Hands	Hand01		00 00 00 00 00 0A 00 18 00 00 00 0B 00 17 00 00 00 0B 00 19 00 00 00
    04 00 00 00 Head	Head02		00 00 00 00 00 0A 00 1A 00 00 00 0B 00 19 00 00 00 0B 00 1B 00 00 00
    04 00 00 00 Head	head03		00 00 00 00 00 0A 00 1C 00 00 00 0B 00 1B 00 00 00 0B 00 1D 00 00 00
    04 00 00 00 Head	Head04		00 00 00 00 00 0A 00 1E 00 00 00 0B 00 1D 00 00 00 0B 00 1F 00 00 00
    10 00 00 00 Secnd	Sec_2		00 00 00 00 00 0A 00 20 00 00 00 0B 00 1F 00 00 00 0B 00 21 00 00 00
    10 00 00 00 Secnd	Sec_6		00 00 00 00 00 0A 00 22 00 00 00 0B 00 21 00 00 00 0B 00 23 00 00 00
    10 00 00 00 Secnd	Sec_7		00 00 00 00 00 0A 00 24 00 00 00 0B 00 23 00 00 00 0B 00 25 00 00 00
    10 00 00 00 Secnd	Sec_8		00 00 00 00 00 0A 00 26 00 00 00 0B 00 25 00 00 00 0B 00 27 00 00 00
    0E 00 00 00 Prmry	Pri_27		00 00 00 00 00 0A 00 28 00 00 00 0B 00 27 00 00 00 0B 00 29 00 00 00
    0E 00 00 00 Prmry	Pri_26		00 00 00 00 00 0A 00 2A 00 00 00 0B 00 29 00 00 00 0B 00 2B 00 00 00
    07 00 00 00 Ramrod	RR_57		00 00 00 00 00 0A 00 2C 00 00 00 0B 00 2B 00 00 00 0B 00 2B 00 00 00
    The only thing that changes is the first byte and It looks like you're right about it being related to attachments, doesnt seem to signify that its compulsoty though as some of the meshs above marked with it dont appear on all soldiers. My guess is that if theres just one type of mesh variant it gets used for all soldiers. The rest bar the first footer is just an increasing sequence and looks to be the same for all .mesh files I've looked at so far.
    Last edited by Casuir; 03-05-2007 at 03:13.

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

    Default Re: A start on the .MESH file format

    @GOM
    OK, I've been testing the latest .exe from yesterday.
    Converted over 15 meshes without losing functionality
    of the button. I'll continue spot checking more units
    without closing it out just to verify it further.

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