Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CAS > Binary Animation Event

This page describes version 2.1.0 of the file format.

All offsets are absolute and the file is encoded in little-endian byte order.

Fields that are marked as pointer are absolute offsets in the file. These may be replaced by a memory address at runtime, and hence occupy 8 bytes.

General file layout:

Note: the naming of the tables on this page is somewhat arbitrary. When .baev files are better understood they might be changed.

File Header

OffsetSizeDescription
0x04Magic number (BFFH)
0x44Unknown (always 0?)
0x84Filesize
0xC4Alignment (always 8)
0x108Pointer to section header array
0x184Number of section header
0x1C4Size of each section header
0x208Pointer to data section
0x28128Class name

The class name is always: Nintendo.AnimationEvent.ResourceConverter.Resource.AnimationEventArchiveResData.

Section Header

OffsetSizeDescription
0x04Magic number (BFSI)
0x44Data offset
0x84Data size
0xC4Data alignment
0x108Data pointer
0x1816Section name

Data Section

This section contains raw data that is referenced by the section headers. There are always two sections in the file: Default and StringPool. The string pool section simply contains null terminated strings. The default section has the following format:

OffsetSizeDescription
0x08Reserved (a pointer to the file header is placed here at runtime)
0x81Micro version (0)
0x91Minor version (1)
0xA2Major version (2)
0xC4Padding
0x108Pointer to string pool
0x188Pointer to event table (may be 0)
0x204Number of event table entries
0x244Size of each event table entry (should be 24)
0x288Pointer to action table (may be 0)
0x304Number of action table entries
0x344Size of each action table entry (should be 24)

Event Table

The event table is sorted by the name hash. All entries have the following structure:

OffsetSizeDescription
0x04Name hash
0x44Padding
0x88Pointer to action indices for this group
0x104Number of action indices in this group
0x144Size of each action index (always 4)

The event table is followed by a list of action indices (4 bytes each).

The names can be found in .asb files.

Example names from the Tomodachi Life Demo:

  • SneakingUpH127W0
  • JumpUpDiagonallyVertical
  • SneakingPose

Action Table

All entries in the action table have the following structure:

OffsetSizeDescription
0x08Pointer to animation entries
0x84Number of animation entries
0xC4Size of each animation entry (should be 48)
0x104Name hash
0x144Unknown

Animation Table

All entries in the animation table have the following structure:

OffsetSizeDescription
0x08Pointer to name
0x88Pointer to trigger entries
0x104Number of trigger entries
0x144Size of each trigger entry (should be 24)
0x188Pointer to hold entries
0x204Number of hold entries
0x244Size of each hold entry (should be 24)
0x284Unknown
0x2C4Unknown

Trigger Table

All entries in the trigger and hold table have the following structure:

OffsetSizeDescription
0x08Pointer to parameter pointers
0x84Number of parameter pointers
0xC4Size of each parameter pointer (should be 8)
0x104Start frame (float)
0x144End frame (float)

The table is followed by a list of pointers to parameters (8 bytes each).

Parameter

OffsetSizeDescription
0x04Parameter type
0x44Padding
0x8Parameter value

The value is padded so that its size is a multiple of 8 bytes.

Parameter Types

IDSizeType
04Integer
14Float
2Unknown
312Vector (3 floats)
4Unknown
58String pointer
6Unknown
7Unknown
8Unknown

Hash Algorithm

The hash algorithm is as follows:

def calc_hash(name):
    hash = 0x811c9dc5
    const = 0x1000193
    for char in name:
        hash = (hash ^ ord(char)) * const
        hash &= 0xFFFFFFFF
    return hash