F1: power supply multiplies the resolved stat, it does not interpolate
PerformanceStat.Evaluate folded PowerSupply into the same Min/Max lerp factor as Heat/Durability/Quality, so zero supply bottomed out at Min instead of 0 (measured: a radiator at zero power still pumped 19-25% of full; three of Cut 7's eight authored terms had Min == Max and were completely inert, since lerp(x, x, anything) == x). PowerSupply terms are now accumulated into their own multiplier and applied to the fully-interpolated, fully-modified value instead of to the interpolation factor. The term still lives in PerformanceStat.Terms -- it is still authored per stat and still censused/validated the same way -- it is just no longer blended into `factor`. Corrected the comments that stated the old premise (Radiator.cs, Entity.cs, ItemData.cs's IStatContext.PowerSupplyFactor doc). Pinned in tests/Aetheria.Shared.Tests/PowerCurveTests.cs: APowerSupplyTermedStatWithNonzeroMinResolvesToExactlyZeroAtZeroSupply and AMinEqualsMaxStatStillRespondsToItsPowerSupplyTerm -- both fail under the reverted (lerp-based) mutation. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
parent
e6609c45f3
commit
da5a710030
4 changed files with 72 additions and 10 deletions
|
|
@ -90,8 +90,10 @@ public class Radiator : Behavior, IAlwaysUpdatedBehavior, IInitializableBehavior
|
|||
// plain Evaluate() read, so a PumpedHeat stat carrying a PowerSupply term already pumps less under a
|
||||
// partial grant -- waste heat below is unaffected by the curve, so a starved radiator falls behind and
|
||||
// the ship heats up, which is the reduced-performance failure the ruling asks for instead of the pump
|
||||
// simply refusing to run. At true zero supply PumpedHeat itself resolves to 0 (pow(0, exponent) == 0),
|
||||
// so "produces nothing" already falls out of the curve below without a special case here.
|
||||
// simply refusing to run. F1 (docs/stats-and-power-cut.md, operator ruling 2026-09-19): PowerSupply is a
|
||||
// multiplier PerformanceStat.Evaluate applies to the whole resolved value, not a term blended into the
|
||||
// Min/Max interpolation, so at true zero supply PumpedHeat resolves to exactly 0 regardless of Min -- so
|
||||
// "produces nothing" already falls out of Evaluate() without a special case here.
|
||||
var pumpedHeat = PumpedHeat * max(itemTemperature - _data.TemperatureFloor, 0);
|
||||
|
||||
// Radiator temperature is below temperature floor, stop executing
|
||||
|
|
|
|||
|
|
@ -1371,9 +1371,11 @@ public class EquippedItem : IStatContext
|
|||
public float HeatFactor(float exponent) => pow(ThermalPerformance, ThermalExponent * exponent);
|
||||
public float DurabilityFactor(float exponent) => pow(DurabilityPerformance, DurabilityExponent * exponent);
|
||||
public float ConsumableProgressFactor(float exponent) => 1f;
|
||||
// Cut 6 (docs/stats-and-power-cut.md): the brownout curve. A stat with a PowerSupply term degrades as this
|
||||
// tick's grant falls below 1 and is exactly unchanged at full supply (pow(1, exponent) == 1 regardless of
|
||||
// exponent) -- the operator's "a continuous consumer that degrades instead of stopping." PowerBus writes
|
||||
// Cut 6 (docs/stats-and-power-cut.md), applied per F1 (operator ruling 2026-09-19): PerformanceStat.Evaluate
|
||||
// multiplies this straight onto the resolved value rather than blending it into the Min/Max interpolation, so
|
||||
// a stat with a PowerSupply term is exactly unchanged at full supply (pow(1, exponent) == 1 regardless of
|
||||
// exponent) and exactly zero at zero supply (pow(0, exponent) == 0 for any exponent > 0), no matter what Min
|
||||
// is -- "a continuous consumer that degrades instead of stopping" down to genuinely nothing. PowerBus writes
|
||||
// PowerSupply below; the resolver invalidates this source once per tick from the same write (PowerBus.cs
|
||||
// AllocateTiers), so this read is always this tick's own grant, never a stale one.
|
||||
public float PowerSupplyFactor(float exponent) => pow(PowerSupply, exponent);
|
||||
|
|
|
|||
|
|
@ -587,9 +587,9 @@ public interface IStatContext
|
|||
// Progress through a consumable effect's duration, standing in for "condition" on a consumable the way heat
|
||||
// does for equipped gear. Only ConsumableItemEffect has one; every other context is the identity (1).
|
||||
float ConsumableProgressFactor(float exponent);
|
||||
// Cut 6 (the power bus) wires this to a real brownout curve. Until then no catalog stat declares a
|
||||
// PowerSupply term, and every context answers the identity so the enum member can exist now without a
|
||||
// resolver to back it.
|
||||
// Cut 6 (the power bus) wires this to the bus's grant ratio. F1 (docs/stats-and-power-cut.md, operator
|
||||
// ruling 2026-09-19): this is not one of the terms blended into the Min/Max interpolation -- PerformanceStat
|
||||
// applies it as a separate multiplier on the fully-resolved value, so zero supply always resolves to zero.
|
||||
float PowerSupplyFactor(float exponent);
|
||||
float ScaleModifier(PerformanceStat stat);
|
||||
float ConstantModifier(PerformanceStat stat);
|
||||
|
|
@ -643,11 +643,28 @@ public class PerformanceStat
|
|||
// this cut, because pow(x, 0) == 1 regardless of x. Callers keep their own NaN handling: an unequipped read
|
||||
// throws with diagnostic detail, an equipped or consumable read falls back to Min. That disagreement is not
|
||||
// named as a defect, so it is not touched here.
|
||||
//
|
||||
// F1 (docs/stats-and-power-cut.md, operator ruling 2026-09-19): PowerSupply is not folded into the
|
||||
// interpolation factor with every other source. Heat, Durability and Quality all describe "how worn/hot/well
|
||||
// made is this part" -- a part that is still there, just less good at its job, so blending toward Min is
|
||||
// right for them. Power is not a degradation of the part; it is whether the part is receiving anything to
|
||||
// work with at all, so it multiplies the fully-interpolated, fully-modified value instead: a PowerSupply term
|
||||
// still lives in this stat's own Terms list (it is still authored per stat, still censused, still refused on
|
||||
// a request stat by ValidateNoPowerSupplyOnRequest below), it is just applied as a separate multiplier rather
|
||||
// than contributing to `factor`. Consequences named in the ruling: PowerSupply == 0 makes the whole
|
||||
// expression 0 regardless of Min (pow(0, exponent) == 0 for any exponent > 0), and a Min == Max stat still
|
||||
// responds to a PowerSupply term because the multiplier no longer has to move a degenerate interpolation.
|
||||
public float Evaluate(IStatContext context)
|
||||
{
|
||||
var factor = 1f;
|
||||
var powerMultiplier = 1f;
|
||||
foreach (var term in Terms)
|
||||
{
|
||||
if (term.Source == StatSource.PowerSupply)
|
||||
{
|
||||
powerMultiplier *= context.PowerSupplyFactor(term.Exponent);
|
||||
continue;
|
||||
}
|
||||
factor *= term.Source switch
|
||||
{
|
||||
// F6 (docs/stats-and-power-cut.md Cut 2 Soul pass): nothing ever calls Resolver.InvalidateSource
|
||||
|
|
@ -662,11 +679,10 @@ public class PerformanceStat
|
|||
StatSource.Heat => context.HeatFactor(term.Exponent),
|
||||
StatSource.Durability => context.DurabilityFactor(term.Exponent),
|
||||
StatSource.ConsumableProgress => context.ConsumableProgressFactor(term.Exponent),
|
||||
StatSource.PowerSupply => context.PowerSupplyFactor(term.Exponent),
|
||||
_ => throw new ArgumentOutOfRangeException(nameof(term.Source), term.Source, $"Unknown StatSource on {Min}-{Max} stat")
|
||||
};
|
||||
}
|
||||
return lerp(Min, Max, factor) * context.ScaleModifier(this) + context.ConstantModifier(this);
|
||||
return (lerp(Min, Max, factor) * context.ScaleModifier(this) + context.ConstantModifier(this)) * powerMultiplier;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue