Difference between revisions of "FF8/FileFormat DAT"
< FF8
Jump to navigation
Jump to search
my_wiki>Myst6re |
my_wiki>Myst6re |
||
Line 196: | Line 196: | ||
Optionnal section, often empty. | Optionnal section, often empty. | ||
− | == Section 5: | + | == Section 5: Unknown == |
− | + | Unknown sequences. | |
=== Header === | === Header === | ||
Line 209: | Line 209: | ||
| 0 | | 0 | ||
| 2 bytes | | 2 bytes | ||
− | | Number of | + | | Number of sequences |
|- | |- | ||
| 2 | | 2 | ||
− | | | + | | nbSequences * 2 bytes |
− | | | + | | Sequences Positions |
|} | |} | ||
Line 222: | Line 222: | ||
== Section 7: Informations & stats == | == Section 7: Informations & stats == | ||
− | + | {| border="1" cellspacing="1" cellpadding="3" align="center" style="border: 1px solid black; border-collapse: collapse;" | |
+ | ! style="background:rgb(204,204,204)" | Offset | ||
+ | ! style="background:rgb(204,204,204)" | Length | ||
+ | ! style="background:rgb(204,204,204)" | Description | ||
+ | |- | ||
+ | | 0 | ||
+ | | 24 bytes | ||
+ | | Monster name | ||
+ | |- | ||
+ | | 24 | ||
+ | | 4 bytes | ||
+ | | HP values | ||
+ | |- | ||
+ | | 28 | ||
+ | | 4 bytes | ||
+ | | Str values | ||
+ | |- | ||
+ | | 32 | ||
+ | | 4 bytes | ||
+ | | Mag values | ||
+ | |- | ||
+ | | 36 | ||
+ | | 4 bytes | ||
+ | | Vit values | ||
+ | |- | ||
+ | | 40 | ||
+ | | 4 bytes | ||
+ | | Spr values | ||
+ | |- | ||
+ | | 44 | ||
+ | | 4 bytes | ||
+ | | Spd values | ||
+ | |- | ||
+ | | 48 | ||
+ | | 4 bytes | ||
+ | | Eva values | ||
+ | |- | ||
+ | | 52 | ||
+ | | 16*4 bytes | ||
+ | | Abilities, low level | ||
+ | |- | ||
+ | | 116 | ||
+ | | 16*4 bytes | ||
+ | | Abilities, med level | ||
+ | |- | ||
+ | | 180 | ||
+ | | 16*4 bytes | ||
+ | | Abilities, high level | ||
+ | |- | ||
+ | | 244 | ||
+ | | 1 byte | ||
+ | | Med level start | ||
+ | |- | ||
+ | | 245 | ||
+ | | 1 byte | ||
+ | | High level start | ||
+ | |- | ||
+ | |style="background:rgb(255,255,204)" | 246 | ||
+ | |style="background:rgb(255,255,204)" | 1 byte | ||
+ | |style="background:rgb(255,255,204)" | Unknown (flags, 3 bits used) | ||
+ | |- | ||
+ | | 247 | ||
+ | | 1 byte | ||
+ | | [LSB] Zombie / Fly / zz1 / zz2 / zz3 / Auto-Reflect / Auto-Shell / Auto-Protect [MSB] | ||
+ | |- | ||
+ | | 248 | ||
+ | | 3 bytes | ||
+ | | Cards (low/med/high) | ||
+ | |- | ||
+ | | 251 | ||
+ | | 3 bytes | ||
+ | | Devour (low/med/high) | ||
+ | |- | ||
+ | | 254 | ||
+ | | 1 byte | ||
+ | | [LSB] zz1 / zz2 / unused / unused / unused / unused / Diablos missed / Always obtains card [MSB] | ||
+ | |- | ||
+ | |style="background:rgb(255,255,204)" | 255 | ||
+ | |style="background:rgb(255,255,204)" | 1 byte | ||
+ | |style="background:rgb(255,255,204)" | Unknown (flags, 4 bits used) | ||
+ | |- | ||
+ | | 256 | ||
+ | | 2 bytes | ||
+ | | Extra EXP | ||
+ | |- | ||
+ | | 258 | ||
+ | | 2 bytes | ||
+ | | EXP | ||
+ | |- | ||
+ | | 260 | ||
+ | | 8 bytes | ||
+ | | Draw (low) | ||
+ | |- | ||
+ | | 268 | ||
+ | | 8 bytes | ||
+ | | Draw (med) | ||
+ | |- | ||
+ | | 276 | ||
+ | | 8 bytes | ||
+ | | Draw (high) | ||
+ | |- | ||
+ | | 284 | ||
+ | | 8 bytes | ||
+ | | Mug (low) | ||
+ | |- | ||
+ | | 292 | ||
+ | | 8 bytes | ||
+ | | Mug (med) | ||
+ | |- | ||
+ | | 300 | ||
+ | | 8 bytes | ||
+ | | Mug (high) | ||
+ | |- | ||
+ | | 308 | ||
+ | | 8 bytes | ||
+ | | Drop (low) | ||
+ | |- | ||
+ | | 316 | ||
+ | | 8 bytes | ||
+ | | Drop (med) | ||
+ | |- | ||
+ | | 324 | ||
+ | | 8 bytes | ||
+ | | Drop (high) | ||
+ | |- | ||
+ | | 332 | ||
+ | | 1 byte | ||
+ | | Mug rate | ||
+ | |- | ||
+ | | 333 | ||
+ | | 1 byte | ||
+ | | Drop rate | ||
+ | |- | ||
+ | | 334 | ||
+ | | 1 byte | ||
+ | | Padding (0x00) | ||
+ | |- | ||
+ | | 335 | ||
+ | | 1 byte | ||
+ | | APs | ||
+ | |- | ||
+ | |style="background:rgb(255,255,204)" | 336 | ||
+ | |style="background:rgb(255,255,204)" | 16 bytes | ||
+ | |style="background:rgb(255,255,204)" | Unknown | ||
+ | |- | ||
+ | | 352 | ||
+ | | 8 bytes | ||
+ | | Elemental resistance<br/>(Fire, Ice, Thunder, Earth, Poison, Wind, Water, Holy) | ||
+ | |- | ||
+ | | 360 | ||
+ | | 20 bytes | ||
+ | | Mental resistance<br/> | ||
+ | (Death, Poison, Petrify, Darkness,<br/> | ||
+ | Silence, Beserk, Zombie, Sleep,<br/> | ||
+ | Haste, Slow, Stop, Regen,<br/> | ||
+ | Reflect, Doom, Slow Petrify, Float,<br/> | ||
+ | Confuse, Drain, Expulsion, ???) | ||
+ | |} | ||
+ | |||
+ | === Abilities === | ||
+ | |||
+ | typedef struct { | ||
+ | uint8 kernel_id; | ||
+ | uint8 unknown; | ||
+ | uint16 ability_id; | ||
+ | } | ||
+ | |||
+ | kernel_id is the used table in kernel.bin. May be 0x02 (= magic) or 0x08 (= monster ability). ability_id is the ability in the selected kernel table. | ||
+ | |||
+ | === Draw/mug/drop === | ||
+ | |||
+ | typedef struct { | ||
+ | uint8 id_1; // magic_id for Draw, item_id for mug & drop | ||
+ | uint8 qty_1; | ||
+ | uint8 id_2; | ||
+ | uint8 qty_2; | ||
+ | uint8 id_3; | ||
+ | uint8 qty_3; | ||
+ | uint8 id_4; | ||
+ | uint8 qty_4; | ||
+ | } | ||
+ | |||
+ | == Section 8: Battle scripts/AI == | ||
+ | |||
− | |||
== Section 9: Sounds == | == Section 9: Sounds == |
Revision as of 01:03, 9 December 2010
By Mirex, JWP and myst6re.
Contents
Header
DAT file is divided into 11 sections (except for c0m127.dat, which contains only 2 sections : 7th and 8th).
Offset | Length | Description |
---|---|---|
0 | 4 bytes | Number of sections (always =11, except for c0m127.dat) |
4 | nbSections * 4 bytes | Section Positions |
4 + nbSections * 4 | 4 bytes | File size |
Section 1: Skeleton
Offset | Length | Description |
---|---|---|
0 | 2 bytes | Number of bones |
2 | 14 bytes | Unknown |
16 | Number of bones * 48 bytes | Bones |
Bone struct
Offset | Length | Description |
---|---|---|
0 | 2 bytes | Parent id |
2 | 2 bytes | Bone size |
4 | 44 bytes | Unknown (often empty) |
Section 2: Model geometry
Header (data sub table)
Offset | Length | Description |
---|---|---|
0 | 4 bytes | Number of objects |
4 | nbObjects * 4 bytes | Object Positions |
Object Data
Offset | Length | Description |
---|---|---|
0 | 2 bytes | Number of Vertices Data |
2 | Varies * NbVerticesData | Vertices Data |
Varies | absolutePosition % 4 | Padding (0x00) |
Varies | 2 bytes | Num triangles |
Varies | 2 bytes | Num quads |
Varies | 8 bytes | Padding (0x00) |
Varies | numTriangles * 16 bytes | Triangles |
Varies | numQuads * 20 bytes | Quads |
Varies | 4 bytes | Total number of vertices (may be not visible) |
Vertice Data
Offset | Length | Description |
---|---|---|
0 | 2 bytes | Bone id |
2 | 2 bytes | Number of vertices |
4 | nbVertices * 6 bytes | Vertices (nbVertices * 3 shorts) |
Useful structures
typedef struct { sint16 x, y, z; } vertice;
(sizeof = 6)
typedef struct { uint16 vertex_indexes[3]; uint8 texCoords1[2]; uint8 texCoords2[2]; uint16 textureID_related; uint8 texCoords3[2]; uint16 u; // textureID_related2 } triangle;
(sizeof = 16)
typedef struct { uint16 vertex_indexes[4]; uint8 texCoords1[2]; uint16 textureID_related; uint8 texCoords2[2]; uint16 u; // textureID_related2 uint8 texCoords3[2]; uint8 texCoords4[2]; } triangle;
(sizeof = 20)
Section 3: Model animation
Header (data sub table)
Offset | Length | Description |
---|---|---|
0 | 4 bytes | Number of animations |
4 | nbAnimations * 4 bytes | Animations Positions |
Section 4: Unknown
Optionnal section, often empty.
Section 5: Unknown
Unknown sequences.
Header
Offset | Length | Description |
---|---|---|
0 | 2 bytes | Number of sequences |
2 | nbSequences * 2 bytes | Sequences Positions |
Section 6: unknown
Can be empty.
Section 7: Informations & stats
Offset | Length | Description |
---|---|---|
0 | 24 bytes | Monster name |
24 | 4 bytes | HP values |
28 | 4 bytes | Str values |
32 | 4 bytes | Mag values |
36 | 4 bytes | Vit values |
40 | 4 bytes | Spr values |
44 | 4 bytes | Spd values |
48 | 4 bytes | Eva values |
52 | 16*4 bytes | Abilities, low level |
116 | 16*4 bytes | Abilities, med level |
180 | 16*4 bytes | Abilities, high level |
244 | 1 byte | Med level start |
245 | 1 byte | High level start |
246 | 1 byte | Unknown (flags, 3 bits used) |
247 | 1 byte | [LSB] Zombie / Fly / zz1 / zz2 / zz3 / Auto-Reflect / Auto-Shell / Auto-Protect [MSB] |
248 | 3 bytes | Cards (low/med/high) |
251 | 3 bytes | Devour (low/med/high) |
254 | 1 byte | [LSB] zz1 / zz2 / unused / unused / unused / unused / Diablos missed / Always obtains card [MSB] |
255 | 1 byte | Unknown (flags, 4 bits used) |
256 | 2 bytes | Extra EXP |
258 | 2 bytes | EXP |
260 | 8 bytes | Draw (low) |
268 | 8 bytes | Draw (med) |
276 | 8 bytes | Draw (high) |
284 | 8 bytes | Mug (low) |
292 | 8 bytes | Mug (med) |
300 | 8 bytes | Mug (high) |
308 | 8 bytes | Drop (low) |
316 | 8 bytes | Drop (med) |
324 | 8 bytes | Drop (high) |
332 | 1 byte | Mug rate |
333 | 1 byte | Drop rate |
334 | 1 byte | Padding (0x00) |
335 | 1 byte | APs |
336 | 16 bytes | Unknown |
352 | 8 bytes | Elemental resistance (Fire, Ice, Thunder, Earth, Poison, Wind, Water, Holy) |
360 | 20 bytes | Mental resistance (Death, Poison, Petrify, Darkness, |
Abilities
typedef struct { uint8 kernel_id; uint8 unknown; uint16 ability_id; }
kernel_id is the used table in kernel.bin. May be 0x02 (= magic) or 0x08 (= monster ability). ability_id is the ability in the selected kernel table.
Draw/mug/drop
typedef struct { uint8 id_1; // magic_id for Draw, item_id for mug & drop uint8 qty_1; uint8 id_2; uint8 qty_2; uint8 id_3; uint8 qty_3; uint8 id_4; uint8 qty_4; }
Section 8: Battle scripts/AI
Section 9: Sounds
Contains AKAO sequences.
Section 10: Sounds
Contains AKAO sequences.
Section 11: Textures
Contains some TIMs with size 128x128 (8bit paletized).
Offset | Length | Description |
---|---|---|
0 | 4 bytes | Number of TIMs |
4 | nbTIMs * 4 bytes | TIMs Positions |
4 + nbTIMs * 4 | 4 bytes | End of file |
8 + nbTIMs * 4 | Varies * nbTIMs | TIMs |