]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Split up atmos speedup from heat scaling (#22372)
authorKevin Zheng <kevinz5000@gmail.com>
Tue, 12 Dec 2023 07:49:20 +0000 (23:49 -0800)
committerGitHub <noreply@github.com>
Tue, 12 Dec 2023 07:49:20 +0000 (00:49 -0700)
Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs
Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs
Content.Server/Atmos/Reactions/FrezonCoolantReaction.cs
Content.Server/Atmos/Reactions/PlasmaFireReaction.cs
Content.Server/Atmos/Reactions/TritiumFireReaction.cs
Content.Shared/CCVar/CCVars.cs

index 1da90545059ecb63f1329a0683658a75535c9b17..bcd628a60de348a8c19782494f630339e09364c6 100644 (file)
@@ -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; }
 
         /// <summary>
         /// 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);
         }
index afed8e223c0e46fd4dca6e66cda231289a3a3487..41470c170c24b2b411c65cfbb2080f465cbc63f7 100644 (file)
@@ -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;
         }
 
         /// <summary>
@@ -69,7 +69,7 @@ namespace Content.Server.Atmos.EntitySystems
         /// </summary>
         public float PumpSpeedup()
         {
-            return MathF.Sqrt(Speedup);
+            return Speedup;
         }
 
         /// <summary>
index ce134126be9a71bf4f43f5a5a99c0c4c0d009e5a..ddbd8a772b78083d19f4c5d42fb32cd5d40863e7 100644 (file)
@@ -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;
 
index 9553b5ebfbed5cd3e0244b82b21096cca04a5743..22a8772e6826bdb45e61dc06eec1ddc74c87f9b4 100644 (file)
@@ -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);
                 }
             }
index 78a149aa25ddc86ef53e9a82f1738c01f4e6f308..d1459993bf80d288fb0b3ed0811b0a796aa22cdb 100644 (file)
@@ -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);
index 3014bbce0be86906099096a5be0dc3ad969980be..704705c3d989a432a508a096dcc4ece8fc5330af 100644 (file)
@@ -1046,12 +1046,19 @@ namespace Content.Shared.CCVar
 
         /// <summary>
         ///     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.
         /// </summary>
         public static readonly CVarDef<float> AtmosSpeedup =
-            CVarDef.Create("atmos.speedup", 64f, CVar.SERVERONLY);
+            CVarDef.Create("atmos.speedup", 8f, CVar.SERVERONLY);
+
+        /// <summary>
+        ///     Like atmos.speedup, but only for gas and reaction heat values. 64x means
+        ///     gases heat up and cool down 64x faster than real life.
+        /// </summary>
+        public static readonly CVarDef<float> AtmosHeatScale =
+            CVarDef.Create("atmos.heat_scale", 64f, CVar.SERVERONLY);
 
         /*
          * MIDI instruments