diff --git a/Content.Server/Power/Generation/Teg/TegGeneratorComponent.cs b/Content.Server/Power/Generation/Teg/TegGeneratorComponent.cs index 87998e5d82..1551078a88 100644 --- a/Content.Server/Power/Generation/Teg/TegGeneratorComponent.cs +++ b/Content.Server/Power/Generation/Teg/TegGeneratorComponent.cs @@ -75,4 +75,10 @@ public sealed partial class TegGeneratorComponent : Component [ViewVariables(VVAccess.ReadWrite)] [DataField("volumeMax")] public float VolumeMax = -4; + + /// + /// Smoothing factor used to smooth out power generation. + /// + [DataField] + public float PowerSmoothingFactor = 0.2f; } diff --git a/Content.Server/Power/Generation/Teg/TegSystem.cs b/Content.Server/Power/Generation/Teg/TegSystem.cs index 77848d5c79..0de3038a35 100644 --- a/Content.Server/Power/Generation/Teg/TegSystem.cs +++ b/Content.Server/Power/Generation/Teg/TegSystem.cs @@ -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(circA); var circBComp = Comp(circB);