Scheduled system upgrade on Sunday 21 April 2024 15:00-16:00 UTC - On that day, the wiki and other services might go down for 5-15 minutes.

AAMP and One-Hit Obliterator: 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>
== Infinite Attack Power ==
'''AAMP'''s are parameter files (officially: binary resource parameter archives).
[https://gist.github.com/leoetlino/dc4148024537eec3008f0140b544fb8e Source]
</onlyinclude>


== Structure ==
=== Finite damage value ===
{{expand section}}


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.
The One-Hit Obliterator doesn't actually deal "infinite" damage; its attack power is merely boosted to 99999 points:


=== Parameter types ===
<source lang="cpp">
The following parameter type and class names are ''official'' and come from Nintendo's AAMP library.
void Weapon::x()
{
  ...
  float attackPower = this->getEffectiveAttackPower(nullptr);
  if ( dlc::isOneHitObliteratorActor(this, true) )
  {
    attackPower = 99999.0;
    ...
  }
  ...
}
</source>


{| class="wikitable"
=== Checks ===
! ID
The game '''overrides the damage value''' if and only if<ref>0x7100736510</ref>:
! Type
! 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'' ==
* The weapon actor name is Weapon_Sword_502 (One-Hit Obliterator).
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.
* The One-Hit Obliterator is in an "active" state.


=== Naming conventions for arrays ===
'''For the weapon to be considered active'''<ref>0x7100736778</ref>:
Nintendo works around the lack of lists/arrays in the AAMP format by using parameter lists/objects and numbered names for children.


By convention, if the parent name is <code>{parent name}</code>, children will typically have one of the following names:
* The actor's profile must be "Weapon".
* <code>{singular parent name}_%d</code>
* The player must be currently playing the One-Hit Obliterator quest (BalladOfHeroes_Step02 must be set and BalladOfHeroes_Step03 must be unset).
* <code>{singular parent name}_%02d</code>
* The player must be in a shrine '''or''' must not have escaped the trial.
* <code>{singular parent name}_%03d</code>
* The weapon must not have run out of "chemical" power.
* <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.
[[File:PlateauFieldMapAreas.png|thumb|right]]


=== Extensions ===
The player is considered to have '''escaped the One-Hit Obliterator trial''' iff<ref>0x71006889D0</ref>:
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>
* ("Is on ground" checks that are irrelevant for the damage override check.)
* The player's position is in none of the Plateau [[FieldMapArea.beco|field map areas]] (areas 46, 47, 50)
**The check fails if all of the following coordinates are invalid: (x, z), (x+5.0, z), (x-5.0, z), (x, z+5.0), (x, z-5.0)
* '''or''' the player's Y coordinate is strictly lower than 150.0.


=== Internal usage ===
== "A voice calls to you" trigger ==
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.
Source: [https://static.zeldamods.org/botw_150_AI_AI_PlayerNormal__calc.html ai::PlayerNormal::calc]


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>.
Every frame, the game checks whether:


==== Structures ====
* add-on content is enabled and version >= 0x300
agl::utl::ResParameterArchive holds a pointer to agl::utl::ResParameterArchiveData (which is the AAMP header structure).
* '''and''' the player is playing the One-Hit Obliterator quest
* '''and''' there is no active event
* '''and''' the player is not in a shrine


Elements like param_root are parameter lists (agl::utl::IParameterList, tag: <code>param_list</code>). The binary structure for lists is agl::utl::ResParameterList.
If so, PlayerNormal then checks whether Link has escaped the One-Hit Obliterator quest (see above).


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.
If he has, and if he is in a grounded state, the Demo605_0<Demo605_0> event is called.


Param objects store parameters (agl::utl::ParameterBase, tag: <code>param</code>). The binary structure for parameters is agl::utl::ResParameter.
If his X coordinate is < -1900.0 or > 0.0, or his Z coordinate is < 1100.0 or > 3000.0, the player is considered to have escaped the quest and the Demo605_0<Demo605_1> event is called to rectify the situation.


=== Parameter list name ===
== Champion powers and blood moons ==
agl::utl::IParameterIO (in Nintendo's AAMP library) automatically sets the 'parameter list name' / tag name to <code>param_root</code>.
Additionally, in that state, HeroSoulProhibition and BloodyMoonProhibition are '''forcefully set''' every frame.


== al::Parameter ==
== Fairy/Mipha's Grace ==
''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.
Fairies and Mipha's Grace will not work as long as Weapon_Sword_502 is equipped.


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.
== LumberjackTree ==
{{empty section}}


* Parameters have the same purpose as in the agl:: implementation.
<references/>
* ParameterLists are dicts (key-value mapping, with keys being strings) that contain Parameters, ParameterObjects, ParameterArrays and ParameterLists.
[[Category:Game mechanics]]
* 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 14:42, 7 April 2019

Infinite Attack Power

Source

Finite damage value

The One-Hit Obliterator doesn't actually deal "infinite" damage; its attack power is merely boosted to 99999 points:

void Weapon::x()
{
  ...
  float attackPower = this->getEffectiveAttackPower(nullptr);
  if ( dlc::isOneHitObliteratorActor(this, true) )
  {
    attackPower = 99999.0;
    ...
  }
  ...
}

Checks

The game overrides the damage value if and only if[1]:

  • The weapon actor name is Weapon_Sword_502 (One-Hit Obliterator).
  • The One-Hit Obliterator is in an "active" state.

For the weapon to be considered active[2]:

  • The actor's profile must be "Weapon".
  • The player must be currently playing the One-Hit Obliterator quest (BalladOfHeroes_Step02 must be set and BalladOfHeroes_Step03 must be unset).
  • The player must be in a shrine or must not have escaped the trial.
  • The weapon must not have run out of "chemical" power.
PlateauFieldMapAreas.png

The player is considered to have escaped the One-Hit Obliterator trial iff[3]:

  • ("Is on ground" checks that are irrelevant for the damage override check.)
  • The player's position is in none of the Plateau field map areas (areas 46, 47, 50)
    • The check fails if all of the following coordinates are invalid: (x, z), (x+5.0, z), (x-5.0, z), (x, z+5.0), (x, z-5.0)
  • or the player's Y coordinate is strictly lower than 150.0.

"A voice calls to you" trigger

Source: ai::PlayerNormal::calc

Every frame, the game checks whether:

  • add-on content is enabled and version >= 0x300
  • and the player is playing the One-Hit Obliterator quest
  • and there is no active event
  • and the player is not in a shrine

If so, PlayerNormal then checks whether Link has escaped the One-Hit Obliterator quest (see above).

If he has, and if he is in a grounded state, the Demo605_0<Demo605_0> event is called.

If his X coordinate is < -1900.0 or > 0.0, or his Z coordinate is < 1100.0 or > 3000.0, the player is considered to have escaped the quest and the Demo605_0<Demo605_1> event is called to rectify the situation.

Champion powers and blood moons

Additionally, in that state, HeroSoulProhibition and BloodyMoonProhibition are forcefully set every frame.

Fairy/Mipha's Grace

Fairies and Mipha's Grace will not work as long as Weapon_Sword_502 is equipped.

LumberjackTree

  1. 0x7100736510
  2. 0x7100736778
  3. 0x71006889D0