3DMAX MSH Exporter

Uli

Moderator
Staff member
Moderator
Joined
Aug 30, 2010
Messages
208
rosuto said:
...Im running a little behind because I keep trying to figure out the skt file. I've got part of it working, but havent figured out how the rotations translate into 3ds max.



AT-ST doesn't have any modified rotations, so thats why it looks pretty good. If anyone knows something about pre and post bone rotation, Im all eyes.
I use to, don't have it anymore nor can I remember how it all worked out. They reversed the order of something if I recall correctly.

DavinFelth said:
Skeletons, awesome :D Any ambitions to figure out animation files too? :D
Animations use a CRC Table which is in the client exe so will have to use it to "decrypt" the animations.
 

DavinFelth

Administrator
Staff member
Administrator
Joined
Aug 29, 2010
Messages
165
Uli said:
Animations use a CRC Table which is in the client exe so will have to use it to "decrypt" the animations.
That's strange, seems pretty pointless but then that's SOE for you!
 

rosuto

New Member
Joined
Aug 1, 2011
Messages
69
Ok, back from my vacation. Good to have a clear head when working.

Uli, I went through the code of one of your file viewers before my break and what you had down was rotation = pre * post rotation. Will take another look at it since I know 3dmax gets screwy with x y z axis stuff.

Timbab, the pics in your soooo shaders vsh psh thread.

Lets see... what do I have to work on.
1) Finish the sht list update
2) Figure out the bone rotatation
3) The above is only to hopefully make it easier to build mgn files, since you need to have the nearby bones, thus I will be able to work on mgn files

And Im pretty sure there is a bug sitting around somewhere that needs to be fixed in the msh exporter.
 

Timbab

Administrator
Staff member
Administrator
Moderator
Joined
Oct 6, 2010
Messages
1,057
Location
Magna Germania
Welcome back!

Oh those screenshots, yeah, those aren't from me, they're from the guy who made the ILM mod.

Nothing like that was ever in the game officially, not sure if it's real or not to be honest, I couldn't figure out how he did it at all without touching the fog, especially since all his .vsh/.psh files in his mod aren't modified WHATSOEVER, makes me kind of doubt he ever modded any real shaders.

Kay and I seriously broke our head about it, rofl. Sytner said he'll think about it, if someone is gonna figure it out, it's probably him. :p Unless someone with extensive HLSL knowledge comes along.
 

wefi

Member
Joined
Jul 27, 2011
Messages
47
if we get bones to work, that will fix allot of the old mod bugs we been bothered with shadows, and punch out items.
http://i56.tinypic.com/o888wi.jpg
for example i could take that jacket in 3dmax, remove the bits i dont need(like pants, and boots) then import it using it's normal shader. which allows shadows to work.

by doing this we can use older item mods to make brand new items bug free. things like Obi-wan's armor. Vader's cape, etc.
 

Sytner

Administrator
Staff member
Administrator
Joined
Sep 18, 2010
Messages
426
DavinFelth said:
Uli said:
Animations use a CRC Table which is in the client exe so will have to use it to "decrypt" the animations.
That's strange, seems pretty pointless but then that's SOE for you!
Nah it's not pointless, a lot of the animations are compressed and the table is used to decompress them. Some of the files are uncompressed and you'll notice they're much larger.

If you're interested in reversing animations, start with the uncompressed ones then jump into the client to get the functions which generate the table... it's certainly one of the more fun file types to figure out so enjoy it. :D
 

rosuto

New Member
Joined
Aug 1, 2011
Messages
69
Well if I could figure out the formula for the rotations I would gladly move on to something more fun. I've got over 100hrs of into and I still cant figure it out. Reminds me of this pattern recognition class I took and didnt understand one thing out of the book.

It still could be possible to do mgn without loading in the skeleton file, but it looks like there will be a ton of guessing going on which really isnt what I want to do. If I keep banging my head into the keyboard I might just take a break from the mgn/sktm and move on to something else. Its just nice to see things work for a change.
 

DavinFelth

Administrator
Staff member
Administrator
Joined
Aug 29, 2010
Messages
165
Sytner said:
Nah it's not pointless, a lot of the animations are compressed and the table is used to decompress them. Some of the files are uncompressed and you'll notice they're are much larger.

If you're interested in reversing animations, start with the uncompressed ones then jump into the client to get the functions which generate the table... it's certainly one of the more fun file types to figure out so enjoy it. :D
It's amazing how much more sense it makes when the word "decrypt" is replaced with "decompress" :D
 

wefi

Member
Joined
Jul 27, 2011
Messages
47
Unwrap 3d which can load up Skt and MGN files.
http://www.unwrap3d.com/u3d/index.aspx
 

rosuto

New Member
Joined
Aug 1, 2011
Messages
69
I noticed something interesting in the mgn files, the x coord is reversed. Not sure if this is also true in the msh yet.

Ok, so bones. Here is where I am stuck. I was able to use the unwrap 3d and get the positions everything should be at, but still have no idea what the exact rotation formula is for 3ds max.

PHP:
0         -0.0269   6.8492     -->        0         -0.0269   6.8492
0	     -0.0091   2.8743                0         -0.0091   2.8742
2.5441     0.5459   1.9184                1.9183    -0.5459   2.5441
2.4292     0        0                     0         -0.0419   2.4289
2.5441     0.5459  -1.9434                -3.8617    0.0419   -2.4289
2.4292     0        0                     0         -0.0419   2.4289
3.135      1.7624   0.7889                1.1545    -1.1746  -1.8379
2.729      0        0                      0         0        2.7289
3.2011     1.7624   0.7885                1.5774     0       -2.6628
2.729      0        0                      0         0        2.728
Now my math sucks and Im trying to figure out what is needed to get the original x,y,z (left side) to the new x,y,z (right side) by only rotating it using [0,0,0] as the pivot. Any help?
 

Uli

Moderator
Staff member
Moderator
Joined
Aug 30, 2010
Messages
208
DavinFelth said:
Sytner said:
Nah it's not pointless, a lot of the animations are compressed and the table is used to decompress them. Some of the files are uncompressed and you'll notice they're are much larger.

If you're interested in reversing animations, start with the uncompressed ones then jump into the client to get the functions which generate the table... it's certainly one of the more fun file types to figure out so enjoy it. :D
It's amazing how much more sense it makes when the word "decrypt" is replaced with "decompress" :D
Compression can be considered a form of Encryption
 

Sunrunner_Charina

New Member
Joined
Sep 1, 2010
Messages
35
rosuto said:
I noticed something interesting in the mgn files, the x coord is reversed. Not sure if this is also true in the msh yet.

Ok, so bones. Here is where I am stuck. I was able to use the unwrap 3d and get the positions everything should be at, but still have no idea what the exact rotation formula is for 3ds max.

...snip...

Now my math sucks and Im trying to figure out what is needed to get the original x,y,z (left side) to the new x,y,z (right side) by only rotating it using [0,0,0] as the pivot. Any help?
And now you're right back where I was, months ago. .SKT rotations threw me for a loop, and I never got them importing properly into Blender. In the end, I stressed myself over it and ran out of time with other stuff IRL.

As for the rest of the .mgn, I've got enough notes and data on that format to write a whole new spec for it, save a few choice tags. Shoot me a PM if you've got questions.

EDIT:
rosuto said:
It still could be possible to do mgn without loading in the skeleton file, but it looks like there will be a ton of guessing going on which really isnt what I want to do.
I don't suppose you ever took a look at the Wiki entries for the MGN structures? I put a LOT of time into that particular page, and it might take a lot of guesswork out of your efforts.
 

rosuto

New Member
Joined
Aug 1, 2011
Messages
69
Yeah, ive looked a lot at the wiki you put together and of course the biggest red flag is not knowing which bone relates to which vertex. And thats why I still haven't gotten anywhere on it. I did have to take a break because I felt like I was digging a bigger hole everyday not getting anywhere on it. Last week I redid all the LOD files to only load the hi res msh models. Have to say it actually improved my frame rate because the game no longer flips through each model version. I might throw together a zip file or something if there is any interest.

I also tried to do the same with LMG but apparently that is not as straight forward. Trying to get it to load only one MGN version or use the same MGN for all versions results in part/all of the MGN object missing when looking at from different views. Like NPCs missing clothes, sometimes legs, faces... until I get the camera looking a certain way or am right on top of the NPC.
 

Sunrunner_Charina

New Member
Joined
Sep 1, 2010
Messages
35
rosuto said:
Yeah, ive looked a lot at the wiki you put together and of course the biggest red flag is not knowing which bone relates to which vertex. And thats why I still haven't gotten anywhere on it. I did have to take a break because I felt like I was digging a bigger hole everyday not getting anywhere on it. Last week I redid all the LOD files to only load the hi res msh models. Have to say it actually improved my frame rate because the game no longer flips through each model version. I might throw together a zip file or something if there is any interest.
I'm unfamiliar with maxscript. Do the bone have to actually exist in order to have vertices assigned to it?

The actual bones involved are all declared in the .mgn, and an .mgn doesn't even have to use or reference all the bones in a given skeleton. All that data is in the .mgn, and you never have to load the skeleton if you don't want.

If you have to have bones in order to do weight assignment, you can always grab the list of bones from inside the MGN and make 'dummy' bones in the interim. Either way, all that assignment data is still entirely in the .mgn.
 

rosuto

New Member
Joined
Aug 1, 2011
Messages
69
I believe it becomes an animation issue if the verts are assigned to the wrong bone. If Im wrong, cool, makes life easier.
 

Sunrunner_Charina

New Member
Joined
Sep 1, 2010
Messages
35
rosuto said:
I believe it becomes an animation issue if the verts are assigned to the wrong bone. If Im wrong, cool, makes life easier.
You won't be able to properly test the animations without deciphering the skeleton (since the pivot points will be wrong), but if you wanted to, say, edit an existing mesh, or add parts to one, or replace a helmet with goggles, then all you really need are the names of the bones, and the MGN tells you what those are.

Try this: open a character mesh in a hex editor (I used hum_f_body_l0.mgn, but you should use the race/gender of your character). Near the very top you can see some pretty clear ASCII values; stuff like 'lthigh, lshin' etc. This is where the .mgn imports the bone names. The order is what's important.

swap 'lankle' and 'rankle'. It's just two letter's difference, no fussing with IFF size tags, and those two bones are in different positions. Then, go in game. Bam. You just re-mapped several dozen vertices to completely different bones in 2 bytes.

All that matters is that:

A: The MGN lists the skeleton it's importing from.
B: The MGN lists the bones it wants from that skeleton.
C: The weight values reference the proper, .mgn-internal index of the bone.
 

Vlock

New Member
Joined
Dec 27, 2010
Messages
25
all i can say is wow. will give this bad a boy a whirl shortly!
 

Aigik

New Member
Joined
Sep 16, 2010
Messages
27
Sorry I haven't posted in a while, been a combination of busy with RL stuff as well as hard at work on SWG stuff using your exporter. :p

Anyway, I'm experiencing crashing when I try to get this particular model in game. I'm wondering if I'm hitting the texture vertex limit, but I have no way of knowing... Do you know of any way to check what the current number for this is for a model?
 

rosuto

New Member
Joined
Aug 1, 2011
Messages
69
I doubt its the limit since I hard coded a 65,000 limit per object. You will get an error if you go over. Doesn't mean you can't have multiple objects that form a single MSH model. Think the highest I have loaded in was 85,000 total verts. Game would pause for about 3 seconds when it went to load the model.

Now the only a few things that I know of that causes crashes are
1) file format is messed up. Easy way to check is to open it with tre explorer and see if it makes since.

Now if its not that, I'd say let me look at it. There is probably some conflicting data possibly relating to an LOD file, assuming that you didnt find a bug.
[hr]
Sunrunner_Charina said:
rosuto said:
I believe it becomes an animation issue if the verts are assigned to the wrong bone. If Im wrong, cool, makes life easier.
You won't be able to properly test the animations without deciphering the skeleton (since the pivot points will be wrong), but if you wanted to, say, edit an existing mesh, or add parts to one, or replace a helmet with goggles, then all you really need are the names of the bones, and the MGN tells you what those are.

Try this: open a character mesh in a hex editor (I used hum_f_body_l0.mgn, but you should use the race/gender of your character). Near the very top you can see some pretty clear ASCII values; stuff like 'lthigh, lshin' etc. This is where the .mgn imports the bone names. The order is what's important.

swap 'lankle' and 'rankle'. It's just two letter's difference, no fussing with IFF size tags, and those two bones are in different positions. Then, go in game. Bam. You just re-mapped several dozen vertices to completely different bones in 2 bytes.

All that matters is that:

A: The MGN lists the skeleton it's importing from.
B: The MGN lists the bones it wants from that skeleton.
C: The weight values reference the proper, .mgn-internal index of the bone.
Ok. Im thinking small things would be pretty easy. Like googles and hats. When its comes to multi bone models like body suits or pants, that where I'm having a hard time trying to figure out the best way to say "hey, these verts belong to right thigh." Probably a big issue for me because I've never worked with animations before, so have no idea who 3d max does it. Still keep going back to the bone positions and I have no idea why. Feel like I'm trying to force push the death star.
 

wefi

Member
Joined
Jul 27, 2011
Messages
47
rosuto said:
Ok. Im thinking small things would be pretty easy. Like googles and hats. When its comes to multi bone models like body suits or pants, that where I'm having a hard time trying to figure out the best way to say "hey, these verts belong to right thigh." Probably a big issue for me because I've never worked with animations before, so have no idea who 3d max does it. Still keep going back to the bone positions and I have no idea why. Feel like I'm trying to force push the death star.
thats the issue i having with blender. I could look them up using unwrap, but that is more work then whats really needed.

If i could look how things connect, by having the skel there while i add weight would help people that are not familiar with the structures of the bones.

Also what mesh you trying to edit aigik? some NGE items wont work with the Pre-cu client with out editing the file to something that i just now forgot lol.
 
Top Bottom