Insanity System
The insanity system creates escalating psychological pressure through visual and audio distortion.
Mechanics
| Parameter | Value |
|---|---|
| Increment rate | +0.005 per heartbeat per active factor |
| Decay rate (safe zone) | -0.05 per heartbeat |
| Decay rate (normal) | -0.005 per heartbeat |
| Range | 0.0 – 1.0 (clamped) |
Contributing Factors
Insanity increases when any of these are active:
- Player is in a danger zone
- A monster is nearby
- The Watcher is active and pursuing
Multiple factors stack additively.
Visual Effects
Vignette
- Red overlay driven by insanity atom
- Transparency:
1 - insanity(fully opaque at max insanity) - Managed by
VingetteControllerUI component
Camera Effects
- Sway intensity:
insanity * 2 - Shake increases with insanity level
Safe Zone Recovery
When a player enters a safe zone:
- Insanity decays at 10x the normal rate (-0.05 vs -0.005)
- Combined with health regen (10 HP/sec), safe zones provide full recovery
Implementation
The insanity state lives in player.store.ts as a client-side atom, updated in the heartbeat effect. The vignette UI component subscribes reactively.
player.store.ts (heartbeat)
→ Reads: dangerZonePlayers, safeZonePlayers, activeMonsters
→ Updates: insanityAtom
→ VingetteController subscribes to insanityAtom
→ Renders red overlay at calculated transparency