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'