101
Scripting and Reverse Engineering / Re: FF8 Models, How did Qhimm rip them?
« on: 2009-05-25 04:15:19 »
My guess on how the chara.one files work. Might be incorrect because I didn't do any disassembly or testing in-game.
Edit: The next to last section (the section pointed to by the DWORD at 0x38 of the model data header) of the MCH model data looks similar to what I guessed to be the animation data in the chara.one files. So that might be the pose information.
Code: (Chara.one Header Hypothesis) [Select]
0x00: Number of PC and NPC models (32-bit). Might not count for calculating offsets.
0x04: First model's header (detailed below)
PC Model chara.one header:
0x00: Pointer to animation data? (32-bit)
0x04: Size of the animation data or whatever it is. (32-bit)
0x08: Size again.
0x0C: MCH number? (32-bit? Upper 16-bits might determine whether header refers to PC or NPC)
0x10: 4 bytes
0x14: MCH name? Not sure if used. (4 bytes)
0x18: 4 unknown bytes
NPC header:
0x00: Pointer to first TIM (32-bit)
0x04: Size of TIM & Model data (32-bit)
0x08: Size again.
0x10: MCH-type header possibly starts here. Offsets are relative to the TIM image.
After the model data pointer: 8 unknown bytes.
Both types usually end with the hex bytes "EE EE EE EE" after the unknown bytes, though there may be exceptions.
Edit: The next to last section (the section pointed to by the DWORD at 0x38 of the model data header) of the MCH model data looks similar to what I guessed to be the animation data in the chara.one files. So that might be the pose information.
Code: (Animation Section hypothesis) [Select]
Section Header:
WORD Number of animations
Animation Header:
WORD Number of frames
WORD Number of joints (Koral labeled them bones.)
In that old thread, Qhimm said the animations were stored using 4 bytes per node. By counting I think there might also be an additional 6 bytes per frame, but I'm not absolutely sure.