Files
Project-M/Assets/_Project/Scripts/Client/Presentation/AmbientLifeConfig.cs
T
kronic 6dcd8a243d World: critters + weather beats — AmbientLifeSystem (Phase 1.5b bundle 4)
Client-only, procedural, zero netcode — a sibling of AmbientMotionSystem,
biome-keyed + camera-following. Three cosmetic beats: fleeing critters (ground
bugs + a few birds that dart out of the flee radius = the scatter beat,
biome-tinted, recycled at the ring edge), drifting cloud-shadow discs, and
Blight-room-only double-blink directional lightning flash + delayed thunder
(dedicated flash light -> no RenderSettings fight with WorldAtmosphereSystem).
Reuses the FeedbackFx disc/scorch primitives + procedural SFX. Live knobs in
AmbientLifeConfig. 474/474 EditMode; live-verified at base (flee confirmed).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-12 14:41:35 -07:00

87 lines
4.0 KiB
C#

using UnityEngine;
namespace ProjectM.Client
{
/// <summary>
/// Live-tunable knobs for the client-only AMBIENT LIFE slice (Phase 1.5b bundle 4: fleeing critters +
/// weather beats — cloud-shadow drifts + Blight lightning). Static bridge (mirrors <see cref="DecalConfig"/> /
/// <see cref="WorldFeelConfig"/>) so values can be poked at runtime via MCP execute_code without a recompile.
/// Read ONLY by <see cref="AmbientLifeSystem"/> (managed, main-thread). NEVER read from a [BurstCompile] system.
/// <see cref="ResetDefaults"/> re-stamps on play-enter via [RuntimeInitializeOnLoadMethod] (statics survive
/// fast-enter-playmode reloads). All effects are cosmetic + observe-only — zero netcode.
/// </summary>
public static class AmbientLifeConfig
{
/// <summary>Master gate for every ambient-life effect.</summary>
public static bool Enabled;
// ---- fleeing critters (ground bugs + a few birds) ----
/// <summary>Master gate for the critter pool.</summary>
public static bool CrittersEnabled;
/// <summary>Live critters maintained near the camera.</summary>
public static int CritterCount;
/// <summary>Radius (world u) around the camera critters live in; past it they recycle to the ring edge.</summary>
public static float CritterRadius;
/// <summary>A critter within this distance of the local player DARTS away (the scatter beat).</summary>
public static float CritterFleeRadius;
/// <summary>Idle wander speed (u/s).</summary>
public static float CritterIdleSpeed;
/// <summary>Flee dart speed (u/s) when the player is close.</summary>
public static float CritterFleeSpeed;
/// <summary>Fraction of the pool that are BIRDS (airborne, faster, flee upward) vs ground bugs.</summary>
public static float BirdFraction;
// ---- cloud-shadow drifts ----
/// <summary>Master gate for drifting cloud shadows.</summary>
public static bool CloudsEnabled;
/// <summary>Number of soft dark shadow discs drifting across the ground near the camera.</summary>
public static int CloudCount;
/// <summary>Shadow disc radius (world u).</summary>
public static float CloudSize;
/// <summary>Peak shadow opacity (alpha).</summary>
public static float CloudAlpha;
/// <summary>Drift speed (u/s) across the ground.</summary>
public static float CloudDriftSpeed;
// ---- Blight lightning flicker (Blight-biome only) ----
/// <summary>Master gate for the Blight lightning beat.</summary>
public static bool LightningEnabled;
/// <summary>Min / max seconds between lightning strikes.</summary>
public static float LightningMinInterval;
public static float LightningMaxInterval;
/// <summary>Peak flash directional-light intensity.</summary>
public static float LightningIntensity;
/// <summary>Flash tint (cool blight white-purple).</summary>
public static Color LightningColor;
/// <summary>Thunder SFX volume (delayed after the flash).</summary>
public static float ThunderVolume;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
public static void ResetDefaults()
{
Enabled = true;
CrittersEnabled = true;
CritterCount = 10;
CritterRadius = 22f;
CritterFleeRadius = 4f;
CritterIdleSpeed = 0.6f;
CritterFleeSpeed = 6f;
BirdFraction = 0.25f;
CloudsEnabled = true;
CloudCount = 3;
CloudSize = 18f;
CloudAlpha = 0.20f;
CloudDriftSpeed = 1.6f;
LightningEnabled = true;
LightningMinInterval = 6f;
LightningMaxInterval = 16f;
LightningIntensity = 2.4f;
LightningColor = new Color(0.75f, 0.7f, 1f);
ThunderVolume = 0.45f;
}
}
}