28
edits
m (figured out the other one too) |
(switched to module terminology) |
||
Line 2: | Line 2: | ||
=== File Structure === | === File Structure === | ||
AINB is a little endian format similar to most Switch file formats. An AINB file consists of a set of interconnected nodes which act like a syntax tree and control the behavior of actors. These nodes can also be calls to external AINB files, allowing AINB files to form entire trees of files. The root file of the tree will have <code>.root.ainb</code> as their extension while each module in the tree will have the extension <code>.module.ainb</code>. There are three primary categories of AINB files in ''TotK'': AI, Logic, and Sequence. For AI and Sequence files, the file's entry point is one or more commands which is linked to one or two child nodes. All nodes are accessed by their index (references to precondition nodes will use their precondition node index which is local to the amount of precondition nodes in the file). | AINB is a little endian format similar to most Switch file formats. An AINB file consists of a set of interconnected nodes which act like a syntax tree and control the behavior of actors. These nodes can also be calls to external AINB files (known as modules), allowing AINB files to form entire trees of files. The root file of the tree will have <code>.root.ainb</code> as their extension while each module in the tree will have the extension <code>.module.ainb</code>. There are three primary categories of AINB files in ''TotK'': AI, Logic, and Sequence. For AI and Sequence files, the file's entry point is one or more commands which is linked to one or two child nodes. All nodes are accessed by their index (references to precondition nodes will use their precondition node index which is local to the amount of precondition nodes in the file). | ||
All string offsets in the file are relative to the beginning of the string pool and name hashes are 32-bit murmur3 hashes. There are six possible types for AINB parameters: int (signed 32-bit integer), bool, float (32-bit), vector3f, and pointer. Pointer parameters are pointers to objects. | All string offsets in the file are relative to the beginning of the string pool and name hashes are 32-bit murmur3 hashes. There are six possible types for AINB parameters: int (signed 32-bit integer), bool, float (32-bit), vector3f, and pointer. Pointer parameters are pointers to objects. | ||
Line 21: | Line 21: | ||
# Precondition Nodes | # Precondition Nodes | ||
# Expression Binary | # Expression Binary | ||
# | # AINB Modules | ||
# Entry Strings | # Entry Strings | ||
# File Hashes | # File Hashes | ||
Line 158: | Line 158: | ||
|0x04 | |0x04 | ||
|u32 | |u32 | ||
| | |AINB Modules Array Offset | ||
|- | |- | ||
|0x60 | |0x60 | ||
Line 495: | Line 495: | ||
|- | |- | ||
|Element_ModuleIF_Input_S32 | |Element_ModuleIF_Input_S32 | ||
| | |Receives a signed int input from the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Input_F32 | |Element_ModuleIF_Input_F32 | ||
| | |Receives a 32-bit float input from the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Input_Vec3f | |Element_ModuleIF_Input_Vec3f | ||
| | |Receives a vector3f input from the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Input_String | |Element_ModuleIF_Input_String | ||
| | |Receives a string input from the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Input_Bool | |Element_ModuleIF_Input_Bool | ||
| | |Receives a bool input from the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Input_Ptr | |Element_ModuleIF_Input_Ptr | ||
| | |Receives an object pointer input from the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Output_S32 | |Element_ModuleIF_Output_S32 | ||
| | |Returns a signed int output from the module to the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Output_F32 | |Element_ModuleIF_Output_F32 | ||
| | |Returns a 32-bit float output from the module to the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Output_Vec3f | |Element_ModuleIF_Output_Vec3f | ||
| | |Returns a vector3f output from the module to the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Output_String | |Element_ModuleIF_Output_String | ||
| | |Returns a string output from the module to the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Output_Bool | |Element_ModuleIF_Output_Bool | ||
| | |Returns a bool output from the module to the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Output_Ptr | |Element_ModuleIF_Output_Ptr | ||
| | |Returns an object pointer output from the module to the calling AINB file | ||
|- | |- | ||
|Element_ModuleIF_Child | |Element_ModuleIF_Child | ||
| | |Returns the node connection name from the module to the calling AINB file | ||
|- | |- | ||
|Element_StateEnd | |Element_StateEnd | ||
Line 548: | Line 548: | ||
|- | |- | ||
|1 | |1 | ||
|Is | |Is Module | ||
|- | |- | ||
|1 | |1 | ||
Line 1,853: | Line 1,853: | ||
The string pool is an array of null-terminated strings encoded with UTF-8. All string offsets in this section are relative to the beginning of the string pool. | The string pool is an array of null-terminated strings encoded with UTF-8. All string offsets in this section are relative to the beginning of the string pool. | ||
==== | ==== AINB Modules ==== | ||
This section contains an array of all | This section contains an array of all AINB modules linked to the current AINB file. The first four bytes specify the entry count. | ||
{| class="wikitable" | {| class="wikitable" | ||
|+ | |+AINB Module Entry | ||
!Offset | !Offset | ||
!Size | !Size |
edits