ANCS (File Format)

From Retro Modding Wiki
Revision as of 01:30, 3 March 2017 by Aruki (Talk | contribs) (woooooooah we're halfway theeeere)

Jump to: navigation, search

The ANCS format defines character sets and animation sets in Metroid Prime 1 and 2. Starting in Metroid Prime 3, it was replaced by the CHAR and SAND formats. The extension stands for ANimation Character Set.

Format

Type Name Notes
u16 Version Always 1.
Character Set Character Set Set of characters that share animation data.
Animation Set Animation Set Set of animations used by the characters in the character set.

Character Set

Type Count Name Notes
u16 1 Version Always 1.
u32 1 Character Count Count of characters in this set.
Character Character Count Characters Array Array of characters.

Character

Type Count Name Notes V1 V2 V4 V5 V10
u32 1 Character ID Typically begins at 0 and increments by 1 on each successive character in the set.
u16 1 Version This can vary between different files/characters. Usually 5 or 6 in MP1 and 10 in MP2.
string 1 Name Name of the character. Not used by the game; was likely included for debugging purposes.
Asset ID (CMDL) 1 Model ID ID of the model used by this character.
Asset ID (CSKR) 1 Skin ID ID of the skin used by this character.
Asset ID (CINF) 1 Skeleton ID ID of the skeleton used by this character.
u32 1 Animation Name Count Count of animation names in the next array.
Animation Name Animation Name Count Animation Name Array Array of names of animations used by this character.
PAS Database 1 PAS Database Not much is known about how this data is used.
Particle Resource Data 1 Particle Resource Data List of particle assets being used by this character. This includes particles being used by attached effects as well as by animation events.
u32 1 Unknown
u32 1 Unknown
u32 1 Animation AABB Count Count of animation bounding boxes.
Animation AABB Animation AABB Count Animation AABB Array Array of animation bounding boxes for this character.
u32 1 Effect Count Count of attached effects.
Effect Effect Count Effect Array Effects attached to this character.
Asset ID (CMDL) 1 Frozen Model Overlay model that appears when the character is frozen with the Ice/Dark Beam.
Asset ID (CSKR) 1 Frozen Skin Skin for rigging the Frozen Model to the character's skeleton.
u32 1 Animation Count Count of animations used by this character.
u32 Animation Count Animation ID Map Array of animation IDs. Indexing this array with the character-relative animation ID returns the animset-relative animation ID.
Asset ID (CSPP) 1 Spatial Primitives ID ID of the spatial primitives used by this character.
u8 1 Unknown
u32 1 Indexed Animation AABB Count Count of indexed animation bounding boxes.
Indexed Animation AABB Indexed Animation AABB Count Indexed Animation AABB Array Unknown purpose.
Animation Name
Type Name Notes V1 V10
u32 Animation ID Character-relative animation ID. Must be remapped via the Animation ID Map to access the corresponding animation in the animset.
string Unknown Always empty.
string Animation Name The name of the animation.
Particle Resource Data
Type Count Name Notes V5 V6 V10
u32 1 Generic Particle Count Count of generic particle systems.
Asset ID (PART) Generic Particle Count Generic Particle List List of generic particle systems used by this character.
u32 1 Swoosh Particle Count Count of swoosh particle systems.
Asset ID (SWHC) Swoosh Particle Count Swoosh Particle List List of swoosh particle systems used by this character.
u32 1 Unknown Always 0.
u32 1 Electric Particle Count Count of electric particle systems.
Asset ID (ELSC) Electric Particle Count Electric Particle List List of electric particle systems used by this character.
u32 1 Spawn Particle Count Count of spawn particle systems.
Asset ID (SPSC) Spawn Particle Count Spawn Particle List List of spawn particle systems used by this character.
Animation AABB
Type Name Notes
string Animation Name
AABox Animation Bounding Box
Indexed Animation AABB

Similar to Animation AABB, but with animations referenced via ID instead of name.

Type Name Notes
u32 Animation ID Confirm this is character-relative?
AABox Animation Bounding Box
Effect
Type Count Name Notes
string 1 Effect Name Name of the effect.
u32 1 Effect Component Count Count of effect components
Effect Component Effect Component Count Effect Components Array of effect components used by this effect.
Effect Component
Type Name Notes
string Component Name Name of this effect component.
FourCC Particle Asset Type Type of the particle used by this effect.
Asset ID Particle Asset ID Particle resource used by this effect.
string Bone Name Bone that the component is attached to.
float Scale Scale of the component.
u32 Parented Mode Needs documentation
u32 Flags Needs documentation

AnimationSet

Data Type Element Count Description Notes
u16 1 Info Count Enumeration of the presence of certain sections
u32 1 Animation Count How many animations there are in the set
Animation animation_count Animations that can be referenced by characters
u32 1 Transition Count How many transitions there are in the set
Transition transition_count Transitions that can be referenced by characters
MetaTransition 1 Default Transition
u32 1 Additive Animation Count How many additive animations there are
AdditiveAnimationPair additive_animation_count Additive animations that can be referenced in some fashion Reference method is currently unknown, presumably PASDatabase.
AdditiveAnimation 1 Default additive
u32 1 Half Transition Count How many half transitions there in the set, Only present if info_count > 2
HalfTransition half_transition_Count Half Transitions Only present if info_count > 2
u32 1 Animation Resource Count Only present if info_count > 3, and not present at all in MP2
AnimationResource animation_resource_count Animation Resources Only present if info_count > 3, and not present at all in MP2
u32 1 Event Count Only present in MP2
EVNT event_count Animation Events Only present in MP2

Animation

Data Type Description
string Name
MetaAnimation Animation configuration

MetaAnimation

MetaAnimations can be one of five types, and may contain children.

Data Type Description
EMetaAnimationType The Animation type
Play, Blend, PhaseBlend, Random or Sequence The animation description, including name, animation ID, and index used to connect character animations references to actual animations.

EMetaAnimationType

Name Value
Play 0
Blend 1
PhaseBlend 2
Random 3
Sequence 4

Play

Data Type Description Notes
ANIM Animation ID The asset ID for this particular animation
u32 Index The ID used by characters to reference this animation
string Name The animations name
float Unknown
u32 Unknown

Blend

Blend's structure is shared between Blend and PhaseBlend, with the only currently known difference being the animation type value.

Data Type Description Notes
MetaAnimation Animation A The animation to, presumably, blend from
MetaAnimation Animation B The animation to, presumably, blend to
float Unknown
bool Unknown

Random

Random may contain one or more children in an Animation -> Probability pair following this structure:

Data Type Element Count Description Notes
u32 1 Animation Count The number of child animations
AnimProbabilityPair animation_count The animations to select from The exact manner these are used is currently unknown
AnimProbabilityPair
Data Type Description Notes
MetaAnimation The animation use if the probability factor is met
u32 Probability How probability is used is not currently known

Sequence

Sequence is a fairly easy to understand type, it simply plays a list of animations in succession as each animation finishes

Data Type Element Count Description
u32 1 Animation Count
MetaAnimation animation_count The animations to play in a sequence

Transition

Data Type Description Notes
u32 Unknown
u32 Animation Index A The animation to transition from
u32 Animation Index B The animation to transition to
MetaTransition Transition configuration Describes how the transition is performed

MetaTransition

Meta Transitions can be one of four types, and may contain animations.

Data Type Description
EMetaTransitionType The type of transition
TransAnimation, TransTransition, TransPhaseTransition, TransNoTransition The transition configuration

EMetaTransitionType

Name Value
TransAnimation 0
TransTransition 1
TransPhaseTransition 2
TransNoTransition 3

TransAnimation

Data Type Description
MetaAnimation The animation to use while transitioning

TransTransition

Data Type Description
float Time
u32 Unknown
bool Unknown
bool Unknown
u32 Unknown

AdditiveAnimationPair

Data Type Description
u32 Animation Index
AdditiveAnimation Additive Animation fade-in, fade-out values

AdditiveAnimation

Describes how animations are additively blended together.

Data Type Description
float Fade In Duration
float Fade Out Duration

Half Transition

A half transition is very similar to a regular transition, but has less configuration information, any other differences are currently unknown

Data Type Description
u32 Animation Index
MetaTransition Transition configuration.

AnimationResource

Data Type Description
ANIM Animation Asset ID
EVNT Event Asset ID