From 24629ad487cbf8ad8b71c22bbb0c26a34e7f0b88 Mon Sep 17 00:00:00 2001 From: Kevin Zheng Date: Wed, 13 Dec 2023 18:38:58 -0800 Subject: [PATCH] Fix heat capacity scaling (#22464) * Correctly apply HeatScale * Apply HeatScale on InitializeGases() * Re-add conservative heat scaling and speedup --- Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs | 2 +- Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs | 4 ++-- Content.Shared/CCVar/CCVars.cs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs index bcd628a60d..7f82e6fb57 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.CVars.cs @@ -52,7 +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.AtmosHeatScale, value => { HeatScale = value; InitializeGases(); }, 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 41470c170c..6a63185811 100644 --- a/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs +++ b/Content.Server/Atmos/EntitySystems/AtmosphereSystem.Gases.cs @@ -35,7 +35,7 @@ namespace Content.Server.Atmos.EntitySystems for (var i = 0; i < GasPrototypes.Length; i++) { - _gasSpecificHeats[i] = GasPrototypes[i].SpecificHeat; + _gasSpecificHeats[i] = GasPrototypes[i].SpecificHeat / HeatScale; GasReagents[i] = GasPrototypes[i].Reagent; } } @@ -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) / HeatScale; + return MathF.Max(NumericsHelpers.HorizontalAdd(tmp), Atmospherics.MinimumHeatCapacity); } /// diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 087e7bb850..a8b2960728 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -1053,14 +1053,14 @@ namespace Content.Shared.CCVar /// in-game. /// public static readonly CVarDef AtmosSpeedup = - CVarDef.Create("atmos.speedup", 1f, 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", 1f, CVar.SERVERONLY); + CVarDef.Create("atmos.heat_scale", 8f, CVar.SERVERONLY); /* * MIDI instruments -- 2.51.2