Difficulty scaling/en: Difference between revisions

Updating to match new version of source page
(Updating to match new version of source page)
(Updating to match new version of source page)
Line 1: Line 1:
<languages/>
<languages/>


'''Difficulty scaling''' is a mechanic in ''Breath of the Wild'' that results in enemies and weapons being progressively replaced by more powerful variants during a playthrough.
'''Difficulty scaling''' is a mechanic in ''Breath of the Wild'' that results in enemies and weapons being progressively replaced by more powerful variants during a playthrough.


== Points ==
== Points ==
The scaling system is based on a point system. Killing enemies is the ''only way'' to receive points.
The scaling system is based on a point system. Killing enemies is the ''only way'' to receive points.


Line 21: Line 21:
The subsystem provides two functions ([[Difficulty scaling#Ecosystem::LevelSensor::scaleWeapon|<code>scaleWeapon</code>]] and [[Difficulty scaling#Ecosystem::LevelSensor::scaleActor|<code>scaleActor</code>]]) that may be called when a weapon or enemy actor is created.
The subsystem provides two functions ([[Difficulty scaling#Ecosystem::LevelSensor::scaleWeapon|<code>scaleWeapon</code>]] and [[Difficulty scaling#Ecosystem::LevelSensor::scaleActor|<code>scaleActor</code>]]) that may be called when a weapon or enemy actor is created.


== Scaling inhibitors ==
== Scaling inhibitors ==  
 
Both scaling functions will immediately return without doing anything if:
Both scaling functions will immediately return without doing anything if:
* [[WorldMgr]]::sInstance-&#x3E;stageType == 1 (Open World [[stage]])
* [[WorldMgr]]::sInstance-&#x3E;stageType == 1 (Open World [[stage]])
Line 34: Line 35:
* '''For Hinox weapons''': The flag <code>{MapName}_Necklace_{i}_{HinoxName}_{ID}</code> is false.
* '''For Hinox weapons''': The flag <code>{MapName}_Necklace_{i}_{HinoxName}_{ID}</code> is false.
* '''For other enemy drops''': The flag <code>{MapName}_WeaponDrop_{ID}</code> is false, '''and''' [the actor property 'LevelSensorMode' is higher than 1 ''or'' the enemy is a Guardian Scout ('Enemy_Guardian_Mini')].
* '''For other enemy drops''': The flag <code>{MapName}_WeaponDrop_{ID}</code> is false, '''and''' [the actor property 'LevelSensorMode' is higher than 1 ''or'' the enemy is a Guardian Scout ('Enemy_Guardian_Mini')].
Note: Weapons that are bought from a shop cannot receive modifiers because they do not fit into any of the above cases.
Note: Weapons that are bought from a shop cannot receive modifiers because they do not fit into any of the above cases.


== Weapon bonuses ==
== Weapon bonuses ==
Scaling of weapons are divided into three steps: Does the weapon get replaced by a different (better weapon)?
Scaling of weapons are divided into three steps: Does the weapon get replaced by a different (better weapon)?
Which of the stats (among attack, guard, durability etc) is increased?
Which of the stats (among attack, guard, durability etc) is increased?
Line 42: Line 45:


=== Bonus values ===
=== Bonus values ===
Bonus values (e.g. the durability or attack power increase) are determined from [[ActorParam/GeneralParamList]] (with a copy of the information in [[ActorInfoData]]). Valid ranges and bonuses for each weapon are configured in the WeaponCommon section.
Bonus values (e.g. the durability or attack power increase) are determined from [[ActorParam/GeneralParamList]] (with a copy of the information in [[ActorInfoData]]). Valid ranges and bonuses for each weapon are configured in the WeaponCommon section.


Line 69: Line 73:


==== Non-amiibo ====
==== Non-amiibo ====
{|class="wikitable"
{|class="wikitable"
! Bonus !! Value that is used for the bonus effect
! Bonus !! Value that is used for the bonus effect
Line 92: Line 97:


=== Bonus types ===
=== Bonus types ===
Weapon bonuses (e.g. Durability Up, Attack Up) are entirely random. Each bonus has equal probability.
Weapon bonuses (e.g. Durability Up, Attack Up) are entirely random. Each bonus has equal probability.


<!--T:13-->
{|class="wikitable"
{|class="wikitable"
! Bonus !! Available in modifier tiers
! Bonus !! Available in modifier tiers
Line 120: Line 127:


== Enemies ==
== Enemies ==
When loading enemies, the game will always try to scale enemies.
When loading enemies, the game will always try to scale enemies.


Line 130: Line 138:
[1.3.0] In Master Mode, '''all''' enemies are automatically ranked up one tier by default '''post scaling''', independently of 'LevelSensorMode'. Actors can receive two additional parameters:
[1.3.0] In Master Mode, '''all''' enemies are automatically ranked up one tier by default '''post scaling''', independently of 'LevelSensorMode'. Actors can receive two additional parameters:
{| class="wikitable"
{| class="wikitable"
! Parameter  
! Parameter
! Default  
! Default
! Description
! Description
|-
|-
Line 156: Line 164:
Internally and in assets such as [[Map unit|map units]], the following values are used for modifiers:
Internally and in assets such as [[Map unit|map units]], the following values are used for modifiers:
{| class="wikitable"
{| class="wikitable"
! Value  
! Value
!Description
! Description
|-
|-
| 0
| 0
Line 184: Line 192:


=== <code>Ecosystem::LevelSensor::loadByml</code> ===
=== <code>Ecosystem::LevelSensor::loadByml</code> ===
This function is called by <code>Ecosystem::init</code> from <code>ksys::InitializeApp</code>
This function is called by <code>Ecosystem::init</code> from <code>ksys::InitializeApp</code>


Line 189: Line 198:


=== <code>Ecosystem::LevelSensor::calculatePoints</code> ===
=== <code>Ecosystem::LevelSensor::calculatePoints</code> ===
Called by [[PlacementMgr]] when spawning actors.
Called by [[PlacementMgr]] when spawning actors.


Line 196: Line 206:


Interestingly, the game calculates a single point value based on the kill counter flags but calculates two separate values for weapons and enemies with two different multipliers. This format makes it possible to easily change the scaling.
Interestingly, the game calculates a single point value based on the kill counter flags but calculates two separate values for weapons and enemies with two different multipliers. This format makes it possible to easily change the scaling.


<source lang="c++">
<source lang="c++">
Line 203: Line 212:
     int kill_count = GameData::getIntegerFlag(kill_flag["name"]);
     int kill_count = GameData::getIntegerFlag(kill_flag["name"]);
     points += kill_count * kill_flag["point"];
     points += kill_count * kill_flag["point"];
\\
 
this->points = points;
this->points = points;
this->weapon_points = points * this->byml["setting"].Level2WeaponPower;
this->weapon_points = points * this->byml["setting"].Level2WeaponPower;
this->enemy_points = points * this->byml["setting"].Level2EnemyPower;
this->enemy_points = points * this->byml["setting"].Level2EnemyPower;
</source>
</source>


In practice, settings have never been modified. 1.5.0 (which will likely be the last game update) still has the same Level2WeaponPower and Level2EnemyPower.
In practice, settings have never been modified. 1.5.0 (which will likely be the last game update) still has the same Level2WeaponPower and Level2EnemyPower.


=== <code>Ecosystem::LevelSensor::scaleWeapon</code> ===
=== <code>Ecosystem::LevelSensor::scaleWeapon</code> ===
Called from treasure chest code, enemy actors{{Check}}, <code>Ecosystem::LevelSensor::scaleActor</code>
Called from treasure chest code, enemy actors{{Check}}, <code>Ecosystem::LevelSensor::scaleActor</code>


Line 220: Line 229:


Pseudocode (1.0.0):
Pseudocode (1.0.0):


<source lang="c++">
<source lang="c++">
Line 277: Line 285:


=== <code>Ecosystem::LevelSensor::scaleActor</code> ===
=== <code>Ecosystem::LevelSensor::scaleActor</code> ===
Analogous to <code>LevelSensor::scaleWeapon</code>.
Analogous to <code>LevelSensor::scaleWeapon</code>.


Pseudocode (1.0.0):
Pseudocode (1.0.0):


<source lang="c++">
<source lang="c++">
Line 329: Line 337:


== The Data ==
== The Data ==
To make things easier to understand, here are links to:
To make things easier to understand, here are links to:
* [https://docs.google.com/spreadsheets/d/e/2PACX-1vRSlyOD7FLAn1TUBn64Pu8Pld-WOfgcVByuywHMWvBTEV0j8potD1wkBs-MJJXf-gvEkpfItUCMqMk6/pubhtml kill point, enemy scaling and weapon scaling tables]
* [https://docs.google.com/spreadsheets/d/e/2PACX-1vRSlyOD7FLAn1TUBn64Pu8Pld-WOfgcVByuywHMWvBTEV0j8potD1wkBs-MJJXf-gvEkpfItUCMqMk6/pubhtml kill point, enemy scaling and weapon scaling tables]
Line 335: Line 344:


== Ganon Blights ==
== Ganon Blights ==
Ganon blights also have varying difficulty but follow a different system. Their health is determined by the base HP (set in [[ActorParam/GeneralParamList|GeneralParamList]]) and blight defeat flags.
Ganon blights also have varying difficulty but follow a different system. Their health is determined by the base HP (set in [[ActorParam/GeneralParamList|GeneralParamList]]) and blight defeat flags.
<source lang="c++">__int64 SiteBoss::getInitialHP(SiteBoss *this) // 0x71002D01F4
<source lang="c++">__int64 SiteBoss::getInitialHP(SiteBoss *this) // 0x71002D01F4
{
{
Line 354: Line 365:
   return baseHp + multiplier * halfBaseHp;
   return baseHp + multiplier * halfBaseHp;
}</source>
}</source>
Effectively, this means that the first blight Link fights will have 800+0×400 = 800 HP, the second will have 800+1×400 = 1200 HP, the third 800+2×400 = 1600 HP and the last one 800+3×400 = 2000 HP.
Effectively, this means that the first blight Link fights will have 800+0×400 = 800 HP, the second will have 800+1×400 = 1200 HP, the third 800+2×400 = 1600 HP and the last one 800+3×400 = 2000 HP.


=== Special case 1: Castle Blights ===
=== Special case 1: Castle Blights ===
Castle blights have <code>IsRemainBoss</code> set to false in their root AI parameters (see [[AIDef:AI/SiteBossSpearRoot]] for example), which sets flag 4.
Castle blights have <code>IsRemainBoss</code> set to false in their root AI parameters (see [[AIDef:AI/SiteBossSpearRoot]] for example), which sets flag 4.


Line 364: Line 377:


=== Special case 2: DLC2 Blights ===
=== Special case 2: DLC2 Blights ===
Illusory Realm blights possess the <code>EnemySiteBoss_R</code> actor tag. This causes flag 8 to be set. So they will always have 500+4×250 = 1500 HP.
Illusory Realm blights possess the <code>EnemySiteBoss_R</code> actor tag. This causes flag 8 to be set. So they will always have 500+4×250 = 1500 HP.


Interestingly, the Windblight AI function relies doesn't check the actor tag but the actor name instead. For flag 8 to be set, the actor name must be <code>Enemy_SiteBoss_Bow_R</code>.
Interestingly, the Windblight AI function relies doesn't check the actor tag but the actor name instead. For flag 8 to be set, the actor name must be <code>Enemy_SiteBoss_Bow_R</code>.
<references />
<references />
[[Category:Internals]]
[[Category:Internals]]
[[Category:Game mechanics]]
[[Category:Game mechanics]]
826

edits