From: Kevin Zheng Date: Tue, 12 Dec 2023 07:49:20 +0000 (-0800) Subject: Split up atmos speedup from heat scaling (#22372) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=405e569cd53c02248f6aa6bb405421e534b140c4;p=space-station-14.git Split up atmos speedup from heat scaling (#22372) --- diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs index 1da9054505..bcd628a60d 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs @@ -25,6 +25,7 @@ namespace Content.Server.Atmos.EntitySystems public float AtmosMaxProcessTime { get; private set; } public float AtmosTickRate { get; private set; } public float Speedup { get; private set; } + public float HeatScale { get; private set; } /// /// Time between each atmos sub-update. If you are writing an atmos device, use AtmosDeviceUpdateEvent.dt @@ -51,6 +52,7 @@ namespace Content.Server.Atmos.EntitySystems _cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, value => AtmosMaxProcessTime = value, true); _cfg.OnValueChanged(CCVars.AtmosTickRate, value => AtmosTickRate = value, true); _cfg.OnValueChanged(CCVars.AtmosSpeedup, value => Speedup = value, true); + _cfg.OnValueChanged(CCVars.AtmosHeatScale, value => HeatScale = value, true); _cfg.OnValueChanged(CCVars.ExcitedGroups, value => ExcitedGroups = value, true); _cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, value => ExcitedGroupsSpaceIsAllConsuming = value, true); } diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs index afed8e223c..41470c170c 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs @@ -61,7 +61,7 @@ namespace Content.Server.Atmos.EntitySystems NumericsHelpers.Multiply(moles, GasSpecificHeats, tmp); // Adjust heat capacity by speedup, because this is primarily what // determines how quickly gases heat up/cool. - return MathF.Max(NumericsHelpers.HorizontalAdd(tmp), Atmospherics.MinimumHeatCapacity) / Speedup; + return MathF.Max(NumericsHelpers.HorizontalAdd(tmp), Atmospherics.MinimumHeatCapacity) / HeatScale; } /// @@ -69,7 +69,7 @@ namespace Content.Server.Atmos.EntitySystems /// public float PumpSpeedup() { - return MathF.Sqrt(Speedup); + return Speedup; } /// diff --git a/Content.Server/Atmos/Reactions/FrezonCoolantReaction.cs b/Content.Server/Atmos/Reactions/FrezonCoolantReaction.cs index ce134126be..ddbd8a772b 100644 --- a/Content.Server/Atmos/Reactions/FrezonCoolantReaction.cs +++ b/Content.Server/Atmos/Reactions/FrezonCoolantReaction.cs @@ -45,7 +45,7 @@ public sealed partial class FrezonCoolantReaction : IGasReactionEffect energyReleased = burnRate * Atmospherics.FrezonCoolEnergyReleased * energyModifier; } - energyReleased /= atmosphereSystem.Speedup; // adjust energy to make sure speedup doesn't cause mega temperature rise + energyReleased /= atmosphereSystem.HeatScale; // adjust energy to make sure speedup doesn't cause mega temperature rise if (energyReleased >= 0f) return ReactionResult.NoReaction; diff --git a/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs b/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs index 9553b5ebfb..22a8772e68 100644 --- a/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs +++ b/Content.Server/Atmos/Reactions/PlasmaFireReaction.cs @@ -56,7 +56,7 @@ namespace Content.Server.Atmos.Reactions mixture.AdjustMoles(Gas.CarbonDioxide, plasmaBurnRate * (1.0f - supersaturation)); energyReleased += Atmospherics.FirePlasmaEnergyReleased * plasmaBurnRate; - energyReleased /= atmosphereSystem.Speedup; // adjust energy to make sure speedup doesn't cause mega temperature rise + energyReleased /= atmosphereSystem.HeatScale; // adjust energy to make sure speedup doesn't cause mega temperature rise mixture.ReactionResults[GasReaction.Fire] += plasmaBurnRate * (1 + oxygenBurnRate); } } diff --git a/Content.Server/Atmos/Reactions/TritiumFireReaction.cs b/Content.Server/Atmos/Reactions/TritiumFireReaction.cs index 78a149aa25..d1459993bf 100644 --- a/Content.Server/Atmos/Reactions/TritiumFireReaction.cs +++ b/Content.Server/Atmos/Reactions/TritiumFireReaction.cs @@ -47,7 +47,7 @@ namespace Content.Server.Atmos.Reactions mixture.ReactionResults[GasReaction.Fire] += burnedFuel; } - energyReleased /= atmosphereSystem.Speedup; // adjust energy to make sure speedup doesn't cause mega temperature rise + energyReleased /= atmosphereSystem.HeatScale; // adjust energy to make sure speedup doesn't cause mega temperature rise if (energyReleased > 0) { var newHeatCapacity = atmosphereSystem.GetHeatCapacity(mixture); diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 3014bbce0b..704705c3d9 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -1046,12 +1046,19 @@ namespace Content.Shared.CCVar /// /// Scale factor for how fast things happen in our atmosphere - /// simulation compared to real life. 1x means that a room takes as - /// long to heat up in game as real life. Players typically expect - /// things to happen faster in-game. + /// simulation compared to real life. 1x means pumps run at 1x + /// speed. Players typically expect things to happen faster + /// in-game. /// public static readonly CVarDef AtmosSpeedup = - CVarDef.Create("atmos.speedup", 64f, CVar.SERVERONLY); + CVarDef.Create("atmos.speedup", 8f, CVar.SERVERONLY); + + /// + /// Like atmos.speedup, but only for gas and reaction heat values. 64x means + /// gases heat up and cool down 64x faster than real life. + /// + public static readonly CVarDef AtmosHeatScale = + CVarDef.Create("atmos.heat_scale", 64f, CVar.SERVERONLY); /* * MIDI instruments