"Cracking" FFVIII model data

  • Thread starter Thread starter Afrotronics
  • Start date Start date
Status
Not open for further replies.
Using d001.mch I tried the whole 4shorts for the x,y,z coordinates and when I put the verteces in to a 3d space it looks like a vase or something kinda shaped like a vase, or a guy crouching.  Is it supposed to look like a vase?
 
Side notes: The animation data somehow stores the internal rotations for the model's skeletal nodes using 4 bytes per node. I'm speculating that the format would be one which a PSX could handle, in line with the lazy programmers theorem. Any ideas?

Also, the battle model format is vastly different from the normal field model format. I haven't even been able to find any vertex data in it, I'm almost suspecting it's compressed or something.

Qhimm I've analyzed the PSX FF8 data for a bit, it's identical to the PC data you have provided thus far. I suppose one can conclude they are the same surprisingly. Unlike FF7... For FF9 they used yet another format.. sigh at least we know :)

Cyb
 
Hey i finally found a way how to read something of those ff8 .mch's ... model with textures and skeleton to be exact. No animations yet.
And battle models are still giving me headaches, so its only bad-looking models up-to-date.
Here are some pics i dumped:
http://mypage.sk/BIN/ff8f_1.jpg
http://mypage.sk/BIN/ff8f_2.jpg
http://mypage.sk/BIN/ff8f_3.jpg
http://mypage.sk/BIN/ff8f_4.jpg
ff8f_5.jpg

http://mypage.sk/BIN/ff8f_6.jpg
 
And here is how are ff8 battle models (.dat's) stored:

 Final fantasy 8 battle dat format

At the start of file there is 'file data table'.

- file data table -
long            number_of_file_parts
number_of_file_parts * long             offset to file part
long            end_of_file_offset

Some file data have 'file data table' or 'data sub table' at their start if they
contain more items, textures for example. 'data sub table' is similar to 'file data table',
except it does not have end_of_file_offset. All offsets are relative to table start offset.

- data sub table -
long            number_of_file_parts
number_of_file_parts * long             offset to file part


File data table shows that file consists of 11 parts usually for monster battle files.
Of these i know that 1st is bone model, 2nd is model geometry and 11th are textures,
3rd is probably model animation, 7th might be monster information.
I haven't decrypted whats in other parts, but i think there are animations, maybe monster
info (i saw monster name there somewhere).

- bone model -
header is 16 bytes long
2 byte short    number_of_bones
14 bytes                unknown

each bone info is 30h (48 dec) bytes long
2 byte short    bone parent
2 byte short    bone length, negative
44 bytes                sometimes zeroes, sometimes not

- geometry -
There is 'data sub table' at the start of data. Shows number of objects and
offsets to their data.

After table there are vertices. each is 3 * short = 6 bytes;
there ain't no number of vertices, but vertex data are 16 bytes padded, and
last 8 bytes are zeroes. before that there are numbers of 3polys and 4polys.
After that data are padded with zeroes to 16 bytes from start of vertex data.

then polygons follow


- texures -
There is table like 'file data table' at the start, from which you can see how many
textures are there, what are their offsets and sizes. They are FF8 tim's, 8bit paletized,
usually with sizes 128x128, so their size is 16,928 bytes. Data of these texture files
start with these bytes: '10 00 00 00  09 00 00 00  0C 02 00 00'
 
I'm really sorry to revive this old topic, but I'm currently trying to work on that FF8 formats based on this topic, however, I've got a problem... :D

After table there are vertices. each is 3 * short = 6 bytes;
there ain't no number of vertices, but vertex data are 16 bytes padded, and
last 8 bytes are zeroes. before that there are numbers of 3polys and 4polys.
After that data are padded with zeroes to 16 bytes from start of vertex data.

Well, I don't want to criticize your english, since mine isn't better, however ... I don't have any idea what you're talking about... :-?
Could you, or somebody else who understood it, tell me, what you mean?

Oh, BTW: Yes, part 7 is monster information. Right at the beginning there is a 24 bytes length string telling you the name, you will just have to add 2 to every single char...

Thanx!

 - Alhexx

 - edit -
Oh, and how does that polygon data look like?
 
I have to say I can't read DAT files properly. Vertex data look
quite promising, but polygon data look absolutely wrong.
I could not find vertices count anywhere, so I though that verts
end when vert coords are zero. But looks like its not it.
Here are structs and code I use:
Code: [Select]
Code:
 struct s_FF8_dat_3poly {  short vi[3];  //vertex indexes  char texcoords1[4];   short u1;  char texcoords2[2];  short aa; } poly3; struct s_FF8_dat_4poly {  short vi[4];  //vertex indexes  char texcoords1[2];  short u1;  char texcoords2[2];  short aa;  char texcoords3[4]; } poly4; for( i=0; i<polys3_count; i++ ) {  cfin->Read( 16, &poly3 );    ula[ 0 ] = poly3.vi[ 0 ] &= 0x7FFF;  ula[ 1 ] = poly3.vi[ 1 ];  ula[ 2 ] = poly3.vi[ 2 ];  StorePolygon( 3, ula );  SetPolygonMaterial( polygons_count-1, 0 );  SetPointTexCoords( GetPolygonPoint( polygons_count-1, 0 ),   (double) poly3.texcoords1[ 0 ] / 127, (double) poly3.texcoords1[ 1 ] / 127 );  SetPointTexCoords( GetPolygonPoint( polygons_count-1, 1 ),   (double) poly3.texcoords2[ 0 ] / 127, (double) poly3.texcoords2[ 1 ] / 127 );  SetPointTexCoords( GetPolygonPoint( polygons_count-1, 2 ),   (double) poly3.texcoords2[ 2 ] / 127, (double) poly3.texcoords2[ 3 ] / 127 ); } for( i=0; i<polys4_count; i++ ) {  cfin->Read( 20, &poly4 );    ula[ 0 ] = poly4.vi[ 0 ] &= 0x7FFF;  ula[ 1 ] = poly4.vi[ 1 ];  ula[ 2 ] = poly4.vi[ 2 ];  ula[ 3 ] = poly4.vi[ 3 ];  StorePolygon( 4, ula );  SetPolygonMaterial( polygons_count-1, 0 );  SetPointTexCoords( GetPolygonPoint( polygons_count-1, 0 ),   (double) poly4.texcoords1[ 0 ] / 127, (double) poly4.texcoords1[ 1 ] / 127 );  SetPointTexCoords( GetPolygonPoint( polygons_count-1, 1 ),   (double) poly4.texcoords2[ 0 ] / 127, (double) poly4.texcoords2[ 1 ] / 127 );  SetPointTexCoords( GetPolygonPoint( polygons_count-1, 2 ),   (double) poly4.texcoords3[ 0 ] / 127, (double) poly4.texcoords3[ 1 ] / 127 );  SetPointTexCoords( GetPolygonPoint( polygons_count-1, 3 ),   (double) poly4.texcoords3[ 2 ] / 127, (double) poly4.texcoords3[ 3 ] / 127 ); }
If you want to read MCH files I can put here some code too.
 
Okay, thanks. I'll see if can use that stuff in my work.
However, something I haven't been posting for a while: :D

tankyou.jpg


 - Alhexx
 
Its amazing how quickly you guys figure this stuff out... I really need to learn how to do this stuff some time.
 
I have to say I can't read DAT files properly. Vertex data look
quite promising, but polygon data look absolutely wrong.
I could not find vertices count anywhere, so I though that verts
end when vert coords are zero. But looks like its not it.
Here are structs and code I use:
...
If you want to read MCH files I can put here some code too.
10:27 5/10/2004
Thanks for sharing..hmmmmm I wonder if this is anything like the PSX version data time to look!

Cyb

15:20 5/10/2004
Ok after abusing the FACE information some I find it rather perplexing.
First none of the verticies are grouped as far as I can tell at least.  I'm a little puzzled about the edge information I'm 3d ignorant, why are there 2 sets of vertex  data?  All the information that doesn't make sense in the faces .. actually don't seem to do anything for moi.  (IE they are invariant).

IE I have
1 2 0
0 1 2
for one triangle polygon.
What does the second set of numbers do?

The verticies are my other problem as I said they don't appear grouped.
Or is this what the edge data is for? IE
Vertex 1 2 0 define this polygon and the remaining data does something else (useful perhaps?)  I've drawn all the faces at once and it merely gives a jumbled pile of trinagles looks funny actually but seriously ...

I think this is why I'm having trouble with FF7 polygon data as well (hmmm). Or at least finding how the skeleton information is applied at the very least.
 
Ok after abusing the FACE information some I find it rather perplexing.
First none of the verticies are grouped as far as I can tell at least. I'm a little puzzled about the edge information I'm 3d ignorant, why are there 2 sets of vertex data? All the information that doesn't make sense in the faces .. actually don't seem to do anything for moi. (IE they are invariant).

IE I have
1 2 0
0 1 2
for one triangle polygon.
What does the second set of numbers do?
please to which FACE information are you reffering to ?
sometimes 2nd set of vertex indexes is set to array texture coords, or colours.

In ff7 p files polygons there were first vertex indexes, then normal indexes and last were some edge indexes. (according to doc http://mirex.mypage.sk/FILES/pformat.txt ) I was using only vertex indexes btw.
 
please to which FACE information are you reffering to ?
sometimes 2nd set of vertex indexes is set to array texture coords, or colours.

In ff7 p files polygons there were first vertex indexes, then normal indexes and last were some edge indexes. (according to doc http://mirex.mypage.sk/FILES/pformat.txt ) I was using only vertex indexes btw.

FF8 PSX

The first 3 faces plus face 12 to see what a Quad looks like, of a small Squall model have this data
Code: [Select]
Code:
// FACE 0// 25010607// Polygon Flat Tri w Tex Opaque No Light// 0001 0002 0000 0000// 0000 0001 0002 0000// 00,01 08,04 13,02 0E,00// FACE 1// 25010607// Polygon Flat Tri w Tex Opaque No Light// 0001 000A 0007 0000// 0000 0003 0004 0000// 68,1D 5F,1D 65,1A 00,00// FACE 2// 25010607// Polygon Flat Tri w Tex Opaque No Light// 000A 0001 0004 0000// 0003 0000 0005 0000// 68,1D 71,2A 68,27 00,00// FACE 12// 2D010709// Polygon Flat Quad w Tex Opaque No Light// 000A 0009 0007 0008// 0003 0009 0004 000A// 68,1D 71,2A 6D,1D 00,00
There are models with multiple tims that appear to have higher resolution in terms of polygons and textures.  However this is the structure information I am using.  I can't acertain the size of the remaining data in the model or what it's for.

Actual structure information I'm using.
Code: [Select]
Code:
typedef struct{   UINT32   REFS[64];}PSX_FF8_MDL_HDR;typedef struct{   UINT32   SKJ;   UINT32   Vert;   UINT32   ZZ0;   UINT32   Face;   UINT32   ZZ1;   UINT32   V2B;   UINT32   ZZ2[10];}PSX_FF8_MDL_HDR2;typedef struct{   UINT16   Parent;   INT16    Length;//??   UINT16   ZZ0[2];   UINT16   FLAGS;//??   UINT16   ZZ1[27];}PSX_FF8_SKJ;typedef struct{   UINT8    U;   UINT8    V;}PSX_FF8_UV;typedef struct{   PSX_FF8_UV     UV[4];   // 8   UINT32         ZZ0;     // 4   UINT16         ZZ1[4];  // 8   UINT32         Type;    // 4   UINT32         ZZ2[2];  // 8   UINT16         Edge[8]; // 16   PSX_FF7_CLR    Colors[4];// 16}PSX_FF8_FACE;

They provide 8 edge spaces but only 6 are used for triangles and 8 for quads.
I've not bothered with the UV data yet as I just want the actual 'frame' to show first.  I'm wondering if the coordinates are relative to each other in FF8.
The Skeleton Joint information seems mostly empty it has a few things and that's about it.
I'm baffled over the edge information and how to use it at this time.
I think the second set of Index values is how the polygons are jamed together, but I can't be sure as I have no idea what I'm looking at :)


Cyb
 
They provide 8 edge spaces but only 6 are used for triangles and 8 for quads.
I've not bothered with the UV data yet as I just want the actual 'frame' to show first.  I'm wondering if the coordinates are relative to each other in FF8.
The Skeleton Joint information seems mostly empty it has a few things and that's about it.
I'm baffled over the edge information and how to use it at this time.
I think the second set of Index values is how the polygons are jamed together, but I can't be sure as I have no idea what I'm looking at :)


Cyb


Oh no I've gone crosseyed :z
 
Oh no I've gone crosseyed :z
You qouted part of a long post and said you went cross eyed. I donno.. are you just posting for the heck of it?

Cyb
 
Any progress? I'd really like to be able to have the ff8 character models in Milkshape 3D or 3DS Max someday.
 
Can be done, as you see few pics in my posts ... I just have to make new release of Biturn.
 
Have you updated Biturn yet. Sorry for bugging, however, I live, eat and sleep ff8 :)
 
Hey, thanks man. Unfortunately, I'm stuck at my cousins house for the week with a comuter that was made like 6 years ago and it can't do anything big without crashing... So I'll have to get it sometime this weekend.
 
Status
Not open for further replies.
Back
Top