ANCS (File Format): Difference between revisions
>Embyr 75 m ({{research}}) |
imported>Antidote No edit summary |
||
Line 197: | Line 197: | ||
=== Particles === | === Particles === | ||
Note: if the flag value at the start of the node is 5 instead of 6, | Note: if the flag value at the start of the node is 5 instead of 6, one of these values is missing. It's currently not known specifically which one it toggles, so be careful. However if the value is 10 the data is from Metroid Prime 2 and special attention must be paid in order to properly read the information. | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 203: | Line 203: | ||
! Count | ! Count | ||
! Description | ! Description | ||
! Notes | |||
|- | |- | ||
| u32 | | u32 | ||
Line 211: | Line 212: | ||
| PC | | PC | ||
| '''Particle file IDs''' | | '''Particle file IDs''' | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
Line 219: | Line 221: | ||
| SC | | SC | ||
| '''Swoosh particle file IDs''' | | '''Swoosh particle file IDs''' | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
| 1 | | 1 | ||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
| 1 | | 1 | ||
| '''Electric particle count''' (EC) | | '''Electric particle count''' (EC) | ||
| | |||
|- | |- | ||
| [[ELSC (File Format)|ELSC]] | | [[ELSC (File Format)|ELSC]] | ||
| EC | | EC | ||
| '''Electric particle file IDs''' | | '''Electric particle file IDs''' | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
| 1 | | 1 | ||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| | |||
|- | |||
| u32 | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| Only in Metroid Prime 2 | |||
|- | |||
| u32 | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| Only in Metroid Prime 2 | |||
|} | |} | ||
Line 257: | Line 274: | ||
=== Effects === | === Effects === | ||
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 | 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 struct repeats: | ||
{| class="wikitable" | {| class="wikitable" | ||
Line 263: | Line 280: | ||
! Count | ! Count | ||
! Description | ! Description | ||
! Notes | |||
|- | |- | ||
| string | | string | ||
| 1 | | 1 | ||
| '''Effect name''' | | '''Effect name''' | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
| 1 | | 1 | ||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| | |||
|- | |- | ||
| string | | string | ||
| 1 | | 1 | ||
| '''Effect name 2''' | | '''Effect name 2''' | ||
| Metroid Prime 1 only | |||
|- | |||
| u32 | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| Metroid Prime 2 only | |||
|- | |- | ||
| char | | char | ||
| 4 | | 4 | ||
| '''"PART" fourCC''' | | '''"PART" fourCC''' | ||
| | |||
|- | |- | ||
| [[PART (File Format)|PART]] | | [[PART (File Format)|PART]] | ||
| 1 | | 1 | ||
| '''Particle file ID''' | | '''Particle file ID''' | ||
| | |||
|- | |- | ||
| string | | string | ||
Line 291: | Line 319: | ||
| 1 | | 1 | ||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
| 1 | | 1 | ||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| | |||
|- | |- | ||
| u32 | | u32 | ||
| 1 | | 1 | ||
| {{unknown|'''Unknown'''}} | | {{unknown|'''Unknown'''}} | ||
| | |||
|} | |} | ||
Line 309: | Line 340: | ||
! Count | ! Count | ||
! Description | ! Description | ||
! Notes | |||
|- | |- | ||
| [[CMDL (Metroid Prime)|CMDL]] | | [[CMDL (Metroid Prime)|CMDL]] | ||
Line 320: | Line 352: | ||
| u32 | | u32 | ||
| 1 | | 1 | ||
| | | Action ID Count (AC) | ||
|- | |- | ||
| u32 | | u32 | ||
| | | AC | ||
| {{unknown|''' | | '''ActionIDs''' | ||
| | |||
|- | |||
| u32 | |||
| 1 | |||
| {{unknown|'''Unknown'''}} | |||
| Only in Metroid Prime 2 | |||
|- | |||
| u8 | |||
| 1 | |||
| {{unknown|'''Unknown bool?'''}} | |||
| Only in Metroid prime 2 | |||
|} | |||
=== Metroid Prime 2 Unknown Struct ==== | |||
Immediately following the the footer is a second count/struct pair that only appears in Metroid Prime 2, it is currently unknown what purpose this serves. The count is a 32bit integer and is directly followed by an array of the following struct: | |||
{| class="wikitable" | |||
! Type | |||
! Description | |||
|- | |||
| u32 | |||
| '''Action ID''' | |||
|- | |||
| CAABox | |||
| {{unknown|'''Unknown'''}} | |||
|} | |} | ||
[[Category:File Formats]] | [[Category:File Formats]] | ||
[[Category:Metroid Prime]] | [[Category:Metroid Prime]] | ||
[[Category:Metroid Prime 2: Echoes]] | [[Category:Metroid Prime 2: Echoes]] |
Revision as of 23:34, 11 April 2015
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. |
Header
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.
Offset | Size | Description |
---|---|---|
0x0 | 2 | Unknown; always 1 |
0x2 | 2 | Unknown; always 1 (maybe actually one 32-bit magic?) |
0x4 | 4 | Node count |
0x8 | Nodes begin |
Nodes
Type | Count | Description |
---|---|---|
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) |
CMDL | 1 | Model |
CSKR | 1 | Skin |
CINF | 1 | Skeleton |
u32 | 1 | Animation count |
This struct then repeats animation count times:
Type | Count | Description |
---|---|---|
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) |
PAS Database
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:
Offset | Size | Description |
---|---|---|
0x0 | 4 | "PAS4" magic fourCC |
0x4 | 4 | Anim state count |
0x8 | 4 | Default state (will be 0xFFFFFFFF on files with no anim states) |
Anim State
Type | Count | Description |
---|---|---|
u32 | 1 | Unknown |
u32 | 1 | Parm Info count (PC) |
u32 | 1 | Anim Info count (AC) |
Parm Info | PC | Parm Info |
Anim Info | AC | Anim Info |
Parm Info
Type | Count | Description |
---|---|---|
u32 | 1 | Parm Type; enum ranging from 0 to 4, see below for possible values |
u32 | 1 | Unknown |
float | 1 | Unknown |
ParmType | 2 | Parms |
These are the possible types that can be specified by Parm Type:
Value | Size | Type |
---|---|---|
0 | 4 | s32 |
1 | 4 | u32 |
2 | 4 | float |
3 | 1 | bool |
4 | 4 | enum |
Anim Info
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.
Particles
Note: if the flag value at the start of the node is 5 instead of 6, one of these values is missing. It's currently not known specifically which one it toggles, so be careful. However if the value is 10 the data is from Metroid Prime 2 and special attention must be paid in order to properly read the information.
Type | Count | Description | Notes |
---|---|---|---|
u32 | 1 | Particle count (PC) | |
PART | PC | Particle file IDs | |
u32 | 1 | Swoosh particle count (SC) | |
SWHC | SC | Swoosh particle file IDs | |
u32 | 1 | Unknown | |
u32 | 1 | Electric particle count (EC) | |
ELSC | EC | Electric particle file IDs | |
u32 | 1 | Unknown | |
u32 | 1 | Unknown | Only in Metroid Prime 2 |
u32 | 1 | Unknown | Only in Metroid Prime 2 |
Animations
This section begins with a 32-bit count value, then this struct repeats:
Type | Count | Description |
---|---|---|
string | 1 | Animation name |
float | 6 | Unknown; possibly an AABB |
Effects
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 struct repeats:
Type | Count | Description | Notes |
---|---|---|---|
string | 1 | Effect name | |
u32 | 1 | Unknown | |
string | 1 | Effect name 2 | Metroid Prime 1 only |
u32 | 1 | Unknown | Metroid Prime 2 only |
char | 4 | "PART" fourCC | |
PART | 1 | Particle file ID | |
string | 1 | Bone name | |
float | 1 | Unknown | |
u32 | 1 | Unknown | |
u32 | 1 | Unknown |
The end of the node structure contains this data:
Type | Count | Description | Notes |
---|---|---|---|
CMDL | 1 | Unknown model | |
CSKR | 1 | Unknown skin | |
u32 | 1 | Action ID Count (AC) | |
u32 | AC | ActionIDs | |
u32 | 1 | Unknown | Only in Metroid Prime 2 |
u8 | 1 | Unknown bool? | Only in Metroid prime 2 |
Metroid Prime 2 Unknown Struct =
Immediately following the the footer is a second count/struct pair that only appears in Metroid Prime 2, it is currently unknown what purpose this serves. The count is a 32bit integer and is directly followed by an array of the following struct:
Type | Description |
---|---|
u32 | Action ID |
CAABox | Unknown |