CHAR (Metroid Prime 3): Difference between revisions

From Retro Modding Wiki
Jump to navigation Jump to search
>Aruki
(gettin this started)
>Aruki
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
''This article is for the CHAR format from Metroid Prime 3: Corruption. See [[CHAR (File Format)]] for the other revisions of this format.''
The '''CHAR format''' defines an animation character; together with [[SAND (File Format)|SAND]], it serves as the successor to the [[ANCS (File Format)|ANCS format]] from Prime 1 and 2, and contains much of the same data. The main difference from ANCS is that the file no longer contains multiple characters; instead, every character gets its own CHAR file, and any animation data shared with other characters is stored in SAND.
The '''CHAR format''' defines an animation character; together with [[SAND (File Format)|SAND]], it serves as the successor to the [[ANCS (File Format)|ANCS format]] from Prime 1 and 2, and contains much of the same data. The main difference from ANCS is that the file no longer contains multiple characters; instead, every character gets its own CHAR file, and any animation data shared with other characters is stored in SAND.


Line 4: Line 6:


== Format ==
== Format ==
=== Header ===


{| class="wikitable"
{| class="wikitable"
! Type
! Type
! Description
! Count
! Name
! Notes
|-
|-
| char
| u8
| {{unknown|Unknown}}
| 1
| '''Version'''
| Always 0x5.
|-
|-
| char
| u8
| {{unknown|Unknown}}
| 1
|-
| '''Character ID'''
| [[#CharacterInfo|Character Info]]
| This is an ID unique to each character sharing the same [[SAND (File Format)|SAND file]].
| Specific settings and resources used by this character
|-
| [[#AnimationSet|Animation Set]]
| Events, Animations, and Hitbox related settings
|}
 
===CharacterInfo===
{| class="wikitable"
! Type
! Count
! Description
|-
|-
| string
| string
| 1
| 1
| '''Character name'''
| '''Character Name'''
| Name of the character. Likely included for debugging purposes.
|-
|-
| [[CMDL (File Format)|CMDL]]
| Asset ID ([[CMDL (Metroid Prime)|CMDL]])
| 1
| 1
| '''Character model'''
| '''Character Model'''
| ID of the model used by this character.
|-
|-
| [[CSKR (File Format)|CSKR]]
| Asset ID ([[CSKR (File Format)|CSKR]])
| 1
| 1
| '''Character skin'''
| '''Character Skin'''
| ID of the skin used by this character.
|-
|-
| u64
| u32
| 1
| 1
| Overlay count
| '''Overlay Count'''
| Number of overlay models.
|-
|-
| [[#Overlay|Overlays]]
| [[#Overlay Model|Overlay Model]]
| overlay_count
| ''Overlay Count''
| Overlays used for various status effects, such as Frozen, Hazard, or Hyper
| '''Overlay Array'''
| Array defining overlay models that this character can use.
|-
|-
| [[CINF (File Format)|CINF]]
| Asset ID ([[CINF (File Format)|CINF]])
| 1
| 1
| '''Character skeleton'''
| '''Character Skeleton'''
| ID of the skeleton used by this character.
|-
|-
| [[SAND (File Format)|SAND]]
| Asset ID ([[SAND (File Format)|SAND]])
| 1
| 1
| '''Character sand'''
| '''Character Animation Data'''
| ID of the animation data used by this character.
|-
|-
| [[PASDatabase|PASDatabase]]
| [[PAS Database]]
| 1
| 1
| Parameterized Animation Set Database
| '''PAS Database'''
| Not much known about how this data is used.
|-
|-
| [[#ParticleResData|Particle Resource Data]]
| [[#Particle Resource Data|Particle Resource Data]]
| 1
| 1
| Various Particle Systems used by this character.
| '''Particle Resource Data'''
|}
| List of particle assets being used by this character. This primarily contains particles used by animation events.
 
====Overlay====
Overlays are external models that are skinned and attached to the rig for certain status effects, the layout simply consists of a FourCC value, a CMDL reference, and a CSKR reference.
{| class="wikitable"
! Type
! Description
|-
|-
| FourCC
| u32
| The type of status effect this overlay is for, <code>FRZN</code>, <code>HYPR</code>, or <code>HZRD</code> are known values, there may be more
| 1
| '''Anim Event Set Count'''
| Count of anim event sets used by this character. There'll be one set per animation that uses events (unless the animation has its events in the [[SAND (File Format)|SAND file]]).
|-
|-
| u64
| [[#Anim Event Set|Anim Event Set]]
| [[CMDL (File Format)|CMDL]] id
| ''Anim Event Set Count''
|-
| '''Anim Event Set Array'''
| u64
| Array of animation event sets.
| [[CSKR (File Format)|CSKR]] id
|}
 
===ParticleResData===
Particle Resource data is simply a list of particle systems that can be used with this character.
{| class="wikitable"
! Type
! Count
! Description
|-
|-
| u32
| u32
| 1
| 1
| [[PART (File Format)|PART]] count
| '''Animation Count'''
| Count of animations used by this character.
|-
|-
| u64
| [[#Animation|Animation]]
| part_count
| ''Animation Count''
| [[PART (File Format)|PART]] ids
| '''Animations Array'''
| Array of animations used by this character.
|-
|-
| u32
| u32
| 1
| 1
| [[SWHC (File Format)|SWHC]] count
| '''Animation Bounds Count'''
| Count of animation bounding boxes in the next array.
|-
|-
| u64
| [[#Animation Bounding Box|Animation Bounding Box]]
| swhc_count
| ''Animation Bounds Count''
| [[SWHC (File Format)|SWHC]] ids
| '''Animation Bounding Box Array'''
| Array of bounding boxes for animations used by this character.
|-
| bool
| 1
| {{unknown}}
|  
|-
|-
| u32
| u32
| 1
| 1
| {{unknown|'''UNKNOWN'''}} count
| {{unknown|Unknown Array Count}}
| Size of the following array.
|-
|-
| u64
| bool
| unk_count
| ''Unknown Array Count''
| {{unknown|'''UNKNOWN'''}} ids
| {{unknown|Unknown Bool Array}}
| Unknown array of bools.
|-
|-
| u32
| u32
| 1
| 1
| [[ELSC (File Format)|ELSC]] count
| '''Collision Primitive Set Count'''
| Number of animation collision primitive sets.
|-
|-
| u64
| [[#Collision Primitive Set|Collision Primitive Set]]
| elsc_count
| ''Collision Primitive Set Count''
| [[ELSC (File Format)|ELSC]] ids
| '''Collision Primitive Sets'''
| Array of collision primitives used by this character.
|-
|-
| u32
| u32
| 1
| 1
| [[SPSC (File Format)|SPSC]] count
| '''Sound Resource Count'''
| Number of sound resources used by this character.
|-
|-
| u64
| Asset ID ([[CAUD (File Format)|CAUD]])
| spsc_count
| ''Sound Resource Count''
| [[SPSC (File Format)|SPSC]] ids
| '''Sound Resource List'''
| List of sound resources used by this character.
|}
 
=== Overlay Model ===
 
{| class="wikitable"
! Type
! Name
! Notes
|-
| {{FourCC}}
| '''Overlay Type'''
| Possible values:
* <code>FRZN</code>: Overlay used when the character is frozen (eg. by Ice Missiles)
* <code>HYPR</code>: Overlay used when the character is in hypermode
* <code>ACID</code>: Overlay used when the character is in acid rain
* <code>XRAY</code>: Overlay used something related to the X-Ray Visor
|-
|-
| u32
| Asset ID ([[CMDL (Metroid Prime)|CMDL]])
| 1
| '''Overlay Model'''
| {{unknown|'''UNKNOWN'''}} count
| Model used by the overlay.
|-
|-
| u64
| Asset ID ([[CSKR (File Format)|CSKR]])
| unk_count
| '''Overlay Skin'''
| {{unknown|'''UNKNOWN'''}} ids
| Skin that rigs the ''Overlay Model'' to the character's skeleton.
|}
|}


===AnimationSet===
=== Particle Resource Data ===
The Animation Set saw the largest change from Metroid Prime 1/2, gone are Transitions, Half Transitions and AdditiveInfo, EVNT was overhauled, AABBs were moved from CharacterInfo, and Hitboxes were added.
 
{|class="wikitable"
{| class="wikitable"
! Type
! Type
! Count
! Count
! Description
! Name
! Notes
|-
|-
| u32
| u32  
| 1
| 1
| [[#EVNT|EVNT]] count
| '''Generic Particle Count'''
| Count of generic particle systems.
|-
|-
| [[#EVNT|EVNT]]
| Asset ID ([[PART (File Format)|PART]])
| evnt_count
| ''Generic Particle Count''
| Events available for use by various animations, how events are linked to animations is currently unknown
| '''Generic Particle List'''
| List of generic particle systems used by this character.
|-
|-
| u32
| u32
| 1
| 1
| [[ANCS (File Format)#Animation|Animation]] count
| '''Swoosh Particle Count'''
| Count of swoosh particle systems.
|-
|-
| [[ANCS (File Format)#Animation|Animation]]
| Asset ID ([[SWHC (File Format)|SWHC]])
| animation_count
| ''Swoosh Particle Count''
| Animations used by this character
| '''Swoosh Particle List'''
| List of swoosh particle systems used by this character.
|-
|-
| u32
| u32  
| 1
| 1
| Animation AABB count
| '''Electric Particle Count'''
|-
| Count of electric particle systems.
| [[#AnimationAABB|AnimationAABB]]
| animation_aabb_count
| Animation bounds
|-
|-
| u8
| Asset ID ([[ELSC_(File_Format)|ELSC]])
| 1
| ''Electric Particle Count''
| {{unknown|'''UNKNOWN'''}}
| '''Electric Particle List'''
| List of electric particle systems used by this character.
|-
|-
| u32
| u32
| 1
| 1
| Additive Animation count
| '''Spawn Particle Count'''
| Count of spawn particle systems.
|-
|-
| bool
| Asset ID ([[SPSC (File Format)|SPSC]])
| additive_animation_count
| ''Spawn Particle Count''
| A true/false value map for additive animations, true if an animation is additive, false otherwise.
| '''Spawn Particle List'''
| List of spawn particle systems used by this character.
|-
|-
| u32
| u32
| 1
| 1
| [[#HitboxSet|HitboxSet]] count
| {{unknown}}
|-
| Always 0.
| [[#HitboxSet|HitboxSet]]
| hitbox_set_count
| Hitbox Sets for animations
|-
|-
| u32
| u32
| 1
| 1
| [[ANIM (File Format)|ANIM]] count
| {{unknown}}
|-
| Always 0.
| u64
| anim_count
| [[ANIM (File Format)|ANIM]] ids
|}
|}


====EVNT====
=== Anim Event Set ===
Not much is currently known about the actual structure of the new EVNT format, so much of the structure is a complete guess.
 
{|class="wikitable"
{| class="wikitable"
! Type
! Type
! Count
! Count
! Description
! Name
! Notes
|-
|-
| u32
| u32
| 1
| 1
| Index of this particular event, how it's currently used is unknown
| {{unknown}}
| Likely animation ID that this set corresponds to
|-
| string
| 1
| '''Set Name'''
| Name of this event set.
|-
|-
| u32
| u32
| 1
| 1
| [[#ParticlePOINode|ParticlePOINode]] count
| '''Effect Event Count'''
| Number of effect events in this set.
|-
|-
| [[#ParticlePOINode|ParticlePOINode]]
| [[#Effect Event|Effect Event]]
| particle_poi_node_count
| ''Effect Event Count''
| Particle effects events that can be triggered during the course of the animation
| '''Effect Events'''
| Effect events contained in this set.
|-
|-
| u32
| u32
| 1
| 1
| [[#SoundPOINode|SoundPOINode]] count
| '''Sound Event Count'''
| Number of sound events in this set.
|-
|-
| [[#SoundPOINode|SoundPOINode]]
| [[#Sound Event|Sound Event]]
| sound_poi_node_count
| ''Sound Event Count''
| Sound effect events that can be triggered during the course of the animation
| '''Sound Events'''
| Sound events contained in this set.
|}
|}


=====ParticlePOINode=====
==== Effect Event ====
 
{| class="wikitable"
{| class="wikitable"
! Type
! Type
! Description
! Name
! Notes
|-
|-
| [[#SharedHeader|POI Header]]
| string
| Basic information about this particular event
| '''Event Name'''
|-
| Same as the event name in the event data.
| FourCC
| Type, <code>PART</code> is the most common, not aware of any others being used
|-
| u64
| Particle ID, file type corresponds to the previous value.
|-
|-
| float
| [[Animation Events (File Format)#Effect Event|Effect Event]]
| Scale of the particle system.
| '''Effect Event Data'''
|-
| Actual event data.
| u32
| Parent Mode
|}
|}
=====SoundPOINode=====
 
==== Sound Event ====
 
{| class="wikitable"
{| class="wikitable"
! Type
! Type
! Count
! Name
! Description
! Notes
! Notes
|-
|-
| [[#POI Header|POI Header]]
| string
| 1
| '''Event Name'''
| Basic information about this particular event
| Same as the event name in the event data.
|
|-
| u64
| 1
| [[CAUD (File Format)|CAUD]] id
|
|-
| u32
| 1
| {{unknown|'''UNKNOWN'''}}
|
|-
| u32
| 1
| {{unknown|'''UNKNOWN'''}}
|
|-
|-
| u32
| [[Animation Events (File Format)#Sound Event|Sound Event]]
| 1
| '''Sound Event Data'''
| {{unknown|'''UNKNOWN'''}}
| Actual event data.
| Dictates the presence of the following values, if 1, the following float exists, otherwise 35 unknown bytes.
|-
| float
| 1
| {{unknown|'''UNKNOWN'''}}
| Only present if the previous value is 1
|-
| u8
| 35
| {{unknown|'''UNKNOWN'''}}
| Only present if the value above does not exist
|}
|}


=====POI Header=====
=== Animation ===
 
{| class="wikitable"
{| class="wikitable"
! Type
! Type
! Description
! Name
|-
! Notes
| string
| {{unknown|'''UNKNOWN'''}}
|-
| u16
| {{unknown|'''UNKNOWN'''}}
|-
|-
| string
| string
| {{unknown|'''UNKNOWN'''}}
| '''Name'''
| Animation name.
|-
|-
| u16
| [[Meta-Animation]]
| {{unknown|'''UNKNOWN'''}}
| '''Animation'''
|-
| Meta-animation data.
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u8
| {{unknown|'''UNKNOWN'''}}
|-
| float
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|-
| u32
| {{unknown|'''UNKNOWN'''}}
|}
|}
====AnimationAABB====
 
=== Animation Bounding Box ===
 
{| class="wikitable"
{| class="wikitable"
! Type
! Type
! Description
! Name
! Notes
|-
|-
| u64
| Asset ID ([[ANIM (File Format)|ANIM]])
| [[ANIM (File Format)|ANIM]]
| '''Animation Asset ID'''
| Asset ID of the animation that this bounding box corresponds to.
|-
|-
| float2x3
| {{AABox}}
| Axis Aligned Bounding Box
| '''Animation Bounding Box'''
| Bounding box of the animation when applied to this character.
|}
|}


====HitboxSet====
=== Collision Primitive Set ===
 
{| class="wikitable"
{| class="wikitable"
! Type
! Type
! Count
! Count
! Description
! Name
! Notes
|-
|-
| string
| string
| 1
| 1
| Name
| '''Set Name'''
| Name of this primitive set.
|-
|-
| u32
| u32
| 1
| 1
| [[#Hitbox|Hitbox]] count
| '''Primitive Count'''
| Number of primitives contained in this set.
|-
|-
| [[#Hitbox|Hitbox]]
| [[#Collision Primitive|Collision Primitive]]
| hitbox_count
| ''Primitive Count''
| Hitboxes for bones used in an animation
| '''Primitive Array'''
| Array of collision primitives contained in this set.
|}
|}


=====Hitbox=====
==== Collision Primitive ====
 
{| class="wikitable"
{| class="wikitable"
! Offset
! Type
! Type
! Description
! Name
! Notes
|-
|-
| 0x0
| u32
| u32
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x4
| u32
| u32
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x8
| u32
| u32
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0xC
| u32
| u32
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x10
| u32
| u32
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x14
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x18
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x1C
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x20
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x24
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x28
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x2C
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x30
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|-
|-
| 0x34
| string
| string
| Bone name
| '''Primitive Name'''
| Name of the collision primitive.
|-
|-
| {{none}}
| float
| float
| {{unknown|'''UNKNOWN'''}}
| {{unknown}}
|
|}
|}


[[Category:Metroid Prime 3 Prototype]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:Metroid Prime 3: Corruption]]
[[Category:File Formats]]
[[Category:File Formats]]

Latest revision as of 23:56, 7 March 2017

This article is for the CHAR format from Metroid Prime 3: Corruption. See CHAR (File Format) for the other revisions of this format.

The CHAR format defines an animation character; together with SAND, it serves as the successor to the ANCS format from Prime 1 and 2, and contains much of the same data. The main difference from ANCS is that the file no longer contains multiple characters; instead, every character gets its own CHAR file, and any animation data shared with other characters is stored in SAND.

Format

Type Count Name Notes
u8 1 Version Always 0x5.
u8 1 Character ID This is an ID unique to each character sharing the same SAND file.
string 1 Character Name Name of the character. Likely included for debugging purposes.
Asset ID (CMDL) 1 Character Model ID of the model used by this character.
Asset ID (CSKR) 1 Character Skin ID of the skin used by this character.
u32 1 Overlay Count Number of overlay models.
Overlay Model Overlay Count Overlay Array Array defining overlay models that this character can use.
Asset ID (CINF) 1 Character Skeleton ID of the skeleton used by this character.
Asset ID (SAND) 1 Character Animation Data ID of the animation data used by this character.
PAS Database 1 PAS Database Not much known about how this data is used.
Particle Resource Data 1 Particle Resource Data List of particle assets being used by this character. This primarily contains particles used by animation events.
u32 1 Anim Event Set Count Count of anim event sets used by this character. There'll be one set per animation that uses events (unless the animation has its events in the SAND file).
Anim Event Set Anim Event Set Count Anim Event Set Array Array of animation event sets.
u32 1 Animation Count Count of animations used by this character.
Animation Animation Count Animations Array Array of animations used by this character.
u32 1 Animation Bounds Count Count of animation bounding boxes in the next array.
Animation Bounding Box Animation Bounds Count Animation Bounding Box Array Array of bounding boxes for animations used by this character.
bool 1 Unknown
u32 1 Unknown Array Count Size of the following array.
bool Unknown Array Count Unknown Bool Array Unknown array of bools.
u32 1 Collision Primitive Set Count Number of animation collision primitive sets.
Collision Primitive Set Collision Primitive Set Count Collision Primitive Sets Array of collision primitives used by this character.
u32 1 Sound Resource Count Number of sound resources used by this character.
Asset ID (CAUD) Sound Resource Count Sound Resource List List of sound resources used by this character.

Overlay Model

Type Name Notes
FourCC Overlay Type Possible values:
  • FRZN: Overlay used when the character is frozen (eg. by Ice Missiles)
  • HYPR: Overlay used when the character is in hypermode
  • ACID: Overlay used when the character is in acid rain
  • XRAY: Overlay used something related to the X-Ray Visor
Asset ID (CMDL) Overlay Model Model used by the overlay.
Asset ID (CSKR) Overlay Skin Skin that rigs the Overlay Model to the character's skeleton.

Particle Resource Data

Type Count Name Notes
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 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.
u32 1 Unknown Always 0.
u32 1 Unknown Always 0.

Anim Event Set

Type Count Name Notes
u32 1 Unknown Likely animation ID that this set corresponds to
string 1 Set Name Name of this event set.
u32 1 Effect Event Count Number of effect events in this set.
Effect Event Effect Event Count Effect Events Effect events contained in this set.
u32 1 Sound Event Count Number of sound events in this set.
Sound Event Sound Event Count Sound Events Sound events contained in this set.

Effect Event

Type Name Notes
string Event Name Same as the event name in the event data.
Effect Event Effect Event Data Actual event data.

Sound Event

Type Name Notes
string Event Name Same as the event name in the event data.
Sound Event Sound Event Data Actual event data.

Animation

Type Name Notes
string Name Animation name.
Meta-Animation Animation Meta-animation data.

Animation Bounding Box

Type Name Notes
Asset ID (ANIM) Animation Asset ID Asset ID of the animation that this bounding box corresponds to.
AABox Animation Bounding Box Bounding box of the animation when applied to this character.

Collision Primitive Set

Type Count Name Notes
string 1 Set Name Name of this primitive set.
u32 1 Primitive Count Number of primitives contained in this set.
Collision Primitive Primitive Count Primitive Array Array of collision primitives contained in this set.

Collision Primitive

Offset Type Name Notes
0x0 u32 Unknown
0x4 u32 Unknown
0x8 u32 Unknown
0xC u32 Unknown
0x10 u32 Unknown
0x14 float Unknown
0x18 float Unknown
0x1C float Unknown
0x20 float Unknown
0x24 float Unknown
0x28 float Unknown
0x2C float Unknown
0x30 float Unknown
0x34 string Primitive Name Name of the collision primitive.
float Unknown