Skip to content

Instantly share code, notes, and snippets.

@camthesaxman
Last active June 10, 2022 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save camthesaxman/793ac09a8b328996958ff212fd89af45 to your computer and use it in GitHub Desktop.
Save camthesaxman/793ac09a8b328996958ff212fd89af45 to your computer and use it in GitHub Desktop.
Super Monkey Ball 1 Animation File Formats

Super Monkey Ball 1 Animation File Formats

This document describes the format of the four files used for character animation in Super Monkey Ball: motlabel.bin, motdat.lz, motskl.bin, and motinfo.lz.

Types used in this document:

Name Description
u8 1-byte unsigned value
u16 2-byte unsigned value
u32 4-byte unsigned value
ptr 4-byte value that specifies the file position of some additional data. Unless otherwise specified, this is an offset from the beginning of the file.
f32 4-byte IEEE754 floating point value
string array of characters followed by a zero byte

All multiple byte values are stored in big endian (most significant byte first).

Note: Any .lz files must be decompressed before being used. This document describes the uncompressed layout of these files.

motlabel.bin

Contains total number of animations and their names

Offset Type Name Description
0x00 u32 animCount total number of animations
0x04 array of ptr to string animNames Array of pointers to each animation name. Note: these are offsets from 0x4 in the file, not from the beginning.

motdat.lz

This file contains the actual data for animations. Each joint has an x position, y position, z position, x-axis rotation, y-axis rotation, and z-axis rotation. These values are called "channels", and are interpolated between "keyframes" of the animation. All angle values are expressed in radians. The contents of motdata.lz are an array of the following structure (one for each animation).

Offset Type Name Description
0x00 u16 ? ?
0x04 ptr to array of MotDatJoint jointInfo joint info (per joint)
0x08 ptr to array of u16 keyFrameCounts number of key frames (per channel, per joint)
0x0C ptr to array of u16 times key frame timestamp (per keyframe, per channel, per joint)
0x10 ptr to array of u8 valueCounts number of elements (0-3) in values used by the keyframe (per keyframe, per channel, per joint)
0x14 ptr to array of f32 values channel values used for interpolation

MotDatJoint (4 bytes)

This structure describes the association between those arrays (keyFrameCounts, times, valueCounts, values) and joints

Offset Type Name Description
0x00 u8 jointIdx Index of the joint that this applies to
0x02 u16 channelFlags bit flags specifying which channels the joint has
0x02 bit 8 has x position channel
0x02 bit 7 has y position channel
0x02 bit 6 has z position channel
0x02 bit 5 has x rotation channel
0x02 bit 4 has y rotation channel
0x02 bit 3 has z rotation channel
0x02 bit 2 has unused channel (skip)
0x02 bit 1 has unused channel (skip)
0x02 bit 0 has unused channel (skip)

motskl.bin

Skeletal joint info

Offset Type Name Description
0x00 ptr to array of Skeleton skeletons
0x04 u32 skeletonCount number of entries in skeletons
0x08 ptr ? ?
0x0C u32 ? ?

Skeleton (0x18 bytes)

Offset Type Name Description
0x00 ptr ? ?
0x04 ptr to array of ChildJointList childLists describes hierarchy of each joint
0x08 ptr to array of MotRotation rotations ?
0x0C ptr ? ?
0x10 ptr ? ?
0x14 ptr to string name name of skeleton

ChildJointList (8 bytes)

For each joint, an instance of the following structure describes which joints (children) are attached to it.

Offset Type Name Description
0x00 u32 count number of children (length of array below)
0x04 ptr to array of u8 children joint indexes of children

MotRotation (0xC bytes)

Offset Type Name Description
0x00 f32 rotX rotation around x axis
0x04 f32 rotY rotation around y axis
0x08 f32 rotZ rotation around z axis

Vec (0xC bytes)

Offset Type Name Description
0x00 f32 x x component
0x04 f32 y y component
0x08 f32 z z component

motinfo.lz

This file associates models and skeletons with each character. This file is an array of the following structure, one entry per character (AiAi, MeeMee, Baby, GonGon). There are 32 entries, but only the first four seem to be relevant.

Offset Type Name Description
0x00 string skelName Name of model within the GMA associated with character
0x18 string modelName Name of skeleton associated with character
0x30 array of ptr ? ?
0x70 array of u32 ? ?
0xB0 ptr ? ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment