ASB: Difference between revisions

4,082 bytes added ,  2 months ago
→‎File Header: Removed other title versions from title header section - other versions and what titles use them are listed elsewhere.
m (I was going to finish this but I don't have the motivation to rn so I just made a few small fixes to what already was here)
(→‎File Header: Removed other title versions from title header section - other versions and what titles use them are listed elsewhere.)
Tags: Mobile edit Mobile web edit
 
(13 intermediate revisions by 3 users not shown)
Line 1: Line 1:
'''ASB''' ('''A'''nimation '''S'''equence '''B'''inary) is a file format used to store animation sequences for actors in recent Nintendo EPD games such as ''The Legend of Zelda: Tears of the Kingdom'' and ''Nintendo Switch Sports''. This article is primarily aimed at the version that appears in ''Tears of the Kingdom'' (v0x0417). ASB files can be found in the AS folder of the romfs as well as the AS folder of certain pack files.
'''ASB''' ('''A'''nimation '''S'''equence '''B'''inary) is a file format used to store animation sequences for actors in recent Nintendo EPD games such as ''The Legend of Zelda: Tears of the Kingdom'' and ''Nintendo Switch Sports''. This article is primarily aimed at the version that appears in ''Tears of the Kingdom'' and ''Mario vs Donkey Kong'' (v0x0417). Other ASB versions include 0x304 (''Ring Fit Adventure''), 0x3FB (''Labo Toy-Con 04'' and ''Game Builder Garage''), 0x407 (''Animal Crossing: New Horizons''), 0x40F (''Nintendo Switch Sports''), 0x410 (''Splatoon 3''), 0x418 (''Super Mario Bros. Wonder''), and 0x41A (''Nintendo Switch Online: Playtest Program''). ASB files can be found in the AS folder of the romfs as well as the AS folder of certain pack files.


=== File Structure ===
=== File Structure ===
ASB is a little endian format which consists of node pathways triggered by AS commands. When an AS command is called, it runs the sequence of nodes connected to it which trigger and control animations and animation logic. Nodes are arranged in an array and referenced and accessed by their array index. Despite the presence of animation events in ASB files, these events do not appear to be used by the game.
ASB is a little endian format which consists of node pathways triggered by AS commands. When an AS command is called, it runs the sequence of nodes connected to it which trigger and control animations and animation logic. Nodes are arranged in an array and referenced and accessed by their array index. Despite the presence of animation events in ASB files, these events do not appear to be used by the game.


All string offsets in the file are relative to the start of the string pool and name hashes are 32-bit murmur3 hashes. There are six possible parameter types: string, int (32-bit signed integer), float (32-bit floating point number), bool, vector3f, and pointer (object pointer).
All string offsets in the file are relative to the start of the string pool and name hashes are 32-bit murmur3 hashes. There are six possible parameter types: string, int (32-bit signed integer), float (32-bit floating point number), bool, vector3f, and pointer (object pointer, this is not actually possible in ASB, only usable in AINB).
 
Documentation is still sparse, refer to [https://github.com/dt-12345/asb this repository] for more details (names may not match exactly).


==== Section Order ====
==== Section Order ====
Line 13: Line 15:
# Event Entry Offsets
# Event Entry Offsets
# Node Bodies
# Node Bodies
# 0x38 Section Indices
# Sync Data Entry Indices
# 0x38 Section
# Sync Data
# 0x2C Section
# State Transitions
# Events
# Events (in games that use BAEV, these events are non-functional)
# Transitions
# Transitions
# Command Groups
# Command Groups
# Local Blackboard Parameters
# AS Blackboard Parameters
# Animation Slots
# Partials
# Bone Groups
# Bone Groups
# 0x40 Section
# Calculation Result Cache
# Valid Tag List
# Valid Tag List
# Tag Groups
# Tag Groups
# Expression Binary
# Expression Binary
# AS Markings
# AS Markings
# 0x68 Section (version 0x417 only)
# Material Blend Settings
# Enum Resolve Table
# Enum Resolve Table
# String Pool
# String Pool
Line 49: Line 51:
|0x04
|0x04
|u32
|u32
|Version (0x0417 in ''Tears of the Kingdom'', 0x040F in ''Nintendo Switch Sports'' and ''Splatoon 3'')
|Version (0x0417 in ''Tears of the Kingdom'')
|-
|-
|0x08
|0x08
Line 74: Line 76:
|0x04
|0x04
|u32
|u32
|Slot Count
|Partial Count
|-
|-
|0x1C
|0x1C
|0x04
|0x04
|u32
|u32
|0x38 Section Entry Count
|Sync Data Entry Count
|-
|-
|0x20
|0x20
|0x04
|0x04
|u32
|u32
|Local Blackboard Parameters Offset
|AS Blackboard Parameters Offset
|-
|-
|0x24
|0x24
Line 99: Line 101:
|0x04
|0x04
|u32
|u32
|0x2C Section Offset
|State Transitions Offset
|-
|-
|0x30
|0x30
Line 109: Line 111:
|0x04
|0x04
|u32
|u32
|Animation Slots Offset
|Partials Offset
|-
|-
|0x38
|0x38
|0x04
|0x04
|u32
|u32
|0x38 Section Offset
|Sync Data Offset
|-
|-
|0x3C
|0x3C
|0x04
|0x04
|u32
|u32
|0x38 Section Indices Array Offset
|Sync Data Indices Array Offset
|-
|-
|0x40
|0x40
|0x04
|0x04
|u32
|u32
|0x40 Section Offset
|Calculation Result Cache Offset
|-
|-
|0x44
|0x44
|0x04
|0x04
|u32
|u32
|0x40 Section Entry Count
|Calculation Result Cache Count
|-
|-
|0x48
|0x48
Line 164: Line 166:
|0x04
|0x04
|u32
|u32
|EXB Offset (empty if section does not exist)
|Expression Offset (empty if section does not exist)
|-
|-
|0x64
|0x64
Line 174: Line 176:
|0x04
|0x04
|u32
|u32
|0x68 Section Offset (version 0x417 only)
|Material Blend Settings Offset (version 0x417 only)
|}
 
==== ASB Parameter ====
 
{| class="wikitable"
|+ Parameter<T>
!Offset
!Size
!Type
!Description
|-
|0x00
|0x04
|u32
|Flags and Index
|-
|0x04
|0x04 or 0x0C
|T
|Value
|}
 
If the top bit of the flags is set, then the bottom two bytes of the flags become an index value. If it is not set, then the provided value is value of the parameter. If <code>flags & 1 << 0x18 != 0</code>, then the index is an expression index (EXB) and the normal value field becomes the input value for the expression. If <code>flags & 1 << 0x1e != 0</code>, then the index is a calculation result cache index (this stores the previously evaluated value and calculates the new value from the cached value on subsequent accesses). Note, this is only applicable if the parameter is a float. Otherwise, if <code>flags & 1 << 0x19 != 0</code>, then the index specifies the command data type. 0 is the current frame normalized (i.e. <code>(current_frame - start_frame)/total_duration</code>), 1 and 2 are random float values between 0.0 and 1.0, 3 is an unknown string value, 4 is the command's fade in frame, and 6 is an unknown float value. Note, this only applies if the parameter is a float or a string. In all other cases, the index is a blackboard index and value of the parameter is the value of the corresponding blackboard parameter. For float parameters specifically, <code>flags >> 0x1a & 3</code> specifies the exact parameter source. 0 is a float blackboard parameter while 1, 2, or 3 are a vector3f blackboard parameter with 1, 2, and 3 being the x, y, and z components respectively.
 
==== AS Commands ====
 
{| class="wikitable"
|+AS Command
!Offset
!Size
!Type
!Description
|-
|0x00
|0x04
|u32
|Name Offset
|-
|0x04
|0x04
|u32
|Tag Entry Offset (version 0x417+)
|-
|0x08
|0x08
|Parameter<float>
|
|-
|0x10
|0x08
|Parameter<bool>
|Is Ignore Same Command
|-
|0x18
|0x04
|u32
|Interpolation Type (uncertain, but 0 = unspecified, 1 = no model morph, 3 = enable local bone morph, 4 = enable inertial blend)
|-
| rowspan="5" |0x1C
| rowspan="5" |0x10
|u32
| rowspan="5" |GUID
|-
|u16
|-
|u16
|-
|u8[2]
|-
|u8[6]
|-
|0x2C
|0x02
|u16
|Child Node Index
|-
|0x2E
|0x02
|u16
|
|}
 
==== Nodes ====
 
{| class="wikitable"
|+Node
!Offset
!Size
!Type
!Description
|-
|0x00
|0x02
|AsbNodeType
|Node Type
|-
|0x02
|0x01
|u8
|Sync Data Count
|-
|0x03
|0x01
|u8
|Does Not Have State Transition
|-
|0x04
|0x04
|u32
|Tag Entry Offset
|-
|0x08
|0x04
|u32
|Node Body Offset
|-
|0x0C
|0x02
|u16
|Calculation Result Cache Index
|-
|0x0E
|0x02
|u16
|Calculation Result Cache Count
|-
|0x10
|0x02
|u16
|Sync Data Index Array Index
|-
|0x12
|0x02
|u16
|AS Markings Index (-1 for index)
|-
| rowspan="5" |0x14
| rowspan="5" |0x10
|u32
| rowspan="5" |GUID
|-
|u16
|-
|u16
|-
|u8[2]
|-
|u8[6]
|}
|}
{| class="wikitable"
|+AsbNodeType
!Value (Hex)
!Value (Dec)
!Node Type
|-
|0x01
|1
|FloatSelector
|-
|0x02
|2
|StringSelector
|-
|0x03
|3
|SkeletalAnimation
|-
|0x04
|4
|State
|-
|0x05
|5
|
|-
|0x06
|6
|OneDimensionalBlender
|-
|0x07
|7
|Sequential
|-
|0x08
|8
|IntSelector
|-
|0x09
|9
|Simultaneous
|-
|0x0A
|10
|Event
|-
|0x0B
|11
|MaterialAnimation
|-
|0x0C
|12
|FrameController
|-
|0x0D
|13
|DummyAnimation
|-
|0x0E
|14
|RandomSelector
|-
|0x0F
|15
|
|-
|0x10
|16
|PreviousTagSelector
|-
|0x11
|17
|BonePositionSelector
|-
|0x12
|18
|BoneVisibilityAnimation
|-
|0x13
|19
|InitialFrame
|-
|0x14
|20
|BoneBlender
|-
|0x15
|21
|BoolSelector
|-
|0x16
|22
|Alert
|-
|0x17
|23
|SubtractAnimation
|-
|0x18
|24
|ShapeAnimation
|-
|0x19
|25
|
|}
[[Category:File formats]]
2

edits