826
edits
(Created page with "Pour les armes, les bonus (par exemple Durabilité ↑ ou Attaque ↑) sont entièrement aléatoires. Chaque type de bonus est équiprobable.") |
(Updating to match new version of source page) |
||
Line 1: | Line 1: | ||
<languages/> | <languages/> | ||
'''Difficulty scaling''' | '''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. | |||
Whenever an enemy dies, the game increments a flag 'Defeated_{SameGroupActorName}_Num' if all of the following conditions are satisfied: | |||
* | * The current kill count is < 10. | ||
* | * The actor does not have the NotCountDefeatedNum flag. | ||
* ''' | * '''For Monk Maz Koshia''': 'Defeated_Priest_Boss_Normal_Num' is 0. | ||
* ''' | * '''For Dark Beast Ganon''': It is the first time the boss is beaten. (Ganon's Defeated flag has 1 as the maximum value.) | ||
* ''' | * '''For Blights''': It is the first time the blight is beaten in the Divine Beast, or in the Illusory Realm. Blights fought in Hyrule Castle do not count. | ||
This happens every time ''any'' enemy dies, even if they don't necessarily play a role in the point system (see below) and even if the player is not responsible for their death. | |||
Because enemies have to be killed throughout the main quest and bosses are considered as enemies too, difficulty scaling is unavoidable. | |||
Only the defeated counter flags are stored in the save file. The <code>Ecosystem::LevelSensor</code> subsystem is responsible for [[Difficulty scaling#Ecosystem::LevelSensor::calculatePoints|converting these kill counts to points]] using a [[Difficulty scaling#Ecosystem::LevelSensor::loadByml|configuration file]]. | Only the defeated counter flags are stored in the save file. The <code>Ecosystem::LevelSensor</code> subsystem is responsible for [[Difficulty scaling#Ecosystem::LevelSensor::calculatePoints|converting these kill counts to points]] using a [[Difficulty scaling#Ecosystem::LevelSensor::loadByml|configuration file]]. | ||
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 == | ||
Both scaling functions will immediately return without doing anything if: | |||
* [[WorldMgr]]::sInstance->stageType == 1 (Open World [[stage]]) | * [[WorldMgr]]::sInstance->stageType == 1 (Open World [[stage]]) | ||
* and WorldMgr::sInstance->isAocField ( | * and WorldMgr::sInstance->isAocField (current map is Trial of the Sword) | ||
* and WorldMgr::sInstance->disableScaling ( | * and WorldMgr::sInstance->disableScaling (set to true when entering Trial of the Sword) | ||
== | This means that scaling is always disabled in the Trial of the Sword. | ||
Scaling will also be skipped if the current [[map area]] is 28. This corresponds to "HateruSea", which is the Eventide Island area. | |||
== 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: | ||
Line 36: | Line 40: | ||
* '''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. | |||
== | == Weapon bonuses == | ||
Weapon scaling results in weapons being replaced by a different weapon (e.g. a Soldier's Bow which becomes a Royal Bow), or weapons gaining a random, bonus stat boost (e.g. Attack Up, Durability Up, etc.). The range of those boosts is also affected by weapon scaling. | |||
=== | === Bonus types === | ||
Weapon bonuses (e.g. Durability Up, Attack Up) are entirely random. Each bonus has equal probability. | |||
{|class="wikitable" | {|class="wikitable" | ||
! Bonus !! | ! Bonus !! Available in modifier tiers | ||
|- | |- | ||
|- | |- | ||
| | | Attack up || Blue/White and Yellow | ||
|- | |- | ||
| | | Durability up || Blue/White and Yellow | ||
|- | |- | ||
| | | Long throw || Yellow | ||
|- | |- | ||
| | | Multi-shot burst (bows) || Yellow | ||
|- | |- | ||
| | | Quick shot (bows) || Yellow | ||
|- | |- | ||
| | | AddSurfMaster || Yellow | ||
|- | |- | ||
| | | Shield guard up || Blue/White and Yellow | ||
|- | |- | ||
| | | Critical Hit || Blue/White | ||
|- | |- | ||
| ZoomRapid || | | ZoomRapid || Yellow | ||
|} | |} | ||
Line 75: | Line 77: | ||
* 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 (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 81: | Line 83: | ||
==== amiibo ==== | ==== amiibo ==== | ||
{|class="wikitable" | {|class="wikitable" | ||
! Bonus !! | ! Bonus !! Value that is used for the bonus effect | ||
|- | |- | ||
| | | None || - | ||
|- | |- | ||
| | | Attack up || addAtkMax | ||
|- | |- | ||
| | | Durability up || addLifeMax | ||
|- | |- | ||
| | | Long throw || addThrowMax | ||
|- | |- | ||
| | | Multi-shot burst (bows) || 5-shot burst | ||
|- | |- | ||
| | | Quick shot (bows) || addRapidFireMin | ||
|- | |- | ||
| | | AddSurfMaster || [[bgparamlist#Global|GlobalParameter]]::shieldSurfMasterFrictionRatio | ||
|- | |- | ||
| | | Shield guard up || addGuardMax | ||
|} | |} | ||
In summary, for amiibo weapons, an attack up always brings it to the greatest possible attack power. | |||
No randomness is involved. | |||
==== Non amiibo ==== | ==== Non-amiibo ==== | ||
{|class="wikitable" | {|class="wikitable" | ||
! Bonus !! | ! Bonus !! Value that is used for the bonus effect | ||
|- | |- | ||
| | | None || - | ||
|- | |- | ||
| | | Attack up || Random integer between addAtkMin and addAtkMax | ||
|- | |- | ||
| | | Durability up || Random integer between addLifeMin and addLifeMax | ||
|- | |- | ||
| | | Long throw || Random float between addThrowMin and addThrowMax | ||
|- | |- | ||
| | | Multi-shot burst (bows) || 5-shot burst | ||
|- | |- | ||
| | | Quick shot (bows) || Random float between addRapidFireMin and addRapidFireMax | ||
|- | |- | ||
| | | AddSurfMaster || [[bgparamlist#Global|GlobalParameter]]::shieldSurfMasterFrictionRatio | ||
|- | |- | ||
| | | Shield guard up || Random integer between addGuardMin and addGuardMax | ||
|} | |} | ||
In summary, for non-amiibo weapons, an attack up results in a randomized attack power. | |||
== | == Enemies == | ||
When loading enemies, the game will always try to scale enemies. | When loading enemies, the game will always try to scale enemies. | ||
Line 138: | Line 141: | ||
[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: | ||
{| class="wikitable" | {| class="wikitable" | ||
! | ! Parameter | ||
! | ! Default | ||
! Description | ! Description | ||
|- | |- | ||
| IsHardModeActor | | IsHardModeActor | ||
| false | | false | ||
| | | Controls whether an enemy only shows up in Master Mode. | ||
|- | |- | ||
| DisableRankUpForHardMode | | DisableRankUpForHardMode | ||
Line 150: | Line 153: | ||
| Controls whether the automatic rankup applies to an enemy. | | Controls whether the automatic rankup applies to an enemy. | ||
|} | |} | ||
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 == | ||
=== <code>LevelSensorMode</code> === | === <code>LevelSensorMode</code> === | ||
Line 165: | Line 168: | ||
{| class="wikitable" | {| class="wikitable" | ||
! | ! Value | ||
! Description | ! Description | ||
|- | |- | ||
Line 190: | Line 193: | ||
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 == | ||
=== <code>Ecosystem::LevelSensor::loadByml</code> === | === <code>Ecosystem::LevelSensor::loadByml</code> === | ||
This function is called by <code>Ecosystem::init</code> from <code>ksys::InitializeApp</code> | |||
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. | |||
Calculates weapon and enemy scaling points using a list of flags and configuration values. | Calculates weapon and enemy scaling points using a list of flags and configuration values. | ||
Line 219: | Line 222: | ||
</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. | |||
=== <code>Ecosystem::LevelSensor::scaleWeapon</code> === | === <code>Ecosystem::LevelSensor::scaleWeapon</code> === | ||
Line 229: | Line 232: | ||
If the algorithm fails to find an appropriate weapon that satisfies all conditions (point requirements, weapon series, modifier), the originally specified weapon and modifier will be used directly. | If the algorithm fails to find an appropriate weapon that satisfies all conditions (point requirements, weapon series, modifier), the originally specified weapon and modifier will be used directly. | ||
Pseudocode (1.0.0) : | Pseudocode (1.0.0): | ||
<source lang="c++"> | <source lang="c++"> | ||
Line 287: | Line 290: | ||
=== <code>Ecosystem::LevelSensor::scaleActor</code> === | === <code>Ecosystem::LevelSensor::scaleActor</code> === | ||
Analogous to <code>LevelSensor::scaleWeapon</code>. | |||
Pseudocode (1.0.0) : | Pseudocode (1.0.0): | ||
<source lang="c++"> | <source lang="c++"> | ||
Line 337: | Line 340: | ||
</source> | </source> | ||
== | == The Data == | ||
To make things easier to understand, here are links to: | |||
* [https://docs.google.com/spreadsheets/d/e/2PACX-1vRSlyOD7FLAn1TUBn64Pu8Pld-WOfgcVByuywHMWvBTEV0j8potD1wkBs-MJJXf-gvEkpfItUCMqMk6/pubhtml | * [https://docs.google.com/spreadsheets/d/e/2PACX-1vRSlyOD7FLAn1TUBn64Pu8Pld-WOfgcVByuywHMWvBTEV0j8potD1wkBs-MJJXf-gvEkpfItUCMqMk6/pubhtml kill point, enemy scaling and weapon scaling tables] | ||
* | * an [https://objmap.zeldamods.org object map with scaling information]. | ||
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 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 367: | Line 370: | ||
}</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. | |||
=== | === 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. | |||
Thus, blights that are fought in the Castle always have 800+3×400 = 2000 HP regardless of story progression. | |||
If flag 4 is set, the [[AIDef:Action/SiteBossDie]] code will NOT increment the "defeated" counter. This means castle blights do not give any scaling points. | |||
=== | === 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. | |||
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>. | |||