Difficulty scaling: Difference between revisions

re-add translation tags
(Removed page from translation)
(re-add translation tags)
Line 1: Line 1:
 
<languages/>
<translate>
'''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 20: Line 20:
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:
Line 28: Line 28:
Scaling will also be skipped if the current [[map area]] is 28. This corresponds to &#x22;HateruSea&#x22;, which is the Eventide Island area.
Scaling will also be skipped if the current [[map area]] is 28. This corresponds to &#x22;HateruSea&#x22;, which is the Eventide Island area.


== Weapons ==
== Weapons == 'scaleWeapon' is called (i.e. weapons may be scaled) for a weapon if:
'scaleWeapon' is called (i.e. weapons may be scaled) for a weapon if:
* '''For standalone weapons''': The actor property 'LevelSensorMode' is higher than 1 '''and''' it wasn't already picked up.
* '''For standalone weapons''': The actor property 'LevelSensorMode' is higher than 1 '''and''' it wasn't already picked up.
* '''For treasure chest drops''': If SharpWeaponJudgeType is not 4, when [[AIDef:AI/TreasureBox]] initialises the drop actor.
* '''For treasure chest drops''': If SharpWeaponJudgeType is not 4, when [[AIDef:AI/TreasureBox]] initialises the drop actor.
Line 37: Line 36:
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?
And how much it is increased.
And how much it is increased.


=== 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.
</translate>


{|class="wikitable"
{|class="wikitable"
! Bonus !! Available in modifier tiers
! <translate> Available in modifier tiers</translate>
|-
|-
|-
|-
| Attack up || Blue/White and Yellow
| <translate> Blue/White and Yellow</translate>
|-
|-
| Durability up || Blue/White and Yellow
| <translate> Blue/White and Yellow</translate>
|-
|-
| Long throw || Yellow
| <translate> Yellow</translate>
|-
|-
| Multi-shot burst (bows) || Yellow
| <translate> Yellow</translate>
|-
|-
| Quick shot (bows) || Yellow
| <translate> Yellow</translate>
|-
|-
| AddSurfMaster || Yellow
| <translate> Yellow</translate>
|-
|-
| Shield guard up || Blue/White and Yellow
| <translate> Blue/White and Yellow</translate>
|-
|-
| Critical Hit || Blue/White
| <translate> Blue/White</translate>
|-
|-
| ZoomRapid || Yellow
| <translate> Yellow</translate>
|}
|}


<translate>
Notes:
Notes:
* "Critical Hit" can only be selected if weaponCommonSharpWeaponAddCrit is true ''and'' if the weapon modifier tier is Blue/White. This means that it becomes impossible to get a weapon with a Critical Hit bonus after enough enemies have been killed.
* "Critical Hit" can only be selected if weaponCommonSharpWeaponAddCrit is true ''and'' if the weapon modifier tier is Blue/White. This means that it becomes impossible to get a weapon with a Critical Hit bonus after enough enemies have been killed.
* AddSurfMaster is a bonus that only applies to shields and gives them a lower friction for shield surfing. That bonus type is unused in the game.
* AddSurfMaster is a bonus that only applies to shields and gives them a lower friction for shield surfing. That bonus type is unused in the game.


=== 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.


==== amiibo ====
==== amiibo ==== </translate>
{|class="wikitable"
{|class="wikitable"
! Bonus !! Value that is used for the bonus effect
! <translate> Value that is used for the bonus effect</translate>
|-
|-
| None || -
| <translate> None</translate> || -
|-
|-
| Attack up || addAtkMax
| <translate> Attack up</translate> || addAtkMax
|-
|-
| Durability up || addLifeMax
| <translate> Durability up</translate> || addLifeMax
|-
|-
| Long throw || addThrowMax
| <translate> Long throw</translate> || addThrowMax
|-
|-
| Multi-shot burst (bows) || 5-shot burst
| <translate> 5-shot burst</translate>
|-
|-
| Quick shot (bows) || addRapidFireMin
| <translate> Quick shot (bows)</translate> || addRapidFireMin
|-
|-
| AddSurfMaster || [[bgparamlist#Global|GlobalParameter]]::shieldSurfMasterFrictionRatio
| <translate> AddSurfMaster</translate> || [[bgparamlist#Global|GlobalParameter]]::shieldSurfMasterFrictionRatio
|-
|-
| Shield guard up || addGuardMax
| <translate> Shield guard up</translate> || addGuardMax
|}
|}


<translate>
In summary, for amiibo weapons, an attack up always brings it to the greatest possible attack power.
In summary, for amiibo weapons, an attack up always brings it to the greatest possible attack power.
No randomness is involved.
No randomness is involved.


==== Non-amiibo ====
==== Non-amiibo ==== </translate>


{|class="wikitable"
{|class="wikitable"
! Bonus !! Value that is used for the bonus effect
! <translate> Value that is used for the bonus effect</translate>
|-
|-
| None || -
| <translate> None</translate> || -
|-
|-
| Attack up || Random integer between addAtkMin and addAtkMax
| <translate> Random integer between addAtkMin and addAtkMax</translate>
|-
|-
| Durability up || Random integer between addLifeMin and addLifeMax
| <translate> Random integer between addLifeMin and addLifeMax</translate>
|-
|-
| Long throw || Random float between addThrowMin and addThrowMax
| <translate> Random float between addThrowMin and addThrowMax</translate>
|-
|-
| Multi-shot burst (bows) || 5-shot burst
| <translate> 5-shot burst</translate>
|-
|-
| Quick shot (bows) || Random float between addRapidFireMin and addRapidFireMax
| <translate> Random float between addRapidFireMin and addRapidFireMax</translate>
|-
|-
| AddSurfMaster || [[bgparamlist#Global|GlobalParameter]]::shieldSurfMasterFrictionRatio
| <translate> [[bgparamlist#Global|GlobalParameter]]::shieldSurfMasterFrictionRatio</translate>
|-
|-
| Shield guard up || Random integer between addGuardMin and addGuardMax
| <translate> Random integer between addGuardMin and addGuardMax</translate>
|}
|}


<translate>
In summary, for non-amiibo weapons, an attack up results in a randomized attack power.
In summary, for non-amiibo weapons, an attack up results in a randomized attack power.


== 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 137: Line 136:
* ''or'' the modifier tier is overridden using 'SharpWeaponJudgeType'.
* ''or'' the modifier tier is overridden using 'SharpWeaponJudgeType'.
[1.3.0] In Master Mode, '''all''' enemies are automatically ranked up one tier by default '''post scaling''', independently of 'LevelSensorMode'. [[Actor]]s 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'. [[Actor]]s can receive two additional parameters:
</translate>
{| class="wikitable"
{| class="wikitable"
! Parameter
! <translate> Parameter</translate>
! Default
! <translate> Default</translate>
! Description
! <translate> Description</translate>
|-
|-
| IsHardModeActor
| IsHardModeActor
| false
| false
| Controls whether an enemy only shows up in Master Mode.
| <translate> Controls whether an enemy only shows up in Master Mode.</translate>
|-
|-
| DisableRankUpForHardMode
| DisableRankUpForHardMode
| false
| false
| Controls whether the automatic rankup applies to an enemy.
| <translate> Controls whether the automatic rankup applies to an enemy.</translate>
|}
|}
<translate>
In Master Mode, IsHardModeActor, DisableRankUpForHardMode and LevelSensorMode are combined on some actors to keep low-level enemies in the overworld (e.g. Red Bokoblin south of the Great Plateau).
In Master Mode, IsHardModeActor, DisableRankUpForHardMode and LevelSensorMode are combined on some actors to keep low-level enemies in the overworld (e.g. Red Bokoblin south of the Great Plateau).


== Properties ==
== Properties ==  
 
=== <code>LevelSensorMode</code> === This [[actor]] property controls whether scaling is enabled for an enemy or weapon. Also applies to any weapons held by an enemy since 'scaleWeapon' is called when an enemy drops their weapon.
=== <code>LevelSensorMode</code> ===
This [[actor]] property controls whether scaling is enabled for an enemy or weapon. Also applies to any weapons held by an enemy since 'scaleWeapon' is called when an enemy drops their weapon.


Note that this doesn't apply to weapons that are attached to a Hinox's necklace, because Hinoxes use a different underlying enemy actor which overrides the 'on weapon dropped' function and ignores 'LevelSensorMode'.
Note that this doesn't apply to weapons that are attached to a Hinox's necklace, because Hinoxes use a different underlying enemy actor which overrides the 'on weapon dropped' function and ignores 'LevelSensorMode'.


=== <code>SharpWeaponJudgeType</code> ===
=== <code>SharpWeaponJudgeType</code> === This actor property controls the ''minimum'' modifier tier that a weapon can receive.
This actor property controls the ''minimum'' modifier tier that a weapon can receive.


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:
</translate>


{| class="wikitable"
{| class="wikitable"
! Value
! <translate> Value</translate>
! Description
! <translate> Description</translate>
|-
|-
| 0
| 0
| '''None''': No modifiers.
| <translate> '''None''': No modifiers.</translate>
|-
|-
| 1
| 1
| '''RandomBlue''': Weapon will randomly get at least a blue modifier (with <code>weaponCommonSharpWeaponPer</code> being the probability).
| <translate> '''RandomBlue''': Weapon will randomly get at least a blue modifier (with <code>weaponCommonSharpWeaponPer</code> being the probability).</translate>
|-
|-
| 2
| 2
| '''Blue''': Weapon will get at least a blue modifier.
| <translate> '''Blue''': Weapon will get at least a blue modifier.</translate>
|-
|-
| 3
| 3
| '''Yellow''': Weapon will get at least a yellow modifier.
| <translate> '''Yellow''': Weapon will get at least a yellow modifier.</translate>
|-
|-
| 4
| 4
| '''NoneForced''' (chests only): Weapon will ''never'' spawn with any modifiers. ''This overrides regular scaling.''
| <translate> '''NoneForced''' (chests only): Weapon will ''never'' spawn with any modifiers. ''This overrides regular scaling.''</translate>
|}
|}


<translate>
If [[Difficulty scaling#LevelSensorMode|scaling]] is enabled, the weapon may receive modifiers from an even higher tier if point requirements are met.
If [[Difficulty scaling#LevelSensorMode|scaling]] is enabled, the weapon may receive modifiers from an even higher tier if point requirements are met.


Line 190: Line 190:
For example, 0 ('None') doesn't mean a weapon will never receive a modifier. It just means that the developers haven't forced the weapon to spawn with a blue/yellow modifier. If scaling requirements are satisfied, the weapon will receive blue or yellow modifiers.
For example, 0 ('None') doesn't mean a weapon will never receive a modifier. It just means that the developers haven't forced the weapon to spawn with a blue/yellow modifier. If scaling requirements are satisfied, the weapon will receive blue or yellow modifiers.


== Scaling algorithm ==
== Scaling algorithm ==  
 
=== <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>


Sets up byml structures for reading Ecosystem/[[LevelSensor.byml]].
Sets up byml structures for reading Ecosystem/[[LevelSensor.byml]].


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


Line 221: Line 218:
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 285: Line 281:
</source>
</source>


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


Line 337: Line 332:
</source>
</source>


== 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 344: Line 338:
This makes it possible to see both the required points for enemy/weapon upgrades, as well as all of the special cases extremely easily.
This makes it possible to see both the required points for enemy/weapon upgrades, as well as all of the special cases extremely easily.


== 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.


Line 369: Line 362:
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 377: Line 369:
If flag 4 is set, the [[AIDef:Action/SiteBossDie]] code will NOT increment the &#x22;defeated&#x22; counter. This means castle blights do not give any scaling points.
If flag 4 is set, the [[AIDef:Action/SiteBossDie]] code will NOT increment the &#x22;defeated&#x22; counter. This means castle blights do not give any scaling points.


=== 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.


Line 386: Line 377:
[[Category:Internals]]
[[Category:Internals]]
[[Category:Game mechanics]]
[[Category:Game mechanics]]
</translate>