Page 1 of 2
Red Ninja PS2 Models .QMX
Posted: Mon Apr 03, 2023 8:41 am
by roocker666
Hi guys, is there a way to extract models from this game?, model files are .QMX
The model is made by a lot of submeshes, I analyzed the file "000163.QMX" first submesh is at 0x2C00, this is some kind of header(all submeshes have this).
then at 0x2C30 I think 1st byte is vertices count, 2nd byte is always 80, 0x2C50 is the start of vertices(1st submesh). I am not sure about UVs maybe at 0x2C60?
There is no faces data so maybe are autogenerated. I don't know if all this info is correct, here is the sample:
000163.rar
Thanks!
Re: Red Ninja PS2 Models .QMX
Posted: Mon Apr 03, 2023 1:03 pm
by shakotay2
I could have sworn I'd checked for vertices, but seems I got uvs and normals:
.
Qmx.jpg
Re: Red Ninja PS2 Models .QMX
Posted: Mon Apr 03, 2023 1:10 pm
by shakotay2
on another try:
.
Qmx_betterOne.png
Re: Red Ninja PS2 Models .QMX
Posted: Mon Apr 03, 2023 8:31 pm
by roocker666
shakotay2 wrote: ↑Mon Apr 03, 2023 1:03 pm
I could have sworn I'd checked for vertices, but seems I got uvs and normals:
Yeah, I got something similar, vertices, Uvs and normals at the same time, that is so weird.. I will try to check Xbox version, maybe it will be more easy. I will upload the Xbox sample later, thanks!
Re: Red Ninja PS2 Models .QMX
Posted: Mon Apr 03, 2023 9:47 pm
by shakotay2
roocker666 wrote: ↑Mon Apr 03, 2023 8:31 pm
, that is so weird..
No. It's simply a matter of starting with vertices at 0x2C70 instead of 0x2C50, imho (uvs assumed to be at 0x2C50 then, but didn't check this).
And 'yes', autocreation of faces needs some trick, I guess (maybe some vertex grouping required?):
edit: nope, the "only" problem was: there's two different FVF sizes
.
Qmx_littleBitStrange.jpg
Re: Red Ninja PS2 Models .QMX
Posted: Tue Apr 04, 2023 1:23 am
by roocker666
shakotay2 wrote: ↑Mon Apr 03, 2023 9:47 pm
roocker666 wrote: ↑Mon Apr 03, 2023 8:31 pm
, that is so weird..
No. It's simply a matter of starting with vertices at 0x2C70 instead of 0x2C50, imho (uvs assumed to be at 0x2C50 then, but didn't check this).
And 'yes', autocreation of faces needs some trick, I guess (maybe some vertex grouping required?):
NIce, it is looking better. I guess you are right, I found a 2nd group at 0x39980. It seems like ID for groups is 03 04 01 00, so in total two groups of submeshes.
Re: Red Ninja PS2 Models .QMX
Posted: Sun Apr 09, 2023 5:03 am
by roocker666
All right, I did a deep research. We have 2 main groups but each main group has more groups with submeshes.
So it is something like this:
0x2AD0 MAIN GROUP1(ID 03 04 01 00)
0x2B00 1ST GROUP HEADER(48 SUBMESHES). 0x2B88 IS SUBMESHES COUNT
0x2C00 1ST GROUP-1ST SUBMESH, 2ND SUBMESH, 3RD SUBMESH, ETC..
0x114B0 2ND GROUP HEADER(110 SUBMESHES). 0x11508 IS SUBMESHES COUNT
0x11580 2ND GROUP-1ST SUBMESH..
0x325E0 3RD GROUP HEADER(25 SUBMESHES). 0x32608 IS SUBMESHES COUNT
0x32680 3RD GROUP-1ST SUBMESH..
0x39980 MAIN GROUP2(ID 03 04 01 00)
0x399B0 1ST GROUP HEADER(6 SUBMESHES). 0x39A0A8 IS SUBMESHES COUNT
0x39A80 1ST GROUP-1ST SUBMESH..
I still don't know about vertices count, for example in MAIN GROUP1/1st GROUP-1ST SUBMESH, it could be at 0x2C30 or 0x2C4E(1BYTE).
Re: Red Ninja PS2 Models .QMX
Posted: Sun Apr 09, 2023 7:58 am
by shakotay2
roocker666 wrote: ↑Sun Apr 09, 2023 5:03 am
All right, I did a deep research. We have 2 main groups but each main group has more groups with submeshes.
Cool!
I still don't know about vertices count, ...
I'd already forgotten how I got it. Here's the code. The trick is: vCnt-32768 to find the real value.
Code: Select all
do { //
nValue[0]= 0xDD; nValue[1]= 0xDD; nValue[2]= 0xDD; nValue[3]= 0xDD; // assumed signature of vBlock headers
nValue[4]= 0xEE; nValue[5]= 0xEE; nValue[6]= 0xEE; nValue[7]= 0xEE;
offs2 = FindBytes(lpFBuf, j, dwFileSize-j, nValue, 8) ;
if (offs2!=0) {
pFBuf += offs2 -4; j += offs2 -4;
addr[cnt]= j +32 +32; // vertex block, FVF= 48
GetDW(pFBuf, j, vCnt, false) ;
if (vCnt>32767) {
fprintf(stream, "DD...EE...: %lx, %lx\n", vCnt-32768, addr[cnt]) ;
dwVertsCnt[cnt]= vCnt-32768;
if (cnt<197) cnt++ ; // next submesh
} else chMB("vCnt error!") ;
//wVertsCnt= (WORD) vCnt ;
pFBuf += 16 ; j += 16 ; // skip signature bytes
}
else bStop= true ;
} while (!bStop&&(j<dwFileSize)) ;
When I collect the first 48 sub meshes only it looks like so (degenerated faces erased, thus a lot of faces are missing):
.
Qmx_48_sub_meshes.png
Re: Red Ninja PS2 Models .QMX
Posted: Sun Apr 09, 2023 11:52 pm
by roocker666
shakotay2 wrote: ↑Sun Apr 09, 2023 7:58 am
roocker666 wrote: ↑Sun Apr 09, 2023 5:03 am
All right, I did a deep research. We have 2 main groups but each main group has more groups with submeshes.
Cool!
I still don't know about vertices count, ...
I'd already forgotten how I got it. Here's the code. The trick is: vCnt-32768 to find the real value.
When I collect the first 48 sub meshes only it looks like so (degenerated faces erased, thus a lot of faces are missing):
If our info is correct, Why do We still got wrong or missing polygons? BTW, UVs in 1st submesh are at 0x2C50, so you were right about that.
Re: Red Ninja PS2 Models .QMX
Posted: Mon Apr 10, 2023 7:21 am
by shakotay2
roocker666 wrote: ↑Sun Apr 09, 2023 11:52 pmIf our info is correct, Why do We still got wrong or missing polygons?
Seems half of the vertices are doubles (one of the the main problems when "extracting" PS2 models). But about 50% that's really a lot - I have no idea, why.
Re: Red Ninja PS2 Models .QMX
Posted: Tue Apr 11, 2023 6:25 am
by roocker666
shakotay2 wrote: ↑Mon Apr 10, 2023 7:21 am
Seems half of the vertices are doubles (one of the the main problems when "extracting" PS2 models). But about 50% that's really a lot - I have no idea, why.
I see. Well, at least We tried lol, Thank you for all your help man!
Re: Red Ninja PS2 Models .QMX
Posted: Tue Apr 11, 2023 7:40 am
by shakotay2
PS2 character models are almost always a pita to convert to .obj.

A static mesh (chest, table, plank or something similar) might be easier to get a clue.
Re: Red Ninja PS2 Models .QMX
Posted: Tue Apr 11, 2023 8:23 am
by roocker666
shakotay2 wrote: ↑Tue Apr 11, 2023 7:40 am
PS2 character models are almost always a pita to convert to .obj.

A static mesh (chest, table, plank or something similar) might be easier to get a clue.
I know!, that sucks.. Ok, ok, I found something weird, some submeshes have other format, I mean vertices, Uvs and normals are in other place and use other padding(if you compare this submesh#8 with submesh#1). So we have two different submeshes format.(I did not check the other groups yet..)
Here is a picture:
submesh_8.jpg
I am pretty sure that blue square is vertices count, green square could be related to faces(I really don't know...)
You can see that submesh#1 and submesh#8 also have different padding. I am not sure if in submesh#8 vertices and Uvs offsets are correct, I am still trying to find the answer. Submesh header in both looks the same, so no problem with that.
Re: Red Ninja PS2 Models .QMX
Posted: Tue Apr 11, 2023 8:45 am
by roocker666
It is hard to identify all models because there are no names, just numbers. But here is a weapon(katana), it has only 7 submeshes:
000170 katana.rar
Re: Red Ninja PS2 Models .QMX
Posted: Tue Apr 11, 2023 10:01 am
by shakotay2
Thanks to your hint concerning the different FVF sizes (48 and 64 so far) we get more vertices now:
.
163_qmx.png
(H2O files see next post)