Significantly improve TEG power generation stability (#37658)
* Significantly improve TEG power generation stability * Revert "Significantly improve TEG power generation stability" This reverts commit e88278c0f8dea925a89b240e09e5dbcb84f9d174. * Reimplement without auto formatting obliterating the entire system * second round of balancing
This commit is contained in:
@@ -186,8 +186,12 @@ public sealed class TegSystem : EntitySystem
|
||||
|
||||
// Turn energy (at atmos tick rate) into wattage.
|
||||
var power = electricalEnergy / args.dt;
|
||||
|
||||
// Add ramp factor. This magics slight power into existence, but allows us to ramp up.
|
||||
supplier.MaxSupply = power * component.RampFactor;
|
||||
// Also apply an exponential moving average to smooth out fluttering, as it was causing
|
||||
// seizures.
|
||||
supplier.MaxSupply = component.PowerSmoothingFactor * (power * component.RampFactor) +
|
||||
(1 - component.PowerSmoothingFactor) * supplier.MaxSupply;
|
||||
|
||||
var circAComp = Comp<TegCirculatorComponent>(circA);
|
||||
var circBComp = Comp<TegCirculatorComponent>(circB);
|
||||
|
||||
Reference in New Issue
Block a user