Difference between revisions of "Motion (.MOT) File Format"

From Ōkami Speedrun Wiki
Jump to navigation Jump to search
m
m
Line 4: Line 4:


This file incorporates '''curves and/or properties''' for an given embbed model. Because of that, it's almost always certain that they are contained in a file container (dat).
This file incorporates '''curves and/or properties''' for an given embbed model. Because of that, it's almost always certain that they are contained in a file container (dat).
There's instances of mots that controlled properties instead of bones, so it's not always certain of what it animates. A further inspection have to be done.
There's instances of mots that controlled properties instead of bones, so it's not always certain of what it animates. A further inspection have to be done. But since it animates bones most of the times, i will threat it as curves that animates bones.


== Mot main header ==
== Mot main header ==
Line 34: Line 34:
|}
|}


the 4th offset of each curve info can be either a float, or uint32. That's handled when the curve property is defined. It depends on the Property Family the curve is set in.
the 4th offset of each curve info can be either a float, or uint32. it's only set as a float if the property family of the curve is a Single Pose. Otherwise, it's a offset.
The curve property will define what property of the bone/object it is animating. There's some properties who could not be determined yet. See some already identified values bellow.
The curve property will define what property of the bone/object it is animating. There's some properties who could not be determined yet. See some already identified values bellow.


Line 140: Line 140:


(Example):
(Example):
{| class="wikitable"
! Offset !! Value !! Description
|-
| 0x00 || 0 || This field is telling that '''the curve is animating the bone index 0 of the model.'''
|-
| 0x01 || 16 || This field is telling that '''the curve animates the X Position of the root bone''', being set on a '''Quantized Curve Property Family.'''
|-
| 0x02 || 4 || This field is telling that '''there's 4 keyframes on this curve.'''
|-
| 0x04 || 512 || This field is '''telling in which offset of the file the keyframe infos are located'''.
|}

Revision as of 18:14, 7 September 2025

Note: This page pertains to Reverse Engineering of Okami File Formats.

Explanation

This file incorporates curves and/or properties for an given embbed model. Because of that, it's almost always certain that they are contained in a file container (dat). There's instances of mots that controlled properties instead of bones, so it's not always certain of what it animates. A further inspection have to be done. But since it animates bones most of the times, i will threat it as curves that animates bones.

Mot main header

Offset Type Size Description
0x00 uint32_t 4 File identifier (Magic number).
0x04 uint16_t 2 Animation's frame count.
0x06 uint8_t 1 Animation's curve info count.
0x07 uint8_t 1 Loop flag, sets if the animation either loops or not (1/0).

on Offset 8, The File gives informations about the curves, i.e: what bone it animates, etc.

Curve Info

Offset Type Size Description
0x00 int8_t 1 Bone index (-1 means it animates the mode's root bone).
0x01 int8_t 1 Curve properties (See below).
0x02 uint16_t 2 Curve keyframe count.
0x04 uint32_t / float32_t 4 Keyframes offset / value

the 4th offset of each curve info can be either a float, or uint32. it's only set as a float if the property family of the curve is a Single Pose. Otherwise, it's a offset. The curve property will define what property of the bone/object it is animating. There's some properties who could not be determined yet. See some already identified values bellow.

Curve Properties (Already identified)

Value Property Family Property
0 Single Pose Position X
1 Single Pose Position Y
2 Single Pose Position Z
3 Single Pose Rotation X
4 Single Pose Rotation Y
5 Single Pose Rotation Z
6 Single Pose Scale X
7 Single Pose Scale Y
8 Single Pose Scale Z
16 Quantized Curve Position X
17 Quantized Curve Position Y
18 Quantized Curve Position Z
19 Quantized Curve Rotation X
20 Quantized Curve Rotation Y
21 Quantized Curve Rotation Z
22 Quantized Curve Scale X
23 Quantized Curve Scale Y
24 Quantized Curve Scale Z
50 Semi-Precision Curve Position X
51 Semi-Precision Curve Position Y
52 Semi-Precision Curve Position Z
53 Semi-Precision Curve Rotation X
54 Semi-Precision Curve Rotation Y
55 Semi-Precision Curve Rotation Z
56 Semi-Precision Curve Scale X
57 Semi-Precision Curve Scale Y
58 Semi-Precision Curve Scale Z
80 Full-Precision Curve Position X
81 Full-Precision Curve Position Y
82 Full-Precision Curve Position Z
83 Full-Precision Curve Rotation X
84 Full-Precision Curve Rotation Y
85 Full-Precision Curve Rotation Z
86 Full-Precision Curve Scale X
87 Full-Precision Curve Scale Y
88 Full-Precision Curve Scale Z

The Property Family tells the game how the keyframes are handled ingame. Depending on the Family the property is set in, it can be readen diferently.

Single Pose

This Property Family is the cheapest to compute. Because since it's a single pose, The there's only one keyframe, in which is given on the Curve Info.

(Example):

Offset Value Description
0x00 -1 This field is telling that the curve is animating the root bone of the model.
0x01 5 This field is telling that the curve animates the Z rotation of the root bone, being set on a Single-Pose Property Family.
0x02 1 This field is telling that there's only one keyframe on this curve, which makes sense, since this curve is set on a Single-Pose Property Family.
0x04 0.52 This field is telling the value or the Z rotation right away, no more computing needed.

From now on, every single other curve are hermite curves. See more bellow...

Quantized Curve

This Property Family Is known for having Quantized values. It's the most eficient type of curve, regarding storage size.

(Example):

Offset Value Description
0x00 0 This field is telling that the curve is animating the bone index 0 of the model.
0x01 16 This field is telling that the curve animates the X Position of the root bone, being set on a Quantized Curve Property Family.
0x02 4 This field is telling that there's 4 keyframes on this curve.
0x04 512 This field is telling in which offset of the file the keyframe infos are located.