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
ChunkUnloadingEnabledtrueTrailing chunk cleanup
EnemySpawningEnabledfalseNatural enemy spawning (debug spawns unaffected)
LightingEnabledtrueLighting system startup
DayNightCycleEnabledtrueProgressive day/night based on chunk progression
DecoreVisibletrueDecorative foliage rendering
DebugModeEnabledtrueUnlocks mouse, enables debug UI
DevToolsEnabledtrueDev testing tools in debug menu
GamePhase"game"Current phase: "lobby" or "game"
VFXEnabledtrueVisual effects
SoundsEnabledtrueAudio
ParticlesEnabledtrueParticle systems

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.