ASB: Difference between revisions

318 bytes added ,  6 months ago
→‎File Header: Removed other title versions from title header section - other versions and what titles use them are listed elsewhere.
m (some naming updates)
(→‎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
 
(4 intermediate revisions by 2 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). 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''), and 0x418 (''Super Mario Bros. Wonder''). 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 16: Line 18:
# Sync Data
# Sync Data
# State Transitions
# State Transitions
# Events
# Events (in games that use BAEV, these events are non-functional)
# Transitions
# Transitions
# Command Groups
# Command Groups
Line 49: Line 51:
|0x04
|0x04
|u32
|u32
|Version (0x0418 in ''Super Mario Bros. Wonder'', 0x0417 in ''Tears of the Kingdom'' and ''Mario vs. Donkey Kong (Nintendo Switch)'', 0x040F in ''Nintendo Switch Sports'' and ''Splatoon 3'')
|Version (0x0417 in ''Tears of the Kingdom'')
|-
|-
|0x08
|0x08
Line 197: Line 199:
|}
|}


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 preset index. 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.  
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 ====
==== AS Commands ====
2

edits