From c54e3b63e7d14d3344bd7806be40c7fa139a9404 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 21 Jun 2026 23:38:05 +0100 Subject: [PATCH] Move heatstroke pulse tuning into daemon render settings --- Aetheria.State.Verify/Program.cs | 11 +++++++++-- Assets/Scripts/Gameplay/ActionGameManager.cs | 8 ++++---- .../Runtime/AetheriaRuntimeDaemonRenderQueries.cs | 15 ++++++++++++++- 3 files changed, 27 insertions(+), 7 deletions(-) diff --git a/Aetheria.State.Verify/Program.cs b/Aetheria.State.Verify/Program.cs index 6f20327ac..7ed8fe1ce 100644 --- a/Aetheria.State.Verify/Program.cs +++ b/Aetheria.State.Verify/Program.cs @@ -1823,9 +1823,12 @@ static void RequireDaemonRenderQueryAuthority(string root) "public double SevereHeatstrokeRiskThreshold { get; }", "public double TargetDetectionInfoThreshold { get; }", "public double LockIndicatorNoiseAmplitude { get; }", + "public double HeatstrokePhasingFloor { get; }", + "public double HeatstrokePhasingFrequency { get; }", "public double NormalizeThermalRisk(double temperature)", "public double NormalizeHeatstrokePost(double heatstroke)", "public double NormalizeSevereHeatstrokePost(double heatstroke)", + "public double ResolveSevereHeatstrokePostWeight(double heatstroke, double timeSeconds)", "public double NormalizeDetectionProgress(double infoGathered)", "public double NormalizeTargetVisibilityFill(double infoGathered)", "public double NormalizeVisibilityToTargetFill(double infoGathered)", @@ -2197,7 +2200,7 @@ static void RequireDaemonRenderQueryAuthority(string root) { "renderSettings.NormalizeDetectionProgress(", "renderSettings.NormalizeHeatstrokePost(", - "renderSettings.NormalizeSevereHeatstrokePost(", + "renderSettings.ResolveSevereHeatstrokePostWeight(", "renderSettings.NormalizeTargetVisibilityFill(", "renderSettings.NormalizeVisibilityToTargetFill(", "renderSettings.NormalizeTargetStatusFill(", @@ -2207,7 +2210,9 @@ static void RequireDaemonRenderQueryAuthority(string root) "new AetheriaRuntimeExponentialLerp(", "Settings.GameplaySettings.TargetDetectionInfoThreshold", "Settings.GameplaySettings.SevereHeatstrokeRiskThreshold", - "Settings.GameplaySettings.LockIndicatorNoiseAmplitude" + "Settings.GameplaySettings.LockIndicatorNoiseAmplitude", + "Settings.HeatstrokePhasingFloor", + "Settings.HeatstrokePhasingFrequency" }; var missingActionGameManagerRenderSymbols = requiredActionGameManagerRenderSymbols @@ -2227,6 +2232,8 @@ static void RequireDaemonRenderQueryAuthority(string root) "Settings.GameplaySettings.LockIndicatorNoiseAmplitude", "Settings.GameplaySettings.LockIndicatorFrequency", "Settings.GameplaySettings.LockSpinSpeed", + "Settings.HeatstrokePhasingFloor", + "Settings.HeatstrokePhasingFrequency", "Mathf.Lerp(.25f, .75f," }; var renderLoopHits = FindMethodScopedLineHits(actionGameManager, forbiddenRenderLoopSymbols) diff --git a/Assets/Scripts/Gameplay/ActionGameManager.cs b/Assets/Scripts/Gameplay/ActionGameManager.cs index 808db9098..059ae1131 100644 --- a/Assets/Scripts/Gameplay/ActionGameManager.cs +++ b/Assets/Scripts/Gameplay/ActionGameManager.cs @@ -582,7 +582,9 @@ public class ActionGameManager : MonoBehaviour Settings.GameplaySettings.HeatstrokeTemperature, Settings.GameplaySettings.SevereHeatstrokeRiskThreshold, Settings.GameplaySettings.TargetDetectionInfoThreshold, - Settings.GameplaySettings.LockIndicatorNoiseAmplitude); + Settings.GameplaySettings.LockIndicatorNoiseAmplitude, + Settings.HeatstrokePhasingFloor, + Settings.HeatstrokePhasingFrequency); } private readonly (float2 direction, string name)[] _directions = { @@ -3695,10 +3697,8 @@ public class ActionGameManager : MonoBehaviour _viewDirection = Quaternion.Euler(_entityYawPitch.y * Mathf.Rad2Deg, _entityYawPitch.x * Mathf.Rad2Deg, 0) * Vector3.forward; RequestLookDirection(_viewDirection); HeatstrokePost.weight = (float)renderSettings.NormalizeHeatstrokePost(CurrentEntity.Heatstroke); - var severeHeatstrokeLerp = (float)renderSettings.NormalizeSevereHeatstrokePost(CurrentEntity.Heatstroke); SevereHeatstrokePost.weight = - severeHeatstrokeLerp + severeHeatstrokeLerp * (1 - severeHeatstrokeLerp) * - Mathf.Max(Settings.HeatstrokePhasingFloor, Mathf.Sin(Time.time * Settings.HeatstrokePhasingFrequency)); + (float)renderSettings.ResolveSevereHeatstrokePostWeight(CurrentEntity.Heatstroke, Time.time); if(CurrentEntity is Ship) { diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonRenderQueries.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonRenderQueries.cs index 3bcec3be9..7af86635b 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonRenderQueries.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonRenderQueries.cs @@ -58,7 +58,9 @@ namespace GameCult.Aetheria.State.Verse double heatstrokeTemperature, double severeHeatstrokeRiskThreshold, double targetDetectionInfoThreshold, - double lockIndicatorNoiseAmplitude) + double lockIndicatorNoiseAmplitude, + double heatstrokePhasingFloor = 0.0, + double heatstrokePhasingFrequency = 5.0) { TemperatureEmissionCurve = temperatureEmissionCurve; LockIndicatorFrequency = lockIndicatorFrequency; @@ -69,6 +71,8 @@ namespace GameCult.Aetheria.State.Verse SevereHeatstrokeRiskThreshold = severeHeatstrokeRiskThreshold; TargetDetectionInfoThreshold = targetDetectionInfoThreshold; LockIndicatorNoiseAmplitude = lockIndicatorNoiseAmplitude; + HeatstrokePhasingFloor = heatstrokePhasingFloor; + HeatstrokePhasingFrequency = heatstrokePhasingFrequency; } public AetheriaRuntimeExponentialCurve TemperatureEmissionCurve { get; } @@ -80,6 +84,8 @@ namespace GameCult.Aetheria.State.Verse public double SevereHeatstrokeRiskThreshold { get; } public double TargetDetectionInfoThreshold { get; } public double LockIndicatorNoiseAmplitude { get; } + public double HeatstrokePhasingFloor { get; } + public double HeatstrokePhasingFrequency { get; } public double NormalizeThermalRisk(double temperature) { @@ -107,6 +113,13 @@ namespace GameCult.Aetheria.State.Verse return Saturate((heatstroke - SevereHeatstrokeRiskThreshold) / range); } + public double ResolveSevereHeatstrokePostWeight(double heatstroke, double timeSeconds) + { + var normalized = NormalizeSevereHeatstrokePost(heatstroke); + return normalized + normalized * (1.0 - normalized) * + Math.Max(HeatstrokePhasingFloor, Math.Sin(timeSeconds * HeatstrokePhasingFrequency)); + } + public double NormalizeDetectionProgress(double infoGathered) { return TargetDetectionInfoThreshold <= 0