atmos.module
README.md
atmos
The station's own life, with nothing visible in it: the soundscape, the dust hanging in the air, the emergency lighting that fails and comes back.
Everything is spawned in play from init.luau under atmos_* names, so the
scene file stays the plan pass's and a reload never stacks a second copy. The
light components the scene already carries are driven in place — never rebuilt.
Sound (game/audio/*.soundClip, all heard through the AudioListener on the player camera)
| what | how | where it comes from |
|---|---|---|
| room tone | non-positional looping bed, never stops | everywhere |
| emergency alarm | looping, muffled, maxDistance 170 | down the tunnel mouth at (1, 4.2, −8) |
| the announcement | one shot every 44–62 s on two PA speakers | platform ceiling (6.6, 6.85, 26) and the stair (8, 6.5, 44) |
| water dripping | one shot every 2.5–8 s, pitched per hit | five ceiling leaks over the platform and the carriage roof |
| knocking | one shot every 16–38 s | the carriage door, the maintenance door, the evac shutter, and twice from the dark |
| footsteps that are not the player's | a short-lived spatial host at a random platform spot, every 20–42 s | along the platform, a few metres off |
| steel settling | one shot every 26–58 s | deep in the tunnel |
| work lamp hum | looping, follows the lamp's own brightness | the two sodium work lamps |
Dust
ambientDrift's dustMotes field — a lit particle field, so motes take
every lamp in reach and do not appear where no light falls. One field follows
the player camera (34 × 5.2 × 34 m), so the held torch is always full of dust;
standing fields give the platform, the carriage and the maintenance room depth
to look down. game/materials/ is not used yet: the field brings its own.
The failing lights
Every red downlight — the seven emergency_*, carriage_red, evac_light —
plus the dying tube in the maintenance room, runs its own failure clock: a
burst of stutter, then a slow filament ramp back up. Every 40–85 s the station
ring main browns out and all of them go together. The two sodium work lamps
stay lit and only wander a few percent.
What the cycle is doing is published to Core.state.atmos for anything that
wants to read it — emergency (0..1, the dimmest red lamp), flickering,
brownout, events, workLamp. Atmos.debug() reports the same from inside.
Contract
start(ctx), update(dt), onPlayer(player), stop(). Builds on the first
play-mode frame it sees; update wraps each half in pcall and warns, so it
never raises out.