Page 1 of 2 12 LastLast
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

    Default A start on the .MESH file format

    Hi

    I've been looking at the .MESH format and although it's not complete, I thought I'd share what I've found and maybe kickstart others to finish it.

    I've mainly been looking at figure meshes (siege engine and other meshes are a bit different) and the information relates to these. All values identified as integers are 4 byte integers.

    MESH files are stored as follows:-

    .at byte 69 of the initial header - integer value for number of different mesh groups = num_group

    .at byte 83 - start of first mesh group, integer showing length of mesh type (ie body ,arms, legs,etc) name string

    .mesh type name string

    .integer showing length of mesh group name(ie legs 01, arms 04, etc) string

    .mesh group name string

    .2 bytes of dummy data (only in first mesh group)

    .integer showing number of triangles in mesh group = n

    .n * 3 * 2 byte shorts for triangle values

    .29 byte header/footer (only between first and second mesh groups all others are 23 bytes)

    repeating below for 1 to num_group-1

    .integer - length of mesh type string

    .mesh type string

    .integer - length of mesh group name string

    .mesh group name string

    .integer showing number of triangles in mesh group = n

    .n * 3 * 2 byte shorts for triangle values

    .23 bytes of header/footer

    Then you have another 24 byte of header/footer

    .integer - number of vertices = n2

    .n2 * 2 * 4 byte float - texture coord u and v values (note here the uv values are based on a composite texture ie 2048 x 1024 - the figure texture on the left and the attachment texture on the right)

    .28 byte of header/footer

    .integer - number of vertices = n2

    .n2 * 2 * 4 byte float - vertex weights (primary weight, secondary weight - from left)

    .38 bytes of header/footer

    .integer - number of vertices = n2

    .n2 * 3 * 4 byte float - vertex vector

    .36 bytes of header/footer

    .integer - number of vertices = n2

    .vertex/bone assignments, information in series of four bytes - (from left) byte1 = 0, byte2 = secondary bone, byte3 = primary bone, byte4 = 0

    That's as about as far as I've got so far. There is another block of code following the vertex/bone assignments that I haven't worked out yet. It seems to be in series of three bytes followed by a zero byte - maybe something to do with shader systems - any ideas?

    After this block is just a listing of the skeleton bones in hierarchy order. Hopefully somebody can use this to go further.

    Cheers

    GrumpyOldMan
    Last edited by GrumpyOldMan; 02-14-2007 at 07:14.

  2. #2

    Thumbs up Re: A start on the .MESH file format

    Very nice work mate, keep it up if you can. Should be enough here to try some kitbashing

  3. #3

    Default Re: A start on the .MESH file format

    Quote Originally Posted by GrumpyOldMan
    .integer showing number of triangles in mesh group = n

    .n * 3 * 2 byte shorts for triangle values
    Correct me if I'm wrong here but these arent xyz co-ords but references to the vertices the triangle uses? If so what part are the coords given? I've been trying to hand convert some geometry to obj but I'm getting nowhere slowly.

    A polycount of a model based on grumpyoldmans finding for those that are interested ( arquebusier)

    Head 246
    Body 344
    Arms 322
    Legs 482
    Prim 74
    Sec 122

    Total of 1590 plus an additional 52 in powderbag and 116 in the strap

    Btw again good work, after a couple of hours messing about with the info you've provided i can appreciate how much time effort and patience you put into working it out.

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

    Default Re: A start on the .MESH file format

    Really good work guys! I'm still trying to get my head around it.
    Is this how it works?

    n2 vertex vectors (each entry a 4-byte float)

    Code:
    1.15   3.47   -1.04     [  0  ]
    2.65   2.54    0.98     [  1  ]
    3.77   2.15    1.44     [  2  ]
      .      .       .      [  .  ]
      .      .       .      [  .  ]
      .      .       .      [  .  ]
    0.15  -2.38    3.72     [n2-1 ]
    (The numbers in square brackets are meant to
    be 0-based indices.)

    n mesh group triples (each entry a 2-byte short int)

    Code:
      0      4       5      [  0  ]
      5      4       3      [  1  ]
      4      0       6      [  2  ]
      .      .       .      [  .  ]
      .      .       .      [  .  ]
      .      .       .      [  .  ]
      7      3       2      [ n-1 ]
    So each triple in the mesh group block are three
    indices into the vertex vector array and this
    defines a facet? I suppose the order of indices is
    important as that and the right hand rule would define
    an outward pointing vector so a rendering system would
    know what the "outside" of the body is.

    What would the vertex weights be used for?

  5. #5

    Default Re: A start on the .MESH file format

    Guy not guys, this is all grumpyoldmans work and thats how it seems to work. Are you converting this by hand grumpyoldman? I'm trying to write something which will automate at least some parts but I've no prior experience at coding so its an uphill struggle.

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

    Default Re: A start on the .MESH file format

    @casuir
    Sorry, you're right. Point taken.

    I've put together a Python script that
    goes up to the bones section but I've
    only tested it on a fake .mesh file that
    I made according to GrumpyOldMan's
    prescription. Do you have Python?

  7. #7

    Default Re: A start on the .MESH file format

    Yes, what does it export it too? For mesh extraction the vertex vectors, uv co-ords and tris are all thats really neccessary, the rest of it will be needed for putting stuff in though
    Last edited by Casuir; 02-16-2007 at 22:53.

  8. #8

    Default Re: A start on the .MESH file format

    I am blown away at how promising this work is. Keep up the good work!!!

    -wikiman

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

    Default Re: A start on the .MESH file format

    Hello wikiman, welcome. Thank you for your interest.
    I think I echo GrumpyOldMan's heartfelt wish, any chance
    of a roadmap for the headers/footers for the mesh format
    or is this outside your purvue? Just being opportunistic
    here, no pressure. Again, a pleasure to see you.

  10. #10

    Default Re: A start on the .MESH file format

    I have milkshape and 3Dmax 7, how do i import .mesh films to either of these programs?

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

    Default Re: A start on the .MESH file format

    Sorry Balbor, we're not there yet. GrumpyOldMan is looking
    at the Milkshape option but it will be a bit. I did some experiments
    yesterday using a borrowed Milkshape tutorial form and exporting
    it to a variety of formats. So far, it looks like the Milkshape
    ASCII format and the fbx format are the only ones that retain
    bone information so I'm going to try and look at the fbx format today.
    It's binary so this will be tedious. I'll post back if I learn anything.

  12. #12

    Default Re: A start on the .MESH file format

    Quote Originally Posted by KnightErrant
    Sorry Balbor, we're not there yet. GrumpyOldMan is looking
    at the Milkshape option but it will be a bit. I did some experiments
    yesterday using a borrowed Milkshape tutorial form and exporting
    it to a variety of formats. So far, it looks like the Milkshape
    ASCII format and the fbx format are the only ones that retain
    bone information so I'm going to try and look at the fbx format today.
    It's binary so this will be tedious. I'll post back if I learn anything.
    so you're not at the point were it is possible to get M2TW battle map models such as units into Milkshape?

  13. #13
    Member Member Re Berengario I's Avatar
    Join Date
    Nov 2003
    Location
    Italy
    Posts
    336

    Default Re: A start on the .MESH file format

    Hmmm I was thinking at one thing that maybe could help you guys, maybe not.

    MTW2 models are exported meshes from 3ds elaborated to work with Granny, which is a code animation library used on a multitude of games.

    Even if in MTW2 models don't have the suffix ".gr2" most of "grannified" models have, maybe their format is not very different from models of other games like NWN2 (another game hit by the granny pestilence) and, always maybe, there are people there who are doing your exact research and decoding work. Make a search at NwVault or Bioware Forums (NWN2 section) could give you some hints.

    A plea to CA: I know Granny can spare a lot of coding time but if you want to keep your games opened to modification, until Granny won't open up its copyrighted format, you need to switch your attention to the scripted part of the game, giving us modders more options on that part of the game.

    Black unbreakable boxes usually hit quickly the dusty shelves of game shops.
    Last edited by Re Berengario I; 02-25-2007 at 22:35.

  14. #14

    Default Re: A start on the .MESH file format

    Hi!

    Im new here...
    And i need a modeller, to work for me...
    If anybody wants help me, please advise me.

  15. #15

    Default Re: A start on the .MESH file format




  16. #16

    Default Re: A start on the .MESH file format

    Is there anyone who have put a REAL new weapon into the game and what is the result?
    i'm going on

  17. #17

    Default Re: A start on the .MESH file format

    Hey GrumpyOldMan!
    Can you create a berserker modell for Denmark? Half nacked, with long hair and a two handed axe?
    Can you make me a modell? Please!

  18. #18

    Default Re: A start on the .MESH file format

    Hi Gubzol

    Quote Originally Posted by GubZol
    Hey GrumpyOldMan!
    Can you create a berserker modell for Denmark? Half nacked, with long hair and a two handed axe?
    Can you make me a modell? Please!
    No, but if you get stuck making your own figure, I'll give you advice on how to fix it.

    Cheers

    GrumpyOldMan

  19. #19

    Default RTW Cas to M2tw converter released

    Hi Guys

    I've just uploaded the beta of the RTW Cas to M2tw converter to http://www.totalwar.org/Downloads/M2...TW_BETA_13.zip . Post here if you have any problems.

    Oops the doc is here http://www.totalwar.org/Downloads/M2...W_MESH_doc.zip

    Cheers

    GrumpyOldMan
    Last edited by GrumpyOldMan; 04-27-2007 at 03:48.

  20. #20

    Default Re: A start on the .MESH file format

    I've just tried the latest version. I'm very eager to convert some of my RTW models but it doesn't seem to be converting properly. It just creates a blank file of the same name with this:

    //Milkshape 3D

    Frames: 1
    Frame: 1

    I've tried several vannila RTW models and some others from RTR but havent had any luck.

    Any suggestions?

  21. #21

    Default Re: A start on the .MESH file format

    Hi Adragon

    Quote Originally Posted by Adragon
    I've just tried the latest version. I'm very eager to convert some of my RTW models but it doesn't seem to be converting properly. It just creates a blank file of the same name with this:

    //Milkshape 3D

    Frames: 1
    Frame: 1

    I've tried several vannila RTW models and some others from RTR but havent had any luck.

    Any suggestions?
    I know there is a problem with BI and Alex figures but it should be converting vanilla and anything exported from Verc's script ok. I know that Andromachus Theodoulos has been working away on converting RTR figures so the converter should work on those.

    Can you give me file names of vanilla figures that aren't converting for you.

    Cheers

    GrumpyOldMan

  22. #22

    Default Problem with mesh editor for mounts

    hi to all! i have a problem with the mesh editor for mounts, when i reconvert the ms3d to mesh the model ingame is "broken" like some screens in this tread, i tried to see if there are some point unassigned but nothing... sorry for my bad english.
    horse in milkshape3d:
    and ingame:
    Last edited by FedeITA; 04-27-2007 at 13:12.

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

    Default Re: A start on the .MESH file format

    @fedeITA
    Check which version of the meshconverter you are using.
    I had a bug with uv coordinates not being done correctly. The
    latest version, v1_0_2 should have fixed this. You can also
    check in Milkshape by applying the texture there and see if it
    comes out ok.

  24. #24

    Default Re: A start on the .MESH file format

    great work everyone, especially the smurfs gave me a hearty laugh.

    Im part of the Rise of Xerxes mod team and would like to ask for some help with rigging.

    I read this thread completly and careful, however i still miss some of the knowhow to get started properly. I use 3ds, and therefor i use ms only as a link between the meshconverter and 3ds, although as mentioned the bone and weighting data is lost due to the file conversion. The FBX format was mentioned, although the bonedata is kept, it looks pretty weird to me when i load it into 3ds.

    Now i would like to know which file format you prefer, and how you rigged the "new" model. Did you keep the body structure and tryd to assign the new mesh parts as close as possible to the original model structure or simply by trial error ? And why does every unit have 4 meshes when each has stored the different versions of bodykit parts in itself ? I hope you can help me to close some knowledge gaps

    greets Aradiel

  25. #25

    Default Re: A start on the .MESH file format

    I found it easiest to make the mesh and export it as 3DS. No rigging goes with it.

    I have saved an MS3D a model with all the mesh removed and just the bones left ( Make sure you have changed the MS3D preferences so the bones show up properly! )

    Then, import the 3DS to Milkshape and rig there. It's not that bad for rigging...and quite similar to Max.

    Then just save the MS3D file and convert to Mesh.
    Careless Orc Costs Lives!

  26. #26
    Member Member r-marci's Avatar
    Join Date
    Aug 2005
    Location
    Budapest, Hungary
    Posts
    12

    Default Re: A start on the .MESH file format

    Thanks for all of your answers!

    I've loaded the trial version of Milkshape down!

    Can you tell me about the animation system of M2TW? I would like to know what I have to do in Milkshape (after I made a new body and added skeleton to it) to have a new unit, which do everything well in the game.

    Sorry to have lots of questions but the forums looks like the chaos to me in English, and there isn't any tutorial.
    Feheruuraru rea meneh hodu utu rea

  27. #27

    Default Re: A start on the .MESH file format

    As a start point, download GrumpyOldMan's MESH convertion tool. Take a stock model, and convert it into MS3D format. Then you canopen it in MS3D and you will see the bones and the mesh part of the model.

    You can export the model as 3DS and get that into MAx for modelling, and then re-import the file as a 3DS again to Milkshape when you are done. I don't model in MS3D either...

    Depending on whether you want to make the thing fit a stock skeleton, or if you want to make a skeleton that is not human in shape or proportion determines where you go next.

    I am not going to be around for the next few days, but if you post back, I will pick up any questions on how you go on from there.

    In terms of converting stuff and etting it working in game, I have used ALL the tools, and got stuff to work through the development stage ( thats when I spend half my time messing with models, and the other half pestering the tool-makers! ) and know pretty much exactly what to do to get these things woking well!
    Careless Orc Costs Lives!

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

    Default Re: A start on the .MESH file format

    Hi R-marci,

    Glad to have another modeller enter the ring. I
    can answer questions related to the utilities but
    since I'm not a modeller myself I can't answer
    Milshape questions (other than the most basic).

    If you work with the Milkshape format and the
    utilities and have need of other capabilities, please
    post them here and I can see if I can provide what
    you need.

    Welcome and happy modelling!

    KE

  29. #29
    Member Member r-marci's Avatar
    Join Date
    Aug 2005
    Location
    Budapest, Hungary
    Posts
    12

    Default Re: A start on the .MESH file format

    Quote Originally Posted by KnightErrant
    Hi R-marci,

    Glad to have another modeller enter the ring. I
    can answer questions related to the utilities but
    since I'm not a modeller myself I can't answer
    Milshape questions (other than the most basic).

    If you work with the Milkshape format and the
    utilities and have need of other capabilities, please
    post them here and I can see if I can provide what
    you need.

    Welcome and happy modelling!

    KE
    Thank you very much!

    What do you think which is better? Shall I modificate the original models of M2TW or should I make total new bodies for the mod?
    Feheruuraru rea meneh hodu utu rea

  30. #30
    Member Member Herkus's Avatar
    Join Date
    Feb 2006
    Location
    Latvia, Riga
    Posts
    173

    Default Re: A start on the .MESH file format

    Quote Originally Posted by r-marci
    Thank you very much!

    What do you think which is better? Shall I modificate the original models of M2TW or should I make total new bodies for the mod?
    Well it depends on units which you are going to make. Modifying original models will probably help you to know the whole implementation process faster and tackle early errors.

Page 1 of 2 12 LastLast

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