Files
Project-M/Assets/_Project/Scripts/Client/Presentation/WorldFeelConfig.cs
T
kronic 8baf98622f Phase 1.5 stabilize: restore swallowed [RuntimeInitializeOnLoadMethod] - harvest feedback slice was silently dead
The 07-07 knob edit to WorldFeelConfig replaced the attribute line above
ResetDefaults(), so Enabled/ChipBurstCount/Node* all stayed C# defaults and
NodeFeedbackSystem + WorldFeedbackSystem chips/SFX/micro-punch never ran.
Live-verified: root PTM 0.783 -> child LTW 1.723 (= 2.2 x 0.783), 455/455.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-07 21:38:09 -07:00

80 lines
4.1 KiB
C#

using UnityEngine;
namespace ProjectM.Client
{
/// <summary>
/// Live-tunable knobs for the client-only WORLD-FEEDBACK slice (harvesting nodes + smashing Blight clutter).
/// A static bridge (mirrors <see cref="FeelConfig"/>) so values can be poked at runtime via MCP execute_code
/// without a recompile (e.g. <c>ProjectM.Client.WorldFeelConfig.ClearFovKick = 1.2f;</c>). Read ONLY by
/// <see cref="WorldFeedbackSystem"/> (managed, main-thread). NEVER read from a [BurstCompile] system
/// (managed-static + Color-in-Burst hazards). <see cref="ResetDefaults"/> re-stamps on play-enter via
/// [RuntimeInitializeOnLoadMethod] because statics survive fast-enter-playmode reloads (else a poked value
/// leaks across play-enters).
/// </summary>
public static class WorldFeelConfig
{
/// <summary>Master gate for harvest/clear feedback.</summary>
public static bool Enabled;
/// <summary>Particle burst when a node/clutter loses hit-points (a chip).</summary>
public static int ChipBurstCount;
/// <summary>Particle burst when a node depletes / clutter shatters (the clear).</summary>
public static int ClearBurstCount;
/// <summary>Soft SFX volume on a chip.</summary>
public static float ChipSfxVolume;
/// <summary>SFX volume on a shatter / deplete.</summary>
public static float ClearSfxVolume;
/// <summary>Camera FOV kick (deg) when clutter shatters near the player — the satisfying smash. 0 = off.</summary>
public static float ClearFovKick;
/// <summary>Camera shake when clutter shatters near the player.</summary>
public static float ClearShake;
/// <summary>Only fire prune VFX when the despawned entity's last position is within this distance of the
/// local player, so a region-transit despawn storm at +1000 X stays silent off-camera.</summary>
public static float ProximityRange;
/// <summary>Tint for wild-Aether clutter shatter + Aether-node chips (HDR orange, pushes past bloom).</summary>
public static Color WildTint;
/// <summary>Tint for Ore-node chips (HDR amber).</summary>
public static Color OreTint;
/// <summary>Tint for Biomass-node chips (HDR sickly green).</summary>
public static Color BiomassTint;
// ---- Node harvest BODY feedback (NodeFeedbackSystem: client-only PostTransformMatrix scale). ----
/// <summary>Smallest a node/clutter shrinks to just before it depletes (fraction of its full size).</summary>
public static float NodeMinScale;
/// <summary>Brief extra scale-up on each harvest hit (the per-hit "reaction" pop); decays over NodePopDurationSec.</summary>
public static float NodeHitPopScale;
/// <summary>Seconds for the per-hit scale-pop to decay back.</summary>
public static float NodePopDurationSec;
/// <summary>Tiny camera FOV kick per harvest hit near the player (impact); 0 = off.</summary>
public static float ChipFovKick;
/// <summary>Tiny camera shake per harvest hit near the player.</summary>
public static float ChipShake;
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
public static void ResetDefaults()
{
Enabled = true;
ChipBurstCount = 12; // beefed from 6 -> a clearly visible chip spray per harvest hit
ClearBurstCount = 22;
ChipSfxVolume = 0.42f; // beefed from 0.30 -> a punchier "tink"
ClearSfxVolume = 0.55f;
ClearFovKick = 0.8f;
ClearShake = 0.12f;
ProximityRange = 40f;
WildTint = new Color(3.0f, 1.1f, 0.25f);
OreTint = new Color(2.6f, 1.9f, 0.7f);
BiomassTint = new Color(0.9f, 2.4f, 0.8f);
NodeMinScale = 0.35f; // node shrinks to ~1/3 size as it nears depletion
NodeHitPopScale = 0.16f; // brief +16% pop on each hit
NodePopDurationSec = 0.16f;
ChipFovKick = 0.35f; // subtle per-hit camera impact near the player
ChipShake = 0.05f;
}
}
}