AAMP and MediaWiki:Gadget-site.css: Difference between pages

From ZeldaMods (Breath of the Wild)
(Difference between pages)
Jump to navigation Jump to search
imported>Leoetlino
m (formatting)
 
imported>Leoetlino
No edit summary
 
Line 1: Line 1:
<onlyinclude>
.resloc-box {
'''AAMP'''s are parameter files (officially: binary resource parameter archives).
border: 1px solid #d2d2d2;
</onlyinclude>
padding: 2px 5px;
font-size: 85%;
border-left: 5px solid #000000;
}


== Structure ==
.resloc-box-aoc {
{{expand section}}
border-left-color: #90c;
}


Unlike some other file formats, AAMP files have the exact same structure and endianness on Wii U and Switch, so these files are interchangeable between the consoles.
.resloc-box-normal {
border-left-color: #36c;
}


=== Parameter types ===
.resloc-box p {
The following parameter type and class names are ''official'' and come from Nintendo's AAMP library.
margin: 0;
}


{| class="wikitable"
.resloc-box + .resloc-box,
! ID
.resloc-box + link + .resloc-box {
! Type
border-top: 0;
! Parameter type
}
|-
| 0 
| bool
| <code>agl::utl::Parameter<bool></code>
|-
| 1 
| f32 
| <code>agl::utl::Parameter<float></code>
|-
| 2 
| int 
| <code>agl::utl::Parameter<int></code>
|-
| 3 
| vec2
| <code>agl::utl::Parameter<sead::Vector2<float>></code>
|-
| 4 
| vec3
| <code>agl::utl::Parameter<sead::Vector3<float>></code>
|-
| 5 
| vec4
| <code>agl::utl::Parameter<sead::Vector4<float>></code>
|-
| 6 
| color
| <code>agl::utl::Parameter<sead::Color4f></code>
|-
| 7 
| string32
| <code>agl::utl::Parameter<sead::FixedSafeString<32>></code>
|-
| 8 
| string64
| <code>agl::utl::Parameter<sead::FixedSafeString<64>></code>
|-
| 9 
| curve1
| <code>agl::utl::ParameterCurve<1u></code>
|-
| 10
| curve2
| <code>agl::utl::ParameterCurve<2u></code>
|-
| 11
| curve3
| <code>agl::utl::ParameterCurve<3u></code> (unused in BotW?)
|-
| 12
| curve4
| <code>agl::utl::ParameterCurve<4u></code>
|-
| 13
| buffer_int
| <code>agl::utl::ParameterBuffer<int></code>
|-
| 14
| buffer_f32
| <code>agl::utl::ParameterBuffer<float></code>
|-
| 15
| string256
| <code>agl::utl::Parameter<sead::FixedSafeString<256>></code>
|-
| 16
| quat
| <code>agl::utl::Parameter<sead::Quat<float>></code>
|-
| 17
| u32
| <code>agl::utl::Parameter<uint></code>
|-
| 18
| buffer_u32
| <code>agl::utl::ParameterBuffer<unsigned int></code>
|-
| 19
| buffer_binary
| <code>agl::utl::ParameterBuffer<unsigned char></code>
|-
| 20
| stringRef
| <code>agl::utl::Parameter<sead::SafeStringBase<char>></code>
|-
| 21
| (none, special)
| <code>agl::utl::Parameter<int *></code>, <code>agl::utl::Parameter<float *></code>, <code>agl::utl::Parameter<unsigned int *></code>, <code>agl::utl::Parameter<unsigned char *></code>
|}


== Usage in ''Breath of the Wild'' ==
.ambox + .resloc-box {
AAMP files are used in ''Breath of the Wild'' to store parameters that define the game's behaviour. They are very frequently used inside .sbactorpack archives, where they define most of an Actor's characteristics.
margin-top: 10px;
}


=== Naming conventions for arrays ===
.resloc-box + .ambox {
Nintendo works around the lack of lists/arrays in the AAMP format by using parameter lists/objects and numbered names for children.
margin-top: 10px;
 
}
By convention, if the parent name is <code>{parent name}</code>, children will typically have one of the following names:
* <code>{singular parent name}_%d</code>
* <code>{singular parent name}_%02d</code>
* <code>{singular parent name}_%03d</code>
* <code>{singular parent name}%d</code>
* <code>{singular parent name}%02d</code>
* <code>{singular parent name}%03d</code>
 
This is of course not the case for all documents and there are in fact many exceptions.
 
=== Extensions ===
AAMP files have a wide range of extensions. The file format is the same regardless of the extension, but the parameters defines inside it differ depending on the extension.
 
<DynamicPageList>category = File extensions (AAMP)</DynamicPageList>
 
=== Internal usage ===
Parameter classes (e.g. Bdmgparam) inherit from agl::utl::IParameterIO -> agl::utl::IParameterList.
 
In their constructors or in an init function, agl::utl::Parameter objects are created and initialised by passing the key name, the description and help strings (see <code>agl::utl::ParameterBase::initializeListNode</code>). The CRC32 for the keys are stored and then the Parameter object is added to a agl::utl::IParameterObj list.
 
Finally, to actually load the AAMP binary data into all the parameter objects, the game constructs a agl::utl::ResParameterArchive::ResParameterArchive and then passes it to <code>applyResParameterArchive()</code>.
 
==== Structures ====
agl::utl::ResParameterArchive holds a pointer to agl::utl::ResParameterArchiveData (which is the AAMP header structure).
 
Elements like param_root are parameter lists (agl::utl::IParameterList, tag: <code>param_list</code>). The binary structure for lists is agl::utl::ResParameterList.
 
A param list holds parameter objects (agl::utl::IParameterObj, tag: <code>param_array</code>) or other parameter lists. The binary structure for objects is agl::utl::ResParameterObj.
 
Param objects store parameters (agl::utl::ParameterBase, tag: <code>param</code>). The binary structure for parameters is agl::utl::ResParameter.
 
=== Parameter list name ===
agl::utl::IParameterIO (in Nintendo's AAMP library) automatically sets the 'parameter list name' / tag name to <code>param_root</code>.
 
== al::Parameter ==
''Super Mario Odyssey'''s al::Parameter classes are extremely similar to the agl::utl::Parameter utils and appear to be an improved version. They share most of the public interface, presumably because Nintendo wanted to make switching to al:: easier.
 
The human readable format is YAML instead of XML and the binary format uses BYML. Key names are stored in plain text unlike agl::utl::Parameter which stores only the hashes of the key strings.
 
* Parameters have the same purpose as in the agl:: implementation.
* ParameterLists are dicts (key-value mapping, with keys being strings) that contain Parameters, ParameterObjects, ParameterArrays and ParameterLists.
* ParameterObjects are dicts that contain Parameters and ParameterArrays.
* ParameterArrays are arrays of ParameterObjects. This is a new structure. 
 
== Tools ==
The following tools can be used to convert AAMP files to an editable format, and back again:
 
* [https://github.com/leoetlino/aamp <code>aamp</code>]
* [https://github.com/Zer0XoL/BotW-aampTool/releases aampTool] (doesn't display root nodes correctly)
[[Category:File formats]]

Revision as of 10:30, 9 September 2018

.resloc-box {
	border: 1px solid #d2d2d2;
	padding: 2px 5px;
	font-size: 85%;
	border-left: 5px solid #000000;
}

.resloc-box-aoc {
	border-left-color: #90c;
}

.resloc-box-normal {
	border-left-color: #36c;
}

.resloc-box p {
	margin: 0;
}

.resloc-box + .resloc-box,
.resloc-box + link + .resloc-box {
	border-top: 0;
}

.ambox + .resloc-box {
	margin-top: 10px;
}

.resloc-box + .ambox {
	margin-top: 10px;
}