Skip to main content

Feature Flags & Debug Flags

All flags are Charm atoms — they can be toggled at runtime via the debug UI.

Feature Flags​

Defined in src/shared/feature-flags.ts. These control game systems:

FlagDefaultPurpose
DevelopmentModefalseEnables dev spawn, sandbox mode
SandboxModefalseFree camera, debug tools (auto-enabled by DevelopmentMode)
ChunksEnabledtrueChunk generation system
ChunksDebugfalseChunk debug visualizations
ConfinedChunksDebugtrueThorned-ring rendering for confined chunks on the planner minimap
ChunkUnloadingEnabledtrueTrailing chunk cleanup
EnemySpawningEnabledtrueNatural enemy spawning (debug spawns unaffected)
DevourEnabledtrueDevour enemy idle-spawn behavior
PathMonsterChaseEnabledtruePathMonster sweep cadence
RavineEnabledfalseBoundary-loop ravine pits
RocksEnabledtrueFlippable rock interactables
ForceOpenInteractableSpawnfalseDebug: force every chunk to spawn Crate / FlippedTable
LightingEnabledtrueLighting system startup
DayNightCycleEnabledtrueProgressive day/night based on chunk progression
DecoreVisibletrueDecorative foliage rendering
DebugModeEnabledfalseUnlocks mouse, enables debug UI (auto-enabled by SandboxMode)
DevToolsEnabledtrueDev testing tools in debug menu
GamePhase"game" (Studio) / "lobby" (live)Current phase
VFXEnabledfalseVisual effects
SoundsEnabledtrueAudio
ParticlesEnabledfalseParticle systems
TreeSwayEnabledtrueTree sway animation
TreeKnockoverEnabledtrueTree knockover physics
FoliageSwayEnabledtrueFoliage sway animation
WindLinesEnabledtrueWind line VFX
WispsEnabledtrueWisp entities

Phase 8 — Director Feedback Loops​

The RunDirector accumulates runtime signals (deaths, chunk clears, low-health exits) in a FeedbackState and feeds them through flag-gated policies that adjust per-marker pressure. Both flags default OFF so the accumulator runs harmlessly during a bake window; flipping them on enables the actual pressure mutation.

FlagDefaultPurpose
FeedbackDeathEasefalseEnables DeathAwareEasingPolicy — eases pressure on the 3 markers following a player death (0.85 → 0.90 → 0.95 multiplier).
FeedbackStreakPressurefalseEnables StreakPressurePolicy — adds a small pressure bump (up to ×1.10) after a 4+ marker clean clear streak.

When both flags are off, RunDirector.getFeedbackPressureMultiplier() returns 1.0 so callers can read it unconditionally. See Director Feedback Loops for the full system.

Debug Flags​

Defined in src/shared/debug-flags.ts. These gate log output:

FlagDefaultPurpose
ChunkLogsfalseChunk generation logging
LightingLogsfalseDay/night transition logging
EnemyLogsfalseEnemy spawn/despawn logging
FlowerTrapLogsfalseFlower trap behavior logging
DangerZoneLogsfalseDanger zone creation logging
QuirkymalLogsfalseCharacter system logging
DeathLogsfalseDeath/respawn logging
WatcherLogsfalseWatcher boss logging
SafeZoneLogsfalseSafe zone detection logging
PathDebugfalsePath node debug visualization
QueueDebugfalseQueue system logging
ForestLogsfalseClient-side forest generation logging

Usage Pattern​

import debugFlags from "shared/debug-flags";

// Gate expensive logging behind flag check
if (debugFlags.EnemyLogs()) {
print(`[EnemyService] Spawned ${type} at ${position}`);
}

All flags are toggleable in the debug UI at runtime via renderFlagCheckbox() in debug-controller.ts.