Difficulty scaling: Difference between revisions
Jump to navigation
Jump to search
m
terms
imported>Leoetlino |
imported>Leoetlino m (terms) |
||
Line 16: | Line 16: | ||
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]]. | ||
The subsystem provides two functions ([[Difficulty scaling#Ecosystem::LevelSensor:: | 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 == | ||
Line 26: | Line 26: | ||
== Weapons == | == Weapons == | ||
' | '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''': Always upon opening or destroying the chest. | * '''For treasure chest drops''': Always upon opening or destroying the chest. | ||
Line 61: | Line 61: | ||
=== <code>LevelSensorMode</code> === | === <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 ' | 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'. | ||
Line 120: | Line 120: | ||
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:: | === <code>Ecosystem::LevelSensor::scaleWeapon</code> === | ||
Called from treasure chest code, enemy actors{{Check}}, <code>Ecosystem::LevelSensor:: | Called from treasure chest code, enemy actors{{Check}}, <code>Ecosystem::LevelSensor::scaleActor</code> | ||
Given a weapon name, its modifier and current point status, this function returns the weapon to actually spawn and the modifier to use (if possible). | Given a weapon name, its modifier and current point status, this function returns the weapon to actually spawn and the modifier to use (if possible). | ||
Line 129: | Line 129: | ||
Pseudocode (1.0.0): | Pseudocode (1.0.0): | ||
<source lang="c++"> | <source lang="c++"> | ||
bool Ecosystem::LevelSensor:: | bool Ecosystem::LevelSensor::scaleWeapon(StringView weapon_to_look_up, | ||
WeaponModifier required_modifier, | WeaponModifier required_modifier, | ||
const char** weapon_to_use_name, | const char** weapon_to_use_name, | ||
Line 182: | Line 182: | ||
</source> | </source> | ||
=== <code>Ecosystem::LevelSensor:: | === <code>Ecosystem::LevelSensor::scaleActor</code> === | ||
Analogous to <code>LevelSensor:: | Analogous to <code>LevelSensor::scaleWeapon</code>. | ||
Pseudocode (1.0.0): | Pseudocode (1.0.0): | ||
Line 223: | Line 223: | ||
modifier = get_random_blue_modifier(actor->getWeaponName()); | modifier = get_random_blue_modifier(actor->getWeaponName()); | ||
if ( | if (scaleWeapon(weapon_name, &weapon_to_use, &modifier_to_use)) { | ||
actor->setProperty("SharpWeaponJudgeType", modifier_to_use); | actor->setProperty("SharpWeaponJudgeType", modifier_to_use); | ||
*actor_to_use = weapon_to_use; | *actor_to_use = weapon_to_use; |