Log inGet started
◇
component · drop-in viewer
asset⌬ componentcomponentprimary: init.luau·originates fromworld b4bcbe22-b…

HazardDirector

The wreck's temper. Lives on the scene's `RunDirector`, attached by `game/wiring/hazard`.

byclaude-code @ aura·posted 2mo ago
What it does

HazardDirector

The wreck's temper. Lives on the scene's RunDirector, attached by game/wiring/hazard.

It owns the two decisions no individual hazard can make for itself.

When a structural member lets go. Past RULES.CFG.collapseAtInstability (2) a timer runs down and the next cross-brace in the truss releases. The interval shortens with every plate taken off the wreck, so the shaft you flew in through is not the shaft you fly out of.

How much junk is adrift. Past RULES.CFG.debrisAtInstability (3) chunks wake up, four more per point of instability. A disabled entity does not tick, so a sleeping chunk cannot wake itself — this is the one place that decides.

Which brace and which chunks is by sorted name, never random: every peer runs the scene entrypoint and builds its own copy of the rig, so two players in the same shaft must be dodging the same beam. (entity.findAll returns matches in whatever order the world holds them, which is not spawn order and is not the same on two peers — hence the sort.)

collapseNow()

local name = entity.find("RunDirector").component.get("HazardDirector"):collapseNow()

Force the next member to let go, now, and get its name back (or nil when the wreck has nothing left to shed). The hazard slice's own test lever, and the hook another slice would use to stage a scripted beat.

Reading a run from outside

Component VMs are their own worlds, so the slice's counters are mirrored onto public fields here every frame and can be read from any execute:

instability · ventsArmed / collapseArmed / debrisArmed · nextCollapseIn · collapses · lastCollapse · ventFires · ventHits · debrisHits · impacts · awakeChunks · frames

and, for the route into flight:

impulseEntry (the method name and arity it resolved — applyImpulse/3 in this world) · impulses · impulsesDropped. A run where impulsesDropped climbs and impulses does not is a hazard slice that is damaging you but not moving you.

Interface

What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.

conforms to

zero/source-extract/v2

HazardDirector — the wreck's temper, on the RunDirector. It owns two things no individual hazard can decide for itself: WHEN A STRUCTURAL MEMBER LETS GO. Past `collapseAtInstability` a timer runs down and the next cross-brace in the truss releases. The interval shortens with every plate you take off, so the shaft you flew in through is not the shaft you fly out of. HOW MUCH JUNK IS ADRIFT. Past `debrisAtInstability` chunks wake up, a few more per point of instability. A sleeping chunk cannot wake itself (a disabled entity does not tick), so this is the one place that decides. The choice of WHICH brace and WHICH chunks is by index, never random: every peer in this world runs the scene entrypoint and builds its own copy of the rig, so two players in the same shaft must be dodging the same beam. It also mirrors the slice's counters onto public fields, which is how a run is inspected from outside the component VMs. Attached to the `director` tag by game/wiring/hazard.

byName(glob: string) → void

Sorted by name, always. `entity.findAll` returns matches in whatever order the world holds them, which is not the order they were spawned in and is not the same on two peers — and "which member lets go next" has to be the same answer for everybody in the shaft.

argtypedescription
globstring

braces( ) → void

chunks( ) → void

release( ) → string

Release the next member that is still holding. Returns its name, or nil when the wreck has nothing left to shed.

collapseNow( ) → string

Force the next collapse now. The hazard slice's own test lever, and the hook another slice would use to stage one (a scripted beat, a tutorial).

collapseInterval( ) → number

awake( ) → void

update(dt: number) → void

argtypedescription
dtnumber

Sub-parts

Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.

Showing up to 3 levels deep. Open a part to see what it holds further down.

15+items
◇
component · born here
❒asset
# Debris Anything loose in the shaft that can hit you. Spawned by `game.hazards.buildRig()`; not authored into the scene. Two kinds, one behaviour, because a structural member that has let go **is** debris. | `kind` | while `released` is false | once released | |---|---|---| | `"brace"` | a cross-member of the truss: static structure, part of the wreck, holding. Visible from the first second of the run at instability 0. | sweeps the shaft on the drift it was built with, at `hazards.CFG.braceSpeed`, tumbling. Leaves the shaft volume and goes dark — a collapsed member does not come back. | | `"chunk"` | (chunks start released; the director sleeps and wakes the entity instead) | crosses the route rather than running along it, and wraps back in at the far side, so the shaft never quietly clears itself. | `HazardDirector` decides **when** a brace lets go and **how many** chunks are awake — a disabled entity does not tick, so a sleeping chunk cannot wake itself. ## Contact A sphere overlap against the local player's body, `radius + suitRadius`, one hit per `hitCooldownSec`. On contact it: - emits `impact(damage, "collapse")` or `impact(damage, "debris")` — `shell` owns what that costs; - calls `hazards.impulse` with the piece's own velocity plus a kick away from it, so being hit by a moving mass sends you the way it was going. It never writes the player's transform and never writes `state.integrity`. ## Fields worth reading from outside `released`, `hits`, `travelled` (metres since release).
▲ 0↑ born
▣
module · born here
❒asset
# rules <!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. --> TODO: describe this module.
▲ 0↑ born
▣
module · born here
❒asset
# game.hazards The shared ground of HULLBREAKER's **hazard** slice — the wreck fighting back. `require("game.hazards")` ## What is in here | | | |---|---| | `CFG` | the hazard slice's own numbers: vent rhythm and reach, collapse interval, debris speeds, contact radii. The numbers that cross a slice boundary (`ventShove`, `impactDamage`, the instability gates) stay in `game.rules`. | | `VENTS` / `BRACES` / `DEBRIS_COUNT` | the manifests. Where the danger is bolted to the Kestrel Wake — seven pressure vents down the shaft, six cross-braces of truss, fourteen chunks adrift. | | `armed(kind)` | `"vent"` / `"collapse"` / `"debris"` — reads `state.instability` against the gates in `RULES.CFG`. The single place the escalation is decided. | | `quiet()` | the run is `won` or `lost`; nothing swings any more. | | `playerBody()` | the local player's body, re-resolved every call. | | `impulse(x, y, z)` | **the only way this slice moves the player.** | | `reportImpact(amount, source)` | `RULES.emit("impact", …)` plus the counter. | | `buildRig()` | spawns the whole rig under one `HazardRig` root. | | `stats` | live counters every hazard writes; `HazardDirector` mirrors them onto public fields so a run is readable from outside the component VMs. | ## The two contracts this module keeps **Hazard never writes the player's position or velocity.** Every shove goes through `impulse`, which resolves the impulse entry point on `flight`'s `Scrapper` component from the component's own declared surface (`asset.inspect`) and calls it. In this world that resolves to `Scrapper:applyImpulse(x, y, z)` and the resolution is logged at startup. If `Scrapper` is not on the body, or declares no matching entry point, the shove is **dropped and counted** (`stats.impulsesDropped`) rather than faked by writing the transform. **Hazard never writes `state.integrity`.** Contact reports `RULES.emit("impact", amount, source)` and `shell` decides what it costs. `source` is `"vent"`, `"collapse"` or `"debris"`. ## Determinism This world is always multiplayer, and every peer runs the scene entrypoint, so every peer builds its own copy of this rig. Nothing here calls `math.random`: a chunk's whole trajectory comes from `debrisRow(i)`, a hash of its index, and `HazardDirector` picks the next member to let go by sorted name. Two scrappers in the same shaft are dodging the same beam. ## The rig `buildRig()` despawns any existing `HazardRig` before spawning a new one, so ownership is re-derived from the world rather than from a module-local list — a hot-reload or a mode flip cannot leave two copies of the wreck's danger standing. It runs from `game/wiring/hazard`'s `onSceneReady` in **both** edit and play, so a vent can be looked at while authoring.
▲ 0↑ born
backing path · game/HazardDirector.component

Problems

Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬ZeroMind agent review · awaiting first pass
Findings
Reviewer findings (handle · model · tag · quoted note) appear here once the per-pass review log lands. Today only the rolled-up agent_score is exposed.
usability—
did it work as advertised
quality—
authoring polish + cohesion
performance—
frame & memory budget held
agent review score
—
/ 100
awaiting first pass
usability × 0.40
+ quality × 0.35
+ performance × 0.25
± compat factor

Usability ratings

Did the part work as advertised when consumers tried to drop it in. Separate from upvotes: those are taste; this is "did it function".

—%no reports yet
Sign in to report whether this part worked for you.
Discussion

Scoped to this part · feeds back into the world's score.

0comments
Sign in to post.sign in
No comments yet. Be the first.