Author Topic: [Dissidia] Models - Viewer and Extractor Tool by MrAdults (2009-04-08)  (Read 151237 times)

MrAdults

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #125 on: 2009-04-05 14:50:22 »
That's just what the base pose happens to be. You can re-pose them if you want. But if you want to export the old pose without skeletal data, you can use -noskel on the command line.

BlitzNCS

  • *
  • Posts: 889
  • Master of nothing in particular
    • View Profile
    • My Youtube
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #126 on: 2009-04-05 15:56:44 »
Thanks, but what about the error when dumping areas?
ANd by boxy, i mean like, for instance his arms, instead of being cylidrical like our arms, they're more of a pentagonal prim, if you see where i'm coming from. rigid edges? i'm bad at explaining....

MrAdults

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #127 on: 2009-04-05 16:52:23 »
There was a crash with the new skeletal export when exporting non-weighted models with skeletons (e.g. level models), fixed here:
http://www.richwhitehouse.com/index.php?content=inc_projects.php&filemirror=mesh2rdmv202.zip
But I'm afraid I have no idea what you mean regarding boxiness. This is what I get:

Looks fine to me. As mentioned, Squall is in that pose because it happens to be the first frame reference pose for his model. You can just move his shoulder bones a little and he'll be in the same base pose as before.

BlitzNCS

  • *
  • Posts: 889
  • Master of nothing in particular
    • View Profile
    • My Youtube
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #128 on: 2009-04-05 17:16:50 »
Thanks for the fix :D
And, if i still cant get it to work, ill show you a screenshot of the boxyness later.

koral

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #129 on: 2009-04-05 22:29:00 »
The "boxyness" is either because the normals are screwed up, or because there are duplicate vertices everywhere.
Try welding all vertices (<0.01 or something) then do an "AutoSmooth" on all the polygons.

And thankyou for the info Ukurere, I need to stop moping around and get back to the wiki-work!  :-D

Aurenasek116

  • *
  • Posts: 155
    • View Profile
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #130 on: 2009-04-05 23:39:36 »
I don't get any problems with "boxyness". I just use smoothing groups, works fine.

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #131 on: 2009-04-06 01:06:26 »
Just to remind everyone. Those who have asked for wiki access have gotten it.

Ukurere

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #132 on: 2009-04-06 19:19:00 »
How exactly do you end up spending this much time in front of a hex editor, equipped with, seemingly, a good amount of rendering/geometry knowledge, and not have programming experience? What are you, some kind of hardcore scripter? ;)
Eh, I should have said relative inexperience. I haven't made anything major, nothing 3D either.

Bad news, I can't seem to find any working SMD import plugins for Blender-- huh, spoke too soon, guess I'm not restricted to OBJ files anymore. Yay! Strangely, models from Gitaroo Man Lives seem to have inverted normals (which takes like 3 seconds to fix in Blender :P). I wonder if there any other games with this issue, and if there is any way to tell in advance.
(Now don't get the impression that I actually know how to use Blender-- I'm bumbling and stumbling around that program like a drunken Flatlander.)

Now, below this line...
These are slightly more detailed descriptions of the 0x80?? chunks from this post. Except that some of them are incomplete or unknown or blah blah blah.

================
All(?) chunks are padded to a multiple of 4 bytes.

Little-endian unless otherwise noted:
int8, int16, int32 -> signed 8/16/32-bit integer
uint8, uint16, uint32 -> unsigned 8/16/32-bit integer
float32 -> 32-bit floating point decimal
word -> 2 bytes
dword -> 4 bytes


0x8012 - File name (always texture?)
  • A null-terminated string padded to 4 bytes.

Sometimes this isn't accompanied by file data, and even if it is, the file type might not match (e.g. texture.tga might be followed by GIM file data)

0x8013 - File data (always texture?)
  • uint32 filesize, followed by the file data itself. (Nitpick: Although chunk is padded to 4 bytes, the uint32 filesize doesn't have to be a multiple of 4.)


0x8014
  • unknown - contains 6 float32s

Has been seen under 0x0003 Sub-File, 0x0004 Bone Info, and 0x0005 Model Surface

0x8015 - Scale and Bias
  • Uh, whatever MrAdults said on his blog page.



0x8041 (reference to parent bone?)
  • dword [00 04 10 XX] where XX is the index of the parent(?) bone (as listed in the current Sub-File, starting at 0).


0x8044 - a big list of bones (help naming please)
  • u32 numBones, followed by that many bone references. Each bone reference is a dword [00 04 10 XX] where XX is the index of the bone (as listed in the current Sub-File, starting at 0).


0x8045 - Base Pose Matrices


0x8048

0x804B
0x804C

0x804E - Reference to Model Surface
  • dword [00 05 10 XX] where XX is the index of the Model Surface (as listed in the current Sub-File, starting at 0).



0x8061 - Reference to Material
  • dword [00 06 20 XX] where XX is the index of the Material (as listed in the current Sub-File, starting at 0).


0x8062
  • uint32 numWeightedBones (always between 1 and 8), followed by that many uint32s. Each uint32 refers to a bone from the bone reference list in 0x8044.


0x8066 - "Reference to Vertices" / "Vertex Kick" / (help, I need a name!)
(or "Mesh Index Data" according to MrAdults)
  • begins with dword [00 07 10 XX] where XX is the index of the Vertex Array (as listed in the current Model Surface, starting at 0).


0x8081
  • unknown - contains 2 uint32s/int32s


0x8082
  • unknown - contains 4 float32s


0x8083 (specular?)
  • contains (4 float32s, uint32)


0x8085
  • unknown - contains 4 float32s


0x8086 - Environment Mapping
  • contains a single float32 (I don't know what effect the float32 has)


0x8091 - Reference to Texture
  • dword [00 0A 20 XX] where XX is the index of the Texture (as listed in the current Sub-File, starting at 0).


0x8094
  • unknown - contains 3 uint32s/int32s


0x80B1 (animation frames?)
  • 2 float32s - first one is always(?) 0, second one would be the ending frame? (It's matched for the few I checked, but this needs double-checking)


0x80B2
  • unknown - contains a float32


0x80B3 Bone-to-Animation-Node linker thing / (help, give me a name!)
Each of these links a Bone to a Animation Node, so there will be a lot of these. In the case of quats and XYZ positions, you'll find two of these referencing the same bone, each time getting linked to a different animation node.
  • dword [00 04 10 XX] where XX is the index of the Bone (as listed in the current Sub-File, starting at 0).
  • uint32 Animation Node Type:  47 = matrices, 48: quaternions, 4B: XYZ positions or whatever they're called.
  • dword 0
  • dword [00 0C 00 XX] where XX is the index of the Animation Node (as listed under the current Animation (0x000B chunk), starting at 0).



======
BONUS
This isn't a 0x80?? chunk... This is what appears under chunk 0x000C, aka Animation Node. (Remember my constant warning, "May Not Apply To Dissidia GMOs".)
(I wanted to tidy this up... but then I realized if I do that, this will never get posted. Not in this century, anyway.)

After the standard chunk header:
  • This begins with a 16 byte header: dword unknown1, uint32 numWords, uint32 numEntries, dword unknown2.

unknown1 seems somehow related to the size and type of this Animation Node...
numEntries is, well, the number of entries in this Animation Node.
numWords is the number of words per entry (word just means 2 bytes). XYZ positions get 3, quaternions get 4, matrices get 16.
  • Then it is followed by numEntries entries. Each entry is made of 2+(2*numWords) bytes. I guess each entry contains:

word time
word stuff[numWords]
I don't know what format time uses. stuff is a XYZ position, quaternion, or matrix.

MrAdults

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #133 on: 2009-04-06 20:44:39 »
Yeah, I noticed the Gitaroo Man models you put up had a reverse winding order. I looked around for a little while for some kind of flag on the model, surface, mesh, or vertex array that would indicate a winding order or something, but didn't find one. I didn't run into any unknown chunks in those models either. It's quite possible that their engine simply uses reverse face culling. I could add a backwards facing fix command line option to mesh2rdm, but as you said, it's a pretty easy fix once you import the model into any modeling program. I'm currently not bothering to use normals from the GMO source even if it has them, eiither, mainly because I didn't care since none of the Dissidia models contained normals. :) The normals in the exported model are just generated based on the averaged face normal for a given vertex (or a number of other things depending on your export options), which is why they are backwards for those Gitaroo Man models (since the faces are flipped).

I've tried quite a few games with GMO files now, but Gitaroo Man is the only one with flipped faces so far. However, there are some models in Dracula that aren't reversed, but look like they should be two-sided for some surfaces. I thought this may be a material flag, but that doesn't appear to be the case. Naturally, I also looked for hints in the model/surface/mesh/array chunks, but didn't see anything. Given that it's surface-selective, though, it really seems like there should be something in the GMO itself to indicate two-sidedness. Unless the engine just has no face culling for the whole object, which would seem strange and wasteful.

koral

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #134 on: 2009-04-07 11:03:23 »
I have created a new PSP section in the Wiki, and also a new page for the GMO-format (to which the Dissidia page now also links): http://wiki.qhimm.com/PSP

Ukurere, I noticed you have wiki access too?
Please feel free to dump all your finding there if you wish, my GMO writeup was originally geared towards Dissidia so I may have missed a lot of the specifics of the "universal" format.
I am sure you will do a better job of documenting it :-D

If anybody here knows of any more PSP-games which use GMO models (check using GitMO) then either PM me or Ukurere and we will update the list in the wiki.
No need to spam this topic  :wink:

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #135 on: 2009-04-07 19:01:04 »
I *said* you guys had access :P You only notice now?

Geez. I'm so underappricated :P

Cyberman

  • *
  • Posts: 1572
    • View Profile
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #136 on: 2009-04-07 22:14:47 »
I *said* you guys had access :P You only notice now?

Geez. I'm so underappricated :P
Ummm do I know you?
LOL
I think they weren't paying attention, or couldn't afford to at least.

Cyb

Ukurere

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #137 on: 2009-04-08 04:10:29 »
Yay, working on Wiki article (preview here) ...aaaand having fun messing around with character poses! I love it! (I wonder how many years it takes to get good at 3D modeling/animation... eh, I've got time :D)

MrAdults, I've got some questions for you if you don't mind:
  • First off, is it okay with you if I use stuff from your forum and blog posts for the wiki article? Or, what I mean to ask is, how much copying & pasting can I get away with? Most stuff I'll end up paraphrasing, but there are chunks that already stand fine on their own for the article.
  • Just to make sure, 0x8041 is confirmed to be the parent bone? (
  • For 0x8015 Scale and Bias, instead of just multiplying a coordinate by Scale, you multiply UV coordinates by Scale*2.0 and vertex positions by Scale*2.0/65535.0 -- why is that?
  • Um... bones that have vertices weighted to them-- what would you call them? "Bones that have vertices weighted to them" is a little wordy, and I don't know if "weighted bones" makes any sense or not.
  • 0x8066 Mesh Index Data... you've mentioned triangle strips, so I guess that means you've revised this chunk since your big blog post (which makes no mention of them). Can you give us an update on that? I've got some info on it as well, but it includes some big leaps of faith which, if they're wrong, are better off not being out there and confusing people (not to mention needlessly bruising my ego :P).


P.S. halkun is so awesome my head exploded just reading his name
There, that's better :) I think
« Last Edit: 2009-04-08 04:12:11 by Ukurere »

halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #138 on: 2009-04-08 07:15:24 »
The proper graphics term is "weighted bone"

MrAdults

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #139 on: 2009-04-08 16:38:10 »
  • First off, is it okay with you if I use stuff from your forum and blog posts for the wiki article? Or, what I mean to ask is, how much copying & pasting can I get away with? Most stuff I'll end up paraphrasing, but there are chunks that already stand fine on their own for the article.
Sure, copy-paste as much as you like. Although a little thank you with link to my web site somewhere for all my hard work would be nice. ;)

  • Just to make sure, 0x8041 is confirmed to be the parent bone? (
Yep, no doubt about it. However, rather than being 1 byte, the index is 4096-based - if the bone count exceeds 255 the full WORD bit layout is changed appropriately. No idea why this is the case for so many index values in GMO files.

  • For 0x8015 Scale and Bias, instead of just multiplying a coordinate by Scale, you multiply UV coordinates by Scale*2.0 and vertex positions by Scale*2.0/65535.0 -- why is that?
As you might've guessed, that was just some sloppiness in where I was re-scaling non-float coordinates after interpreting them. I've since cleaned my own code up as well, which makes how those scale-and-bias values are used less confusing to the reader:
Code: [Select]
for (int i = 0; i < totalArrays; i++)
{
gmoIntAr_t *ar = &allArrays[i];
for (int j = 0; j < ar->numVerts; j++)
{
gmoIntVert_t *v = ar->verts+j;
if (uvScales)
{
v->uv[0] = v->uv[0]*2.0f*uvScales[2] + uvScales[0];
v->uv[1] = v->uv[1]*2.0f*uvScales[3] + uvScales[1];
}
if (posScales)
{
v->pos[0] = v->pos[0]*2.0f*posScales[3] + posScales[0];
v->pos[1] = v->pos[1]*2.0f*posScales[4] + posScales[1];
v->pos[2] = v->pos[2]*2.0f*posScales[5] + posScales[2];
}
}
}

  • Um... bones that have vertices weighted to them-- what would you call them? "Bones that have vertices weighted to them" is a little wordy, and I don't know if "weighted bones" makes any sense or not.
I would call them vertex-referenced bones. After all, the bones themselves aren't weighted, the vertices are weighted to them. ;) But "weighted bones" is fine too, people use the phrase regularly, as incorrect as it may seem.

  • 0x8066 Mesh Index Data... you've mentioned triangle strips, so I guess that means you've revised this chunk since your big blog post (which makes no mention of them). Can you give us an update on that? I've got some info on it as well, but it includes some big leaps of faith which, if they're wrong, are better off not being out there and confusing people (not to mention needlessly bruising my ego :P).
I had documented primType as a full int in my spec. However, the first 2 bytes of it actually seem to be responsible for dictating the index format. If the first byte is 3, it's triangles, if it's 4, it's quads. I have never seen any other value. If the second byte is non-0, it's "unindexed".

In the case of unindexed, there are no index values. However, there is 1 WORD where the start of the index list would be, which is the starting vertex index for the whole primitive. For both quads and triangles, you then plot indecies for the primitive from the base vertex index using the same index number as per usual.

Additionally, for quads, the stride can be > 4 for both indexed and non-indexed. I have never seen a model do the same with triangles (e.g. have a stride that is not 1), but it could be possible, in which case the same methodology would be applied. The correct way to handle strides > 4 is to index the first 4 values as per usual, and treat the rest as a single-index triangle strip. For each additional index, add a new set of 3 indices, using the current index in addition to the last 2 indices. So, if the stride is 5, you end up with 7 indices. If the stride is 6, you end up with 10 indices.

Edit: Spelling/clarification, sorry, just woke up. :)
« Last Edit: 2009-04-08 17:54:19 by MrAdults »

SOLDIERBOY

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #140 on: 2009-04-08 16:48:54 »
Hey I was wondering if someone can help me.

Ukurere

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #141 on: 2009-04-08 19:14:29 »
Thanks for the answers, now I need to sit back and digest the info, think about how to change the article...
[Offtopic: previous post by SOLDIERBOY looks like he meant to post in a different thread. So take that into account when responding, I guess.]

Sure, copy-paste as much as you like. Although a little thank you with link to my web site somewhere for all my hard work would be nice. ;)
Yes, of course I'll give you credit where I'm able to. If I were, say, putting up your info on a personal web page, I'd have your name/website more or less emblazoned across the whole thing. But I'm not sure how well that works for a wiki article. I'll think of something.

Quote
v->pos[0] = v->pos[0]*2.0f*posScales[3] + posScales[0];
Okay, but now I'm curious why *2.0 is in there. Is that just The Way Things Are?

Quote
(when primType=4 and stride>4, **** happens)
Um, so let me get this straight... if stride=6, that gives me 10 indices: 4 indices for quad + 3 indices for tristrip + 3 indices for tristrip?
And if stride==1, do I just forget about quads and treat it as a triangle strip?
(Side note: I haven't ever seen stride==2 or 3 for quads, and I assume you haven't either. Right?)

And that brings me to another thing: Do we call primType 4 "quads" or "triangle strip" (or both), and why the does it mix them together like that?


MrAdults

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #142 on: 2009-04-08 20:04:10 »
Yeah, the scale is such that 0.5 means "leave it as is" which I first observed when looking at the scale-and-bias relative to the UV coordinates. The positional scale relative to the given bias dictates the same thing in order to end up with the correct model origin. I suspect it's just the product of the initial formula used to generate the scale and bias values, as I see no real reason relating to modelview/texture matrix transforms that the value should be normalized to 0.5.

I have never seen stride 1, 2, or 3 for quads. If it were 1, presumably that would dictate to use the index list directly with no stripping and draw it as quads (much as the stride 1 triangles are treated). Have you actually seen 1, and if so, could you throw a model using 1 my way? :)

I think the reason for using a triangle strip with a quad base, if that's what's going on, is simply that it's more flexible. For example, with a full-blown quadstrip, you could have to have 2 additional indices for each strip bit instead of 1.

It's also possible (perhaps even more likely) that even stride 4 "quads" are still just triangle strips (after all, both would potentially have the same winding and number of indices - and a single-triangle strip with a "stride" of 3 wouldn't exist in known cases, because it would be redundant and just present as a normal triangle index list), but that would make the assumption that stride 1 "quads" don't exist. Both ways of looking at the data would in theory give the same results (with the given assumption in place), so it's just a matter of how you wish to interpret the data, I suppose. My code does leave the open-ended assumption in place that a stride-1 type-4 can exist and handles it as such, which is really what led to the whole "quad" line of thinking.

koral

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #143 on: 2009-04-08 21:58:30 »
All this information is passing completely over my head  :lol:
But do keep up the great work Ukurere and MrAdults!

I am trying to keep a running commentry of the major news in the first post of this topic, it is the least I can do!  :-)

And I have also added a little section on using mesh2rdm, as some people have had difficulty with the command-prompt side of things.
Maybe I should call it "Aurenasek116's mesh2rdm 101"
 :-D

BlitzNCS

  • *
  • Posts: 889
  • Master of nothing in particular
    • View Profile
    • My Youtube
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #144 on: 2009-04-08 23:55:33 »
Sorry it took me so long, but this is what i meant about the boxy-ness.

It wont go away, no matter how many smoothing and welding modifiers i apply to it!
(the texture discolourations are supposed to be there)

Crisis core models dump fine, so maybe it's a problem with my Laptop?
« Last Edit: 2009-04-08 23:58:44 by NeoCloudstrife »

koral

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #145 on: 2009-04-09 14:25:35 »
No, nothing wrong with your laptop or anything, there is something up with the actual polygons.

Dont apply "modifiers", just select all the polygons (ctrl+A in poly-selection mode) then scroll down until you get to "polygon properties" then hit "Auto Smooth".
If that doesnt solve the problem, then either there are duplicate vertices or there are duplicate polygons.
Either way, a weld operation on the vertices should  produce some results, so maybe you need to try even smaller thresh values?

BlitzNCS

  • *
  • Posts: 889
  • Master of nothing in particular
    • View Profile
    • My Youtube
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #146 on: 2009-04-09 14:59:08 »
anything under a threshold of like 50 says there arent any verticies within the threshold, and over that just ruins the model O.o
If i Detatch all the parts from the mesh using the part selection thing, auto smooth will work on those seperate parts. but then the bones will detatch and i can't change the weird arm positioning. its really weird, why wont the smoothing just work on the entire "SMDimport" object?

koral

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #147 on: 2009-04-09 15:09:41 »
I have absolutely no idea.  :?
I will try it myself and see what happens. What parameters did you use to export the model?

BlitzNCS

  • *
  • Posts: 889
  • Master of nothing in particular
    • View Profile
    • My Youtube
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #148 on: 2009-04-09 16:24:53 »
Code: [Select]
mesh2rdm File003766.gmo Cloud.smd -texpre Cloud -rotate -90 0 0 -scale 10.0 -smdout -flipuv

MrAdults

  • Guest
Re: Dissidia Models - Viewer and Extractor Tool by MrAdults
« Reply #149 on: 2009-04-09 17:10:02 »
There are a couple things you can do to fix this. Add "-smoothnorm 0.001" to your command line and it should fix it on export. Or in Max, you can:

1) Select the mesh object(s), and go to Modifiers->Mesh Editing->Edit Normals
2) With the Edit Normals modifier selected on the Modifier List, hit ctrl+A to select all normals
3) Hit the "Break" button
4) Hit the "Unify" button

The problem is just that the model's triangles are all broken up without shared verts, and by default, mesh2rdm only averages vertex normals along triangles that actually reference a vertex.