The Manifold Codex
The Geometry, Threats, and Relics: A Working Reference to Level 0's 63 Procedural Subsystems
Every sector, blueprint, hazard, and tool in this codex is broken down into three concrete realities: What It Does (sensory presentation, gameplay effects, and player interactions), How It Works (algorithmic generation, spatial registration, and mathematical pipelines), and Why It Works (psychological design rationale, performance bounds, and zero-allocation constraints).
All 63 procedural subsystems are fully catalogued and source-verified against the engine repository. Reference tables and entries reflect exact constants, probability distributions, and architectural boundaries.
🏗️ Macro Sectors (14 Systems · 14 Written)
Macro sectors are continuous subterranean biomes generated across contiguous chunks. Each defines its own volumetric fog, lighting temperatures, acoustic resonances, and structural blueprint probability matrices.
| Sector | Fog colour | Fog density | Resident entity |
|---|---|---|---|
| Normal | #a6a6a6 | 0.015 | The Anomaly (default) |
| Archive | #212121 | 0.145 | The Archivist |
| Impound | #433d3d | 0.09 | The Warden |
| Boardroom | #9e9e9e | 0.01 | None (Anomaly barred) |
| Server | #410066 | 0.04 | The Backup Daemon |
| Clinic | #5c5c5c | 0.03 | None (Anomaly barred) |
| Maintenance | #572503 | 0.08 | The Sentry Cone |
| Incinerator | #cc7533 | 0.13 | The Incinerator Entity |
| Chasm | #191d71 | 0.12 | None (Anomaly barred) |
| Atrium | #212121 | 0.08 | The Claw |
| Annex | #ffffff | 0.005 | None (Anomaly barred) |
| Exit | #332525 | 0.03 | The Anomaly (default) |
| Checkpoint | #636363 | 0.02 | None (Anomaly barred) |
| Acme | #3c475d | 0.06 | None (Anomaly barred) |
Fog values come from the SECTORS registry in src/world/Sectors.js; the resident
entity comes from src/entities/EntityManager.js. A sector with no mapped entity falls back
to the roaming Anomaly, which keeps out of every sector that does not set anomalyAllowed.
Values are read from the SECTORS registry in src/world/Sectors.js and the entity
table in src/entities/EntityManager.js. Sectors without a resident entity lean on the
roaming Anomaly.
Normal : The Mono-Yellow Corridors
The foundational starting environment of Level 0. Damp wallpaper, musty carpet, buzzing 60Hz fluorescent tubes, and sprawling standard halls that connect the complex.
Acts as the default cell archetype in SectorPlacement.js. Synthesizes procedural carpet and wallpaper textures via ProceduralTextureFactory.js. Integrates StandardHall, AlcoveCorner, and Duct blueprints.
Provides the iconic liminal reference point. Its visual monotony lulls the player into disorientation, making sudden transitions into hazardous sectors jarring and terrifying.
Archive : The Paper Labyrinth
Dense stacks of metal document shelves rising to the ceiling, sorting tables, and scattered case files under dim, sepia-toned dust fog.
Instantiates ArchiveSector.js, injecting high-density document spawn hooks into NarrativeProps.js. Muffles high frequencies via AcousticEngine to mimic paper sound absorption.
The primary research hub. Contains crucial cold-case documents, but tight sightlines and rustling paper make evading the sound-sensitive Archivist treacherous.
Atrium : Vertical Courtyards
Expansive three-story courtyards with skylight grids, concrete balconies, and central elevator shafts that puncture the endless low-ceiling claustrophobia.
AtriumSector.js clears ceiling cells across a 4×4 chunk footprint, placing modular perimeter balconies and open railings. AcousticEngine maximizes reverb time to 3.8 seconds.
Offers sudden scale shock. Wide visibility gives false safety, but footstep echoes carry across great distances, alerting distant predators across multiple floors.
Exit : The Subterranean Bunker
Heavy blast bunker containing the Inquest Terminal, staff ephemera, and the locked industrial hoist elevator to the surface.
ExitSector.js generates a sealed bunker sealed behind a reinforced blast airlock. Activates only when all surge breakers are thrown, orienting the Threshold Compass directly to its coordinates.
Acts as the climatic culmination of the gameplay loop, requiring physical maze traversal, evidence collation, and PIN deciphering.
Annex : Sterile Corporate Offices
A blindingly sterile corporate wing featuring modular office quadrants, desks, filing cabinets, water coolers, and fluorescent lighting under whisper-thin white fog.
Instantiates AnnexSector.js. Configures fog: 0.005, fogColor: 0xffffff, ambient: 0.38, and lightIntensity: 2.3. Generates quadrant floorplans with partitioned desk clusters (quadrantPools) and low-reverb acoustic profiles (rt60: 0.35s, wet: 0.08).
Psychological subversion: shifting from dingy mono-yellow corridors into clinical, spotless white spaces induces uncanny corporate dread while providing a temporary haven from roaming entities.
Acme : The Endless Vertical Scaffolding
A dizzying 40-meter-tall abyss of suspended industrial catwalks, rusted ladders, hanging caged incandescent bulbs, and driving rain illuminated by sporadic distant lightning strikes.
Generated via AcmeSector.js. Leverages multiLevelMaze: 40, voidCeiling: {y: 100000}, voidFloorY: -100000, and bottomlessRescue: true. Spawns tiered metal platforms (ACME_LEVEL_SPACING = 1.2m), vertical access ladders, hanging cage lights (ACME_HANGING_LIGHT_CHANCE = 0.5), and vertical rain particles (dust.rain: true, driftY: -0.18).
Replaces horizontal claustrophobia with acute acrophobia. Vertically stacked navigation punishes missteps with dizzying falls caught by bottomless rescue safety nets while echoing footsteps across wide open gulfs.
Boardroom : Executive Suites
Spacious executive conference suites featuring polished tiled flooring, long walnut boardroom tables, swivel chairs, and glass partition perimeters.
Executed by BoardroomSector.js. Sets fog: 0.01, fogColor: 0x9e9e9e, ambient: 0.29, and lightIntensity: 3.0. Builds transparent glass perimeter boundary walls (ctx.buildPerimeter) and places modular boardroom conference furniture from OfficeFurniture.js.
Creates high visibility yet physically partitioned sightlines. Players can see items across suites through glass, but navigating perimeter doorways forces convoluted spatial routing.
Chasm : The Deep Abyss Catwalks
Narrow cantilevered steel gangways and open gratings spanning a pitch-black subterranean trench, veiled in deep blue fog with floating luminescent abyss dust.
Handled by ChasmSector.js. Sets voidFloorY: -100, voidCeiling: {y: 9}, and hallwayNeedsFloor: true. Uses fog: 0.12, fogColor: 0x191d71, ambient: 0.51, and expansive reverb (rt60: 4.5s, predelay: 0.085s, wet: 0.38). Floating upward dust motes are tinted 0x2288ff.
Combines sensory isolation with acoustic disorientation. Footsteps resonate for over 4.5 seconds into the deep void, masking spatial awareness while demanding careful footing on narrow catwalks.
Checkpoint : Security Screening Gates
Heavy security border checkpoint with metal detector arches, mechanical turnstiles, chain-link containment pens, and inspection staging tables under cold grey overhead tubes.
Constructed by CheckpointSector.js. Applies fog: 0.02, fogColor: 0x636363, ambient: 0.43, and harsh acoustic resonance (oscFreq: 800Hz, filterFreq: 2000Hz). Intersperses turnstile barriers and metal railings across primary transit corridors.
Acts as a structural bottleneck that slows sprint traversal and forces players through narrow choke points, building dread of geometric containment.
Clinic : Abandoned Sanitarium
Decaying institutional medical wards lined with examination curtains, hospital gurneys, IV drip stands, surgical lighting rings, and medicine cabinets under dim clinical grey fog.
Invokes ClinicSector.js. Uses fog: 0.03, fogColor: 0x5c5c5c, ambient: 0.1, and groundColor: 0x000000. Populates procedural rooms with specialized props from ClinicFurniture.js (gurneys, surgical stands, IV carts) with high-pass foley filters (oscFreq: 800Hz, filterFreq: 3000Hz).
Deepens psychological horror through clinical sterility and decay. High-frequency footsteps and squeaking wheel casters amplify tension in dimly lit treatment rooms.
Impound : High-Ceiling Containment Pens
Looming 20-meter-tall warehouse enclosure divided into chain-link holding pens, contraband shelving, and towering searchlight towers under mustard-brown dust fog.
Built via ImpoundSector.js. Configures ceilingHeight: 20, maxCamY: 20, fog: 0.09, fogColor: 0x433d3d, and lightColor: 0xead91f. Deploys env.fenceGeoX (FENCE_H = 1.8m) for see-through cage walls, monitored by WardenEntity.js.
Replaces solid corridor walls with see-through chain-link fencing. Players maintain constant visual contact with the patrolling Warden, but must frantically navigate fence mazes to find gate openings.
Incinerator : The Smoldering Blast Furnace
Scorch-marked blast furnace corridors filled with glowing ember exhaust, fiery orange fog, heated ventilation shafts, and zero ambient light.
Executed by IncineratorSector.js. Applies fog: 0.13, fogColor: 0xcc7533, ambient: 0.0, and dense particle exhaust (exhaust.opacity: 0.95, pulseRate: 24.0). Drives dynamic screen heat-haze post-processing and stamina drain while spawning the thermal IncineratorEntity.js.
Extreme environmental pressure: pitch-black corners, blinding orange light sources, and thermal stamina degradation make sustained exploration dangerous.
Maintenance : Industrial Utility Conduits
Grimy subterranean utility corridors with exposed pipe clusters, floor drainage channels, concrete blast baffles, and high-voltage surge breaker podiums under rust-colored fog.
Generated by MaintenanceSector.js. Configures fog: 0.08, fogColor: 0x572503, and ambient: 0.41. Spawns BreakerPodium.js units that trigger chunk blackout cascades when thrown, patrolled by the trip-wire activated SentryConeEntity.js.
Serves as the interactive core of the facility power grid. Throwing breakers is mandatory to restore power to exit locks, but plunges corridors into absolute darkness and awakens sentry hazards.
Server : Cold-Aisle Data Vaults
Chilled data center aisles lined with towering black server racks, pulsating cyan LED arrays, sub-floor cooling vents, and high-pitched electrical whine under deep purple fog.
Created by ServerSector.js. Uses fog: 0.04, fogColor: 0x410066, ambient: 0.12, cyan exhaust vents (0x00ffcc), and high-whine acoustics (whine: 0.002). Patrolled by the high-voltage BackupDaemonEntity.js.
Rhythmic machine hums and flashing server rack status lights mask entity movement sounds, while narrow cold aisles create tense line-of-sight ambushes.
📐 Structural Blueprints (30 Systems · 30 Written)
Blueprints are modular architectural variations placed inside open maze cells. Every blueprint lives in src/world/blueprints/ and is registered with strict probability weights summing to 1.0000 in StructuralBlueprints.js.
| Blueprint | Registered probability |
|---|---|
| BlockyObstruction | 0.0873 |
| LCornerNook | 0.0842 |
| CrawlspaceDuct | 0.0749 |
| HingedDoorway | 0.0749 |
| Crates | 0.0740 |
| TheObserver | 0.0608 |
| OfficeAmenities | 0.0514 |
| AlcoveCorner | 0.0468 |
| RoundAlcove | 0.0468 |
| RandomPillar | 0.0441 |
| PipeCluster | 0.0434 |
| SplitWallBurst | 0.0414 |
| SteppedBurst | 0.0414 |
| Duct | 0.0375 |
| NarrowHeaderGap | 0.0375 |
| Vent | 0.0375 |
| CreviceNetwork | 0.0301 |
| CurvedArchway | 0.0261 |
| PartitionHeader | 0.0187 |
| RoundPillar | 0.0187 |
| WideHeaderGap | 0.0094 |
| AnomalousPointOfInterest | 0.0088 |
| WreckedFurniturePile | 0.0019 |
| TheFaradayCage | 0.0014 |
| SettlingField | 0.0010 |
| ArchHall | 0.0000 |
| CrawlspaceHall | 0.0000 |
| CreviceHall | 0.0000 |
| EmptyDoorFrame | 0.0000 |
| RideQueueHall | 0.0000 |
Weights are copied from each profile in src/world/blueprints/, and P1-07 asserts that they sum
to 1.0000. A 0.0000 weight means the blueprint is never chosen by the weighted
roll. All thirty structural blueprints link to their detailed entries below.
ArchHall : Vaulted Arch Hallway
Replaces plain rectangular corridors with an elegant, vaulted plaster archway adorned with ceramic subway border tiling and recessed overhead fixtures.
Constructed in ArchHall.js with walking bounds from StructureKit.js (ARCH_WALK_CLEARANCE) and subway border styling from ArchBorderMats.js.
Breaks visual monotony without altering collision boundaries, indicating transitional conduits between commercial and industrial sections.
CrawlspaceDuct : Low-Clearance Conduit
A cramped metal conduit dropping ceiling height to 1.1 meters, forcing the player to compress (`Q`) to squeeze through.
Generates low horizontal ceiling panels and registers a low bounding box in SpatialHashGrid. Prevents player traversal unless camera height is crouched.
Induces severe claustrophobia while serving as an escape choke-point against larger entities that cannot fit through the aperture.
TheFaradayCage : Copper Sanctuary
A rare copper-clad refuge room with a green CRT terminal, a flickering overhead fixture, and a spatial blocker that keeps entities out.
Walls one cell in 0.4-thick copper, leaving a single 1.2-wide opening, then inserts a full-cell, 3 m-tall isEntityBlocker box into env.spatialGrid so entity pathing cannot enter.
Provides critical psychological contrast: true relief only exists when the threat outside is absolute.
AlcoveCorner : Recessed Corner Seating
Insets standard corridor corner walls to create a recessed square waiting nook, frequently holding an office chair or side table.
Defined in AlcoveCorner.js. Replaces flat corner wall geometry with recessed back and side panels (back, side), adding chairs via ctx.buildChair.
Breaks up monotonous hallway turns, providing small blind hiding niches and natural document pickup locations.
AnomalousPointOfInterest : Narrative Relic Shrine
An ominous focal chamber with a raised display pedestal bathed in accent lighting, holding crucial narrative clues and anomalous case relics.
Built in AnomalousPointOfInterest.js. Constructs display walls with userData.isEntityBlocker = true and registers the coordinates in environment.pointsOfInterest for cold-case dealing.
Acts as a primary narrative milestone: the visual magnetism of glowing relics draws players into dead-end chambers that require high vigilance.
BlockyObstruction : Stepped Wall Baffle
Heavy rectangular blocks of concrete and drywall protruding into the hallway, constricting walkable width and breaking straight lines of sight.
Engineered in BlockyObstruction.js. Extrudes staggered block geometries (block1, block2) with userData.isEntityBlocker = true into the corridor clearance.
Forces zigzagging movement, preventing players and entities from sprinting in uninterrupted straight lines.
Crates : Industrial Freight Pallets
Stacks of wooden and metal freight cargo crates piled along corridor walls, providing partial visual cover and waist-height obstacles.
Implemented in Crates.js. Assembles multi-tier crate clusters with physical spatial blockers (longWall, shortWall with isEntityBlocker = true).
Introduces warehouse clutter to corporate hallways, creating tactical cover for evading roaming entity line-of-sight.
CrawlspaceHall : Extended Low-Clearance Hall
A full corridor cell whose ceiling drops to 1.1 meters across the entire hall, requiring continuous crouching (`Q`) to traverse.
Defined in CrawlspaceHall.js. Spawns a full-cell lowered ceiling slab (dropHeight) with isEntityBlocker = true to enforce crouch collision limits.
Drastically reduces player mobility and speed, creating high-tension escape bottlenecks that larger entities cannot enter.
CreviceHall : Vertical Fissure Hallway
A tight corridor segment compressed by encroaching concrete walls into a narrow 0.65-meter vertical slit that requires careful sideways alignment.
Authored in CreviceHall.js. Sets CREVICE_GAP = 0.65 between opposing wall blocks, setting mesh.userData.isEntityBlocker = true.
Generates extreme spatial friction that disorients players while completely barricading pursuit by wide entity bounding boxes.
CreviceNetwork : Interconnected Fissure Web
A branching multi-cell network of fractured drywall crevices that forms an alternate transit crawlway parallel to main corridors.
Constructed via CreviceNetwork.js. Chains multiple narrow crevice fissures across neighboring chunks, creating non-Euclidean shortcuts between disconnected hallways.
Rewards observant players with alternate evasion routes that bypass hazardous sector choke points.
CurvedArchway : Plaster Barrel Arch
A smooth curved plaster barrel archway spanning the upper ceiling of a hallway opening, softening sharp rectangular corners.
Created in CurvedArchway.js. Uses buildArchCutout to generate curved drywall arches with noCollision = true on overhead trim.
Softens brutalist corridor geometry, indicating transitional portals into administrative or medical wings.
Duct : Overhead HVAC Trunk
Industrial galvanized sheet-metal air ducts suspended along ceilings and dropping into wall conduits with seamless subway tile trim.
Implemented in Duct.js. Builds 8–10 modular duct segments per branch with archBorderMats, ductLiningMat, and structural blockers.
Creates architectural realism and ceiling clutter that casts intricate shadows from overhead fluorescent lights.
EmptyDoorFrame : Open Door Jamb Casing
A hollow door casing framing corridor passages without a door panel, establishing doorway thresholds without obstructing movement.
Generated in EmptyDoorFrame.js. Creates jamb uprights and a lintel span (spanOf(-0.7, -1, leftW)) with isEntityBlocker = true on side jambs.
Rhythmically structures long continuous corridors, signaling room boundaries without impeding high-speed sprint escapes.
HingedDoorway : Interactive Operable Door
A functional swinging wooden office door mounted on a pivot hinge that players can open, close, or push through (`E`).
Engineered in HingedDoorway.js. Instantiates a rotatable door leaf on a pivot hinge with angular limits, updating spatial hash blocking dynamically upon toggle.
Provides critical tactical utility: closing doors breaks entity line-of-sight and buys vital seconds to slip away into side rooms.
LCornerNook : Blind Corner Recess
An L-shaped recessed niche carved into corridor corners, creating a blind hiding pocket and occasional furniture spawn location.
Defined in LCornerNook.js. Constructs offset wall blocks (w1, w2) that form an indented corner with optional desks and chairs.
Adds psychological tension to corner navigation by concealing what lies around the bend until the player steps past the threshold.
NarrowHeaderGap : Low Transom Lintel
A dropped horizontal beam spanning between hallway piers, leaving only a narrow letterbox gap between beam and ceiling.
Built in NarrowHeaderGap.js. Assembles side piers (p1, p2) supporting an overhead lintel (top) below ceiling height.
Restricts vertical head sightlines, directing player attention down to floor-level narrative documents and footprints.
OfficeAmenities : Corporate Breakroom Clutter
Breakroom amenities scattered along corridor walls, including water cooler bottles, filing cabinets, and upholstered executive couches.
Implemented in OfficeAmenities.js. Integrates furniture spawners from OfficeFurniture.js (including buildCouch and filing cabinets) against wall offsets.
Deepens environmental storytelling: the sudden appearance of familiar office comforts in an alien labyrinth heightens the liminal dread.
PartitionHeader : Suspended Ceiling Divider
A suspended ceiling transom beam that segments long halls into visual bays without obstructing floor-level traversal.
Authored in PartitionHeader.js. Spans two wall piers (p1, p2) connected by a central overhead beam (header) near ceiling height.
Breaks acoustic and visual repetition along expansive corridors, providing rhythmic spatial punctuation.
PipeCluster : Vertical Conduit Bundle
A vertical cluster of metallic conduit pipes and utility plumbing running along corridor corners with industrial brackets.
Defined in PipeCluster.js. Spawns parallel cylindrical pipe meshes with wall mounting supports, casting realistic hard shadows.
Signals proximity to utility hubs and adds high-frequency visual detail to corners.
RandomPillar : Central Load-Bearing Column
A massive square concrete pillar planted in the center of a corridor intersection, splitting foot traffic around it.
Created in RandomPillar.js. Spawns a solid pillar mesh in the cell center using buildWall, registering complete collision occlusion.
Enables cat-and-mouse circling tactics: players can loop around the central pillar to break entity line-of-sight.
RideQueueHall : Serpentine Barrier Chute
An unsettling corridor segment lined with alternating barrier walls that force winding, serpentine queue line navigation.
Engineered in RideQueueHall.js. Erects staggered barrier partitions (w1, w2 with isEntityBlocker = true) forcing a serpentine route.
Evokes eerie theme park queue nostalgia while creating high-panic escape mazes during an entity chase.
RoundAlcove : Curved Wall Niche
A semicircular hollow niche smoothly scooped out of a corridor wall with curved baseboard molding and a single chair.
Defined in RoundAlcove.js. Assembles curved blocks using buildCurvedCornerBlock and addCurvedAlcoveBaseboard, placing seating inside.
Contrasts the rigid rectilinear maze layout with organic curves, drawing players toward its sheltered interior.
RoundPillar : Cylindrical Support Column
A smooth cylindrical concrete pillar placed in hallway centers, offering rounded collision deflection.
Built in RoundPillar.js. Spawns a radial column using buildCylinder with smooth normal shading and cylindrical collision bounds.
Allows fluid player deflection without getting snagged on sharp geometry corners during sprint turns.
SettlingField : Micro-Structural Failure Zone
A rare zone of structural decay featuring fallen acoustic ceiling tiles strewn across the carpet, gaping ceiling holes, and creaking timber audio.
Engineered in SettlingField.js. Spawns fallen tile meshes (BoxGeometry(0.9, 0.04, 0.9)) on the floor, replaces ceiling cells with ceilingHoleMat and rottedTileMat, and triggers structural groan foley.
Shatters the illusion of a static, indestructible maze by suggesting the facility is slowly collapsing under its own weight.
SplitWallBurst : Fractured Wall Outthrust
A ruptured wall segment split down the center and pushed outward into the hallway as if deformed by immense lateral pressure.
Defined in SplitWallBurst.js. Splits standard wall spans into displaced protruding blocks (block1.userData.isEntityBlocker = true).
Implies violent non-Euclidean tectonic shifts or entity breaches occurring behind the wallpaper.
SteppedBurst : Terraced Wall Blowout
A progressive stepped drywall blowout that extends outward into the hall in stair-step terraces.
Created in SteppedBurst.js. Steps wall geometry progressively outward using staggered blocks (side1, side2) with solid collision.
Creates jagged perimeter cover that breaks line-of-sight along corridor edges while mimicking progressive shear failure.
TheObserver : Surveillance Aperture
A sinister high-mounted wall fixture featuring a dark, pupil-like lens aperture that appears to orient toward passing players.
Implemented in TheObserver.js. Inserts an elevated camera housing with centered dark lens geometry (isEntityBlocker = true) angled toward corridor traffic.
Stirs acute paranoia of omnipresent institutional observation in the absence of living personnel.
Vent : Air Return Louver Grille
A stamped metal air return grille mounted on corridor walls that emits soft, continuous airflow sounds.
Authored in Vent.js. Insets a louvered metal intake texture into standard wall cells (annotated with isDefaultWall = true), playing localized airflow audio.
Adds acoustic ambient depth that partially masks quiet distant entity movement.
WideHeaderGap : Elevated Transom Void
A broad horizontal header lintel hung below the ceiling, opening a wide void into the darkness above.
Defined in WideHeaderGap.js. Erects side piers (p1, p2) supporting a dropped horizontal lintel (top), leaving a wide open slot above.
Reveals hints of the dark infrastructure above the drop ceiling, teasing hidden vertical scale.
WreckedFurniturePile : Improvised Barricade
A chaotic roadblock of smashed desks, overturned filing cabinets, and splintered chairs completely choking off a hallway passage.
Engineered in WreckedFurniturePile.js. Clusters randomized office furniture meshes with dense collision bounding volumes, completely sealing the corridor cell.
Environmental storytelling: evidences desperate human resistance against entities and blocks retreat routes during chases.
👁️ Entities & Hazards (8 Systems · 8 Written)
Entities are autonomous hazards managed by EntityManager.js. They use preallocated scratch vectors, raycast line-of-sight checks, and acoustic hearing models.
Anomaly : The Roaming Predator
The primary horror force of Level 0. Roams the facility hunting by sound. Freezes while lit by the flashlight at close range, but builds rage the longer it is observed, which makes it faster once the beam drops.
- Sensory Model: Calculates player noise levels against hearing distance. Exhaustion and sprinting amplify detection ranges.
- Cone Check: Compares the camera's forward vector against the direction to the entity. With the flashlight on, clear line of sight, distance under 25 m, and a dot product above 0.85, velocity is set to zero.
- Aberration FX: Drives dynamic post-processing shaders (scanlines, vignette, chromatic aberration) proportional to proximity.
Creates heart-pounding staredowns where looking directly at death keeps you alive, until your battery begins to die.
SurgeBreaker : High-Voltage Power Lever
Breaker podiums in Maintenance. Throwing one opens the podium's door and blacks out its chunk, dropping the corridors fed by that circuit into darkness.
InteractionController.triggerBreaker() opens the podium door, adds the chunk hash to env.blackoutChunks, and fires the somatic-breaker event. Inside Maintenance a randomized 25–35 second timer restores power to that chunk.
Forces the player to choose between progression and visibility, transforming familiar hallways into pitch-black hunting grounds.
Archivist : The Sound-Sensitive Paper Scribe
A floating spectral entity with translucent violet wings and trailing parchment motes that silently stalks the Archive sector aisles, homing in on footsteps and paper handling.
Managed by ArchivistEntity.js. Features an icosahedron core (0xfff2d6), dual additive-blended planar wings (0xaa55ff), and orbital paper motes. Monitors player movement speed and document interactions in NarrativeProps.js. Upon hearing noise above threshold, glides directly toward the acoustic disturbance vector.
Inverts horror pacing in the primary lore gathering sector: sprinting or hastily grabbing evidence alerts the Archivist, forcing players to slow down, crouch, and navigate metal stacks in silence.
BackupDaemon : High-Voltage Predictive Stalker
A crackling cyan electrical orb orbiting overhead cable trays in the Server sector that zaps conduits, predicts player heading, and discharges lethal electrical shard bursts.
Implemented in BackupDaemonEntity.js. Assembled with an icosahedron core (0x8ff2ff), 5 orbital tetrahedron sparks, and a point light (intensity 0.7, range 4.5m). Calculates player trajectory (_predicted) and teleports between ceiling cable runs (_litCables), deploying shard explosions via ShardParticles.js.
Counters sprint-fleeing behaviors. Because it tracks forward velocity and intercepts future waypoints, running blindly into server cold-aisles leads straight into high-voltage ambush points.
Claw : The Industrial Ceiling Gantry
A massive four-pronged motorized steel claw suspended from a 10-meter hydraulic ceiling shaft that tracks players across Atrium courtyards and drops silently from above.
Driven by ClawEntity.js using a finite state machine (IDLE → WARNING → DROP → SNAP → ASCENT). Constructed with a steel housing (0.8×0.4×0.8m), a 10-meter dark metal piston (CylinderGeometry), and four articulated prongs. Uses isRayPathBlocked to verify clear vertical clearance before dropping.
Forces vertical vigilance. In the cavernous Atrium where horizontal sightlines appear safe, lingering in open central spaces risks instant mechanical capture from the ceiling rafters.
IncineratorEntity : The Molten Core Predator
A blazing thermodynamic horror of superheated embers and molten slag that aggressively chases players while radiating debilitating heat through furnace corridors.
Instantiated in IncineratorEntity.js. Employs resolveEntityLocomotion with stuckStrategy: 'teleport' (stuck limit 2.0s, teleport distance 15m) and raycast line-of-sight tracking. Radiates dynamic heatLevel that saps player sprint stamina and distorts camera optics via heat-shimmer shaders.
Imposes severe environmental pressure: players cannot engage in prolonged chases because the entity's thermal radius rapidly exhausts their somatic stamina reserves.
SentryCone : Tripwire Construction Hazard
A dormant reflective construction pylon that comes alive when bumped or when Maintenance breakers trip, pursuing the player with frantic, jittering mechanical speed.
Governed by SentryConeEntity.js. Wakes via maintenance-cone-tipped or maintenance-power-restored events. Pursues at CHASE_SPEED = 4.2 m/s with TURN_RATE = 7.0 rad/s. Employs a multi-tiered angular steering obstacle avoidance array (STEER_TIERS = [0.35, 0.7, 1.05, 1.4, 1.75, π]) to navigate pipe networks.
Transforms mundane environmental dressing into lethal threats. Players learn to fear routine debris and exercise caution when sprinting around blind utility bends.
Warden : The Monolithic Juggernaut
A towering 4-meter-tall armored brute patrolling Impound holding pens. Smashes through chain-link gates and causes somatic screen rumble with every ground-shaking footstep.
Authored in WardenEntity.js. Uses a dark steel mesh silhouette (MeshStandardMaterial, color 0x14161a). Navigates using resolveEntityLocomotion with a wide bounding radius (boxRadius: 0.8m) and stuckStrategy: 'jitter', breaking through thin fence gates with physical collision impulse.
Commands overwhelming physical intimidation. Because cage fences provide transparency without physical protection, players feel constantly exposed and hunted across open pens.
🔦 Survival Equipment & Tools (4 Systems · 4 Written)
Flashlight : Kinetic Dyno-Lantern
Heavy handheld lantern casting a narrow spot beam. Recharged mechanically by sprinting or shaking the camera view.
Flashlight.js monitors player displacement and camera delta rotations in SomaticInput.js, adding charge units up to the paranoia battery ceiling.
Transforms illumination into active resource management. Running out of light in Level 0 is a death sentence.
Compass : The Threshold Magnetometer
A brass handheld compass raised with `M`. Its needle points toward the nearest unvisited macro-sector blast door, or towards the Exit Bunker.
Calculates the heading vector toward nearest sector coordinates extracted from SectorPlacement.js and rotates the 3D needle mesh smoothly.
Prevents players from getting hopelessly lost in an infinite fractal while preserving diegetic in-world navigation.
PaintballGun : Luminescent Marking Pistol
A handheld pneumatic marker that fires high-visibility fluorescent paintballs against walls and floors, leaving permanent glowing splatters to map routes and airlocks.
Managed jointly by src/player/PaintballGun.js and src/entities/PaintballSystem.js. Toggled via somatic-toggle-gun (stows flashlight and compass). Projectiles are simulated via SphereGeometry(0.04m) and raycast intersection, spawning permanent CircleGeometry(0.15m) decal splatters aligned to hit surface normals with high-contrast fluorescent palettes.
Essential cognitive anchor: in infinite mono-yellow corridors with identical wallpaper, marking junction walls is the player's only reliable bulwark against running in circles.
PDAJournal : Cold-Case Dossier Viewer
An electronic journal opened with `J` that collates recovered case files, autopsy transcripts, memos, and puzzle clues into a split-screen retro terminal.
Implemented in src/ui/JournalViewer.js. Responds to somatic-journal-toggle. Pulls discovered documents from StoryEngine, renders a chronological document list on the left and a typewriter-rendered content pane on the right, accompanied by acoustic paper foley.
Bridges procedural exploration with narrative resolution: collating scattered clues from distinct sectors is required to deduce the three-part Inquest PIN at the Exit Bunker.
🎛️ Developer Tools & Tuners (7 Systems · 7 Written)
AtmosphereTuner : Live Volumetric Tuner
Live in-game UI displaying sliders for fog near/far distances, fog colors, and atmospheric drag, with a button to save values directly to Sectors.js.
Modifies active THREE.Fog instances in real-time. Dispatches JSON payloads to /save-atmosphere on engine_server.js which regex-updates the source file.
Enables instant artistic iteration on horror lighting and fog moods without stopping the dev server or reloading the browser.
LightTuner : Real-Time Light Parameter Tuner
In-game debug HUD panel displaying live controls for point light intensities, colors, ranges, shadow radiuses, and rect-area light levels.
Defined in src/ui/LightTuner.js via SectorTunerFactory.js. Listens for KeyL in debug mode. Updates lighting uniforms in real-time and POSTs updated configs to /save-light on engine_server.js to regex-patch Sectors.js.
Allows lighting designers to calibrate horror lighting temperatures, bulb dropoff ranges, and shadow softness directly inside running scenes without server restarts.
SectorTunerFactory : Debug Tuner Metaprogramming
The unified architectural engine powering both AtmosphereTuner and LightTuner, handling input binding, change diffing, and source serialization.
Located in src/ui/SectorTunerFactory.js. Takes a schema specifying DOM inputs, keycodes, and target field names. Takes an initial snapshot of active sector parameters, binds input listeners to mutate live Three.js uniforms, and serializes clean JSON patches to dev endpoints.
Eliminates boilerplate duplication between visual tuning tools while ensuring zero runtime allocation overhead in production builds.
DebugHUD : Engine Telemetry Overlay
A green monospace heads-up display rendering live FPS, draw calls, triangle counts, seed hashes, active coordinates, camera positions, and Anomaly AI state.
Engineered in src/ui/DebugHUD.js. Toggled via backtick (`). Samples renderer.info.render (calls, triangles), tracks frame delta hitch spikes (recordFrame if Δ > 0.05s), and displays the active Anomaly's mood, stamina, interest percentage, and distance. An OPEN line shows the opening's timing marks on a new run (control, door, exit, sighting, first breaker, first threat).
Provides ground truth for performance profiling and entity state verification during headless Playwright smoke tests and browser optimization runs.
SectorWarp : Spatial Teleport & Hunt Cheats
Developer cheats that instantly teleport the player between macro-sector zones or execute automated spiral chunk searches to locate any chosen sector on the current seed.
SomaticInput.js fires somatic-teleport-zone on `Z` in debug mode. In addition, the settings panel dropdown (#sectorHuntSelect) runs SectorHunt in main.js, querying SectorPlacement.js chunk coordinates in an expanding spiral, flushing the streaming pipeline, and warping the camera directly into the target zone.
Eliminates hours of manual maze wandering during QA and automated regression testing, allowing direct verification of distant sectors and exit conditions.
LoreCoverageAPI : Narrative Balance Diagnostics
A diagnostic endpoint and Lore Editor report calculating total available lore documents, clues, and foreshadowing entries against procedural generator placement capacity.
Authored in lore-editor/coverage.js and served via /api/coverage in lore-editor/editor_server.js. Statically aggregates document pools in data/ per sector and flags pools risking narrative starvation or repetitive fallbacks.
Ensures procedural generator yields never outstrip hand-authored narrative content, maintaining high story density across all 14 sectors.
SourceSaveEndpoints : Dev Server File-Writing Endpoints
Development-only HTTP endpoints in engine_server.js that receive JSON payloads from in-game tuners and rewrite source files on disk.
Exposes POST /save-atmosphere and POST /save-light (which apply regex updates directly to src/world/Sectors.js) and POST /export (which safely writes base64 canvas snapshots to assets/textures/ with path traversal guards).
Closes the loop between in-game visual calibration and persistent repository source code, turning the live engine into its own level editor.