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 Re: A start on the .MESH file format

    Hi Everybody

    Cleaned up after the storm and rain and ready to get back into it. I'm really impressed with the work @KE and @Cas have been putting into the headers and footers, I was going to suggest we take a look at them but you've already started .

    One thing I did spot in the Aztec figure was the screwed up skeleton:-

    Processing bone strings, number = 20
    8 bone_abs 0
    12 bone_eyebrow 1
    9 bone_head 2
    8 bone_jaw 3
    14 bone_Lclavical 4
    11 bone_Lelbow 5
    10 bone_Lfoot 6
    10 bone_Lhand 7
    14 bone_Llowerleg 8
    11 bone_LThigh 9
    14 bone_Lupperarm 10
    11 bone_pelvis 11
    14 bone_Rclavical 12
    11 bone_Relbow 13
    10 bone_Rfoot 14
    10 bone_Rhand 15
    14 bone_Rlowerleg 16
    11 bone_RThigh 17
    14 bone_Rupperarm 18
    10 bone_torso 19
    Not quite as neat and hierarchical as the '4' regular figures and the weapon/shield bones are missing. I've printed out the excellent stuff you've done and will now sit down and come up with a pattern for extracting stuff stored in the Milkshape file and storing it in a Mesh file. Incidentally, just because the files are stored in a MS3D file format, doesn't mean you have to use Milkshape. The format is becoming available in a number of software products, I'm currently having a look at FragMotion as an alternative modeller and animation creater. MS3D also opens up in LithUnwrapper and Ultimate Unwrap for skinning (and conversion) purposes.

    Right, I'll sit down now and come up with some rules and pseudo code for the header/footers. As you guys look through the files could you just take notice of the bounding sphere values and see if they follow any sort of pattern ie dependent on foot vs mounted, or sword vs lance, etc. That may be handy to come up with some default values.

    Everybody else that's offered to help, there'll be a place for anybody willing to risk a ctd in the name of progress , if you can make the necessary changes to get a new figure into M2TW that would be a great help too.

    Cheers

    GrumpyOldMan

  2. #2
    The Philosopher Duke Member Suraknar's Avatar
    Join Date
    Dec 2002
    Location
    Navigating the realm of Ideas
    Posts
    707

    Default Re: A start on the .MESH file format

    Hrm...

    I kind of understand now why the Data\Text\export_units.txt is not a .txt file this time around...methinks we were not expected to be making new models.

    But, I have to say many of you seem to be doing very great progress here :)
    Duke Surak'nar
    "Η ΤΑΝ Η ΕΠΙ ΤΑΣ"
    From: Residing:
    Traveled to: Over 70 Countries, most recent: and

    ~ Ask not what modding can do for you, rather ask what you can do for modding ~
    ~ Everyone dies, not everyone really fights ~

  3. #3
    The Philosopher Duke Member Suraknar's Avatar
    Join Date
    Dec 2002
    Location
    Navigating the realm of Ideas
    Posts
    707

    Default Re: A start on the .MESH file format

    Alrighty,

    After a bit of reasearch, I came up with this:

    http://www.radgametools.com/granny/download.html

    You can freely Download the Granny Viewer, which comes with 2 sample .gr2 files, which may help you ellucidate some things if you can analyse them.

    It seems like Radgametools however holds the licences (and they seem a greedy bunch too), many other games have this issue, and I got this from moding forums of AOEIII.

    Correct me if I am wrong but from what I understand what your trying to do here is break the .mesh format not the gr2 format, and then if you can do that it could be reversible providing us with a way to do some modeling.

    I will be looking for alternatives such as using .xml templates to probably be able to mix and match models (Body of A with head of B) from existing stock models (should not be against any licensing doing that).

    I wish success to you :)
    Duke Surak'nar
    "Η ΤΑΝ Η ΕΠΙ ΤΑΣ"
    From: Residing:
    Traveled to: Over 70 Countries, most recent: and

    ~ Ask not what modding can do for you, rather ask what you can do for modding ~
    ~ Everyone dies, not everyone really fights ~

  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

    @Suraknar
    Yes, what GrumpyOldMan, Casuir, and myself have been calling
    header/footer lines are probably granny strings. So we're essentially
    trying to reverse engineer the granny strings and understand their
    syntax to make a back and forth converter that makes no use of
    any proprietary software. This would then be legal and freely
    distributable.

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

    Default Re: A start on the .MESH file format

    I kind of understand now why the Data\Text\export_units.txt is not a .txt file this time around...methinks we were not expected to be making new models.
    You could say the same for all the fiels which are now .string.bins, and which alpaca has made a converter for.

  6. #6
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: A start on the .MESH file format

    Quote Originally Posted by Lusted
    You could say the same for all the fiels which are now .string.bins, and which alpaca has made a converter for.
    Nah they were just converted into a format that could be read more quickly by the machine.
    The game was probably developed without thinking of modding to any large extent (except for some individuals, such as Caliban and Palamedes) and therefore the designers and programmers just used what yielded the best results in the shortest time possible.

    Now it seems that we won't get any more official tools any time soon (maybe Caliban can explain why?) I'm glad to see that you guys are making quite a good deal of progress on this, and even more, provide us with a possible free way of editing models
    I wish I had more time on my hands so I could work a bit on this, too. Anyways, after you cracked this customer, you should also have a look at the settlement packages (it seems there's some cool stuff in there and it's a lot more flexible than RTW)
    Last edited by alpaca; 03-07-2007 at 17:20.

  7. #7

    Default Re: A start on the .MESH file format

    Hi Guys

    With regards to the standard '256' and non-standard '0' meshes I thought I'd go and look at some of the model files (export_descr_unit.txt and battle_models.modeldb ) to see if I could get some clues . The non-standard files are NOT used. They are WIPs and anyway the vertex assignments are all screwed up because of the funny skeletons. After I realised this the plaintive cries of "Dohhh" echoed off the hills for a long time, this shows you shouldn't get too focussed on just the one issue. With this in mind I'll 'lock out' the non-standard meshes since everything they have is available on standard meshes anyway.

    I'd just like to make the point that I am not interested in reverse engineering anything, Granny and .gr2 are a mystery to me and will forever remain so. I am just looking at the .MESH format that CA is using and looking at ways we can modify these files. There are lots of bits of data that I don't understand and I don't want to understand but I don't need to as I can just use them. Just a clarification in case anybody from Radgames is interested.

    Getting closer now.

    @Casuir

    You said you did some tests on taking out the boolean streams and using the figure in game. What exact blocks did you take out? Just the num_vertex and stream figures, with the header/footer stuff intact or the header/footer stuff as well?

    Interesting stuff you pulled out on weapon bones, we'll have to look closer at that stuff to see how we actually get a figure in game.


    I'm PMing Caliban with some questions on weapon protocol. It's just about sorted out in my head (and backs of envelopes), it's a matter of getting it into code.

    Cheers

    GrumpyOldMan

  8. #8

    Default Re: A start on the .MESH file format

    Question here on weapon bones, a weapon skeleton(s) is specified in the unit xml which is used to compile the finished .mesh so I'm guessing this bone data is pulled from there?
    Code:
    	<Skeletons>
    		<Skeleton>
    			<Mount>Horse</Mount>
    			<Primary>MTW2_HR_Spear</Primary>
    			<Secondary>MTW2_HR_Non_Shield</Secondary>
    			<PrimaryAttachment>MTW2_HR_spear_Primary</PrimaryAttachment>
    			<SecondaryAttachment>MTW2_Sword_Primary</SecondaryAttachment>
    		</Skeleton>
    There looks to be a number of different primary/secondary skeletons in the idx, would these affect things or are they just neccessary due to the way ca compiled the models? Also could animated weapons be possible?

    Re bounding spheres, theres only 4 values here so its xyz and a radius aye? From what I've seen the radius for dismounted is usually around 1.0-3 and mounted lancers 2.0-1, mounted archers and such are usually the same as infantry so I'm guessing the mounts are handled separately and weapons affect the size.

    Quote Originally Posted by Suraknar
    I will be looking for alternatives such as using .xml templates to probably be able to mix and match models (Body of A with head of B) from existing stock models (should not be against any licensing doing that).
    This wont be possible with an xml file afaik, the data is mixed up to much for it to be possible without extracting the parts from the .mesh and writing a completely new file. Changing primary/secondarys is possible with a bit of hex editing but unless you had some way of automatically re-writing the triangle values it could take you some time.

  9. #9
    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

    I think maybe the knifeman has an animated weapon but I'm told animating the weapon bone can cause some freaky results.

    The skeletons below simply tell the game what animation set to use for this unit. The example below means that his primary attack is a Spear animation set and his secondary is non_shield.
    You can look up these animation sets by searching for MTW2_HR_Spear in data\descr_skeleton.txt All unit skeleton types are listed in here.
    For example if you wanted him to play sword animations for his secondary, you would replace MTW2_HR_Non_Shield with -> MTW2_HR_Sword
    If you wanted his primary to be mace animations you would replace MTW2_HR_Spear with -> MTW2_HR_Mace

    Hope this helps :)

    <Skeletons>
    <Skeleton>
    <Mount>Horse</Mount>
    <Primary>MTW2_HR_Spear</Primary>
    <Secondary>MTW2_HR_Non_Shield</Secondary>
    <PrimaryAttachment>MTW2_HR_spear_Primary</PrimaryAttachment>
    <SecondaryAttachment>MTW2_Sword_Primary</SecondaryAttachment>
    </Skeleton>

  10. #10
    The Philosopher Duke Member Suraknar's Avatar
    Join Date
    Dec 2002
    Location
    Navigating the realm of Ideas
    Posts
    707

    Default Re: A start on the .MESH file format

    This wont be possible with an xml file afaik, the data is mixed up to much for it to be possible without extracting the parts from the .mesh and writing a completely new file.
    Indeed you are right Casuir,

    Working from an Export of an Export is unfortunently not possible the XML way :( as I have come to realise in some tests and recently got it confirmed aswell.

    So your efforts, KnightErrant and GrumpyOldman are the best way to go about it :)

    Go! Go! Go! hehe :)
    Duke Surak'nar
    "Η ΤΑΝ Η ΕΠΙ ΤΑΣ"
    From: Residing:
    Traveled to: Over 70 Countries, most recent: and

    ~ Ask not what modding can do for you, rather ask what you can do for modding ~
    ~ Everyone dies, not everyone really fights ~

  11. #11

    Default Re: A start on the .MESH file format

    It was more the PrimaryAttachment and SecondaryAttachment skeletons I was wondering about. Looked at the desc_skeletons and theres a few weapons which have animations other than stand_idle or default but they seem to be mainly ready, hold and release animations for missiles. Doesnt look to have any effect ingame though. What I was wondering was would it be possible to animate the actual weapon itself, ie have the arms of the bow draw back when drawn and return when the arrow is released.

    Btw theres more than one weapons bone in the mesh, whats the story there?

    @Suraknar, GOM and KE are the guys you should hang your hopes on, the major work heres being done by them and my contribution is very limited compared to theirs.
    Last edited by Casuir; 03-08-2007 at 02:22.

  12. #12
    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 Casuir
    It was more the PrimaryAttachment and SecondaryAttachment skeletons I was wondering about. Looked at the desc_skeletons and theres a few weapons which have animations other than stand_idle or default but they seem to be mainly ready, hold and release animations for missiles. Doesnt look to have any effect ingame though. What I was wondering was would it be possible to animate the actual weapon itself, ie have the arms of the bow draw back when drawn and return when the arrow is released.

    Btw theres more than one weapons bone in the mesh, whats the story there?
    Ok, the attachment skeletons are only used with weapons that contain more than one bone. Which is the case for say swords but not for shields.
    Sword has an additional sword bone that is attached to a hand, and we use that skeleton to animate it. But the shield is attached directly to the hand bone so there is no need for additional animation.

    At one stage there were going to be proper animated weapons such as bow strings etc but there were issues with this and so it never made it in. I don't think it will be possible to animate a bow string straight up, it would properly require a bit of hackery. I'm told animating weapon bones can cause some wierd effects. There is also a lot of junk files in the folders, tests and obsolete units etc, there was simply no way to check what resources the game used and so you might find a few things that were left in.
    Last edited by Caliban; 03-08-2007 at 04:54.

  13. #13

    Default Re: A start on the .MESH file format

    Hi all! I've gone through this whole thread for no less than 10 times and finally I think I understand most of its content, such as the structure of mesh file etc... But I still don't know how to import the mesh file (or part of it) into milkshape 3D. Would someone please tell me so I can join this historic work, too:)

  14. #14
    Member Member taylorj2's Avatar
    Join Date
    Mar 2007
    Location
    England, United Kingdom
    Posts
    4

    Default Re: A start on the .MESH file format

    Hi Guys, I tryed out the Rhino Program 3.0 and downloaded the plugin for MESH files, but it doesn't work still. It seems as though it should because even the Rhino program as options for joining triangles and stuff, can anyone help me why I can't import them?
    TWCenter Rebel! (A.K.A - Grandmaster Ryu, TaylorJ2 + more!)
    Destroyers Clan Member - {{Destroyers}I}TaylorJ2

    "God is not on the side of the big battalions but of the best shots." - Voltaire


    Patriot of England!

    Proud to be British! Rule Britannia!

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