Skip to content

Instantly share code, notes, and snippets.

@leoetlino
Last active August 16, 2018 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leoetlino/45be5de8c944b11752b7684bd391a87a to your computer and use it in GitHub Desktop.
Save leoetlino/45be5de8c944b11752b7684bd391a87a to your computer and use it in GitHub Desktop.
AAMP
ID Type Parameter type
0 bool agl::utl::Parameter<bool>
1 f32 agl::utl::Parameter<float>
2 int agl::utl::Parameter<int>
3 vec2 agl::utl::Parameter<sead::Vector2<float>>
4 vec3 agl::utl::Parameter<sead::Vector3<float>>
5 vec4 agl::utl::Parameter<sead::Vector4<float>>
6 color agl::utl::Parameter<sead::Color4f>
7 string32 agl::utl::Parameter<sead::FixedSafeString<32>>
8 string64 agl::utl::Parameter<sead::FixedSafeString<64>>
9 curve1 agl::utl::ParameterCurve<1u>
10 curve2 agl::utl::ParameterCurve<2u>
11 curve3 agl::utl::ParameterCurve<3u> (unused in BotW?)
12 curve4 agl::utl::ParameterCurve<4u>
13 buffer_int agl::utl::ParameterBuffer<int>
14 buffer_f32 agl::utl::ParameterBuffer<float>
15 string256 agl::utl::Parameter<sead::FixedSafeString<256>>
16 quat agl::utl::Parameter<sead::Quat<float>>
17 u32 agl::utl::Parameter<uint>
18 buffer_u32 agl::utl::ParameterBuffer<unsigned int>
19 buffer_binary agl::utl::ParameterBuffer<unsigned char>
20 stringRef agl::utl::Parameter<sead::SafeStringBase<char>>
21 (none, special) agl::utl::Parameter<int *>, agl::utl::Parameter<float *>, agl::utl::Parameter<unsigned int *>, agl::utl::Parameter<unsigned char *>

AAMP reading classes 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. (agl::utl::ParameterBase::initializeListNode)

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 applyResParameterArchive().

Parameter list name

agl::utl::IParameterIO automatically sets the 'parameter list name' / tag name to param_root.

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: param_list). The binary structure for lists is agl::utl::ResParameterList.

A param list holds parameter objects (agl::utl::IParameterObj, tag: param_array) or other parameter lists. The binary structure for objects is agl::utl::ResParameterObj.

Param objects store parameters (agl::utl::ParameterBase, tag: param). The binary structure for objects is agl::utl::ResParameter.

Super Mario Odyssey's al::Parameter classes

They are extremely similar to the agl::utl::Parameter classes 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.

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.

Key names are stored in plain text unlike agl::utl::Parameter which stores only the hashes of the key strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment