ANCS (File Format)
The ANCS format defines characters for animation in Metroid Prime 1 and 2. Starting in Metroid Prime 3, it was replaced by the CHAR format. The extension stands for ANimation Character Set.
|To do: |
Notate Metroid Prime 2 differences.
|This file format needs a lot of research |
Most of the file structure is known, but we still don't know what any of it actually is! Also, the table at the end of the file is unknown.
The ANCS format is split up into multiple nodes. Each node defines a character - a model, a skeleton, and a skin - and then sets a number of animation-related parameters on each one. At the end of the file, after every node, is a listing of ANIM and EVNT files.
There's a very short 8-byte header before the nodes begin.
|0x0||2||Unknown; always 1|
|0x2||2||Unknown; always 1 (maybe actually one 32-bit magic?)|
|u32||1||Node number; starts at 0, increases by 1 on each subsequent node|
|u16||1||Flags? This value can alter the structure of the file. Usually 6.|
|string||1||Node name (zero-terminated)|
This struct then repeats animation count times:
|u32||1||Animation number; starts with 0, increases by 1 on each subsequent animation|
|u8||1||Unknown; usually 0|
|string||1||Animation name (zero-terminated)|
The next part of the file is the PAS Database, which creates animation states and sets parameters on them. The PAS Database header is structured:
|0x0||4||"PAS4" magic fourCC|
|0x4||4||Anim state count|
|0x8||4||Default state (will be 0xFFFFFFFF on files with no anim states)|
|u32||1||Parm Info count (PC)|
|u32||1||Anim Info count (AC)|
|Parm Info||PC||Parm Info|
|Anim Info||AC||Anim Info|
|u32||1||Parm Type; enum ranging from 0 to 4, see below for possible values|
These are the possible types that can be specified by Parm Type:
The Anim Info structure is a little unorthodox. It starts with an unknown 32-bit value, and then is followed by a set of values. There's one value present per Parm Info instance, and the type of each value corresponds to that Parm Info's Parm Type setting.
Note: if the flag value at the start of the node is 5 instead of 6, when of these values is missing. It's currently not known specifically which one it toggles, so be careful.
|u32||1||Particle count (PC)|
|PART||PC||Particle file IDs|
|u32||1||Swoosh particle count (SC)|
|SWHC||SC||Swoosh particle file IDs|
|u32||1||Electric particle count (EC)|
|[[ELSC (File Format)||ELSC]]||EC||Electric particle file IDs|
This section begins with a 32-bit count value, then this struct repeats:
|float||6||Unknown; possibly an AABB|
This section is used for effect placement - binding particles to bones, which is used for things like Space Pirate eye fire. It starts with a 32-bit count value, then this stuct repeats:
|string||1||Effect name 2|
|PART||1||Particle file ID|
The end of the node structure contains this data:
|u32||1||Unknown count (UC)|