district
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
district
<!-- 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.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2Lamplighter's Round — the district: the street, the terraces, and the fog. OWNED BY SLICE B (world-and-look). The district is a Victorian crossroads: two sixteen-metre streets meeting at a horse trough, kerbed pavements down every arm, and soot-blackened brick terraces stood along the building line. Nothing here is baked into the scene — every stone of it is spawned by `build()` on load and despawned with the `District` root, so the scene file stays the ten entities the planner wrote. The look is three procedural surfaces and one volumetric pass: * `art.wet_cobbles` — the road and the pavements, roughness varying stone to stone so the gaslight streaks instead of pooling. * `art.soot_brick` — the terraces, with their windows, sills, plinths and soot cut from world space so the lattice runs across a whole row. * `art.lamp_fog` — the fog, raymarched between the eye and the depth buffer, gathering the lamps' light out of the AIR. This is the slice: the light lives inside the fog rather than on top of it. The contract with the rest of the game: * `build()` registers exactly `Core.LAMP_COUNT` lamps with `Core.registerLamp(id, x, y, z)`; rules and the Pale read that registry, never this file's geometry. * it listens for `"lampLit"` and turns that lamp's mantle, its point light and its hold on the fog on together. * it never reads or writes round state; rules owns that.
box(name: string, px: number, py: number, pz: number, sx: number, sy: number, sz: number, material: string, mesh: string?) → void
| arg | type | description |
|---|---|---|
| name | string | |
| px | number | |
| py | number | |
| pz | number | |
| sx | number | |
| sy | number | |
| sz | number | |
| material | string | |
| mesh | string? |
solid(e: ?) → void
Anything the lamplighter must walk AROUND. A bare collider takes its extent from what is rendered, so this is the whole of it: the street becomes the only way through the district, which is what makes the round a round.
| arg | type | description |
|---|---|---|
| e | ? |
standing(name: string, px: number, top: number, pz: number, sx: number, sz: number, material: string, mesh: string?, footing: number?) → void
A box that STANDS on something: its top face is at `top`, and its base is carried well below whatever it stands on. Two horizontal faces at the same height shimmer against each other at a grazing angle — which is every angle a street is seen from — so nothing in the district is ever left resting exactly on the surface under it.
| arg | type | description |
|---|---|---|
| name | string | |
| px | number | |
| top | number | |
| pz | number | |
| sx | number | |
| sz | number | |
| material | string | |
| mesh | string? | |
| footing | number? |
pitchX(e: ?, degrees: number) → void
Rotation about the world X axis, in degrees. The roof slabs are the only thing in the district that is not axis-aligned.
| arg | type | description |
|---|---|---|
| e | ? | |
| degrees | number |
pitchZ(e: ?, degrees: number) → void
| arg | type | description |
|---|---|---|
| e | ? | |
| degrees | number |
rnd(seed: number) → number
A stable per-index random, so the district looks hand-varied and rebuilds identically every load.
| arg | type | description |
|---|---|---|
| seed | number |
buildStreet( ) → void
Pavements down the four arms plus the four corners of the crossroads, each kerbed on the side that faces the road.
buildHouse(tag: string, cx: number, cz: number, along: string, face: number, seed: number) → void
One house. `along` is the world axis the frontage runs along ("x" or "z"), `face` is which way it faces on the other axis (+1 / -1).
| arg | type | description |
|---|---|---|
| tag | string | |
| cx | number | |
| cz | number | |
| along | string | |
| face | number | |
| seed | number |
buildTerraces( ) → void
buildClutter( ) → void
What the district leaves lying about: barrels outside the public house, crates at the corners, a coal heap. Small, but an empty street reads as a backdrop and a cluttered one reads as a place.
buildSkyline( ) → void
Beyond the district: the rest of the city, which the fog only ever shows as a change in the grey.
buildTrough( ) → void
frameCamera( ) → void
checkSpawnIsClear( ) → number
buildRailings( ) → void
Area railings in front of the four houses that flank the crossroads. They are the thing that reads as wrought iron when a lamp rakes across them.
lampSites( ) → void
Nine posts: one at the crossroads and two down each arm, alternating sides so the round is a zig-zag and the dark between them is a real crossing.
buildLampPost(i: number, site: ?) → void
| arg | type | description |
|---|---|---|
| i | number | |
| site | ? |
pushLampsToFog( ) → void
Push the whole lamp registry into the fog pass. The shader takes nine `(x, y, z, power)` uniforms; power is 0 for a lamp still dark, which is the one compare that makes an unlit lamp free.
setupPostProcess( ) → void
teardownPostProcess( ) → void
setNight( ) → void
The night the round is walked in: a low cold moon and almost no fill, so the only warm light in the district comes out of the lamps.
skinGround( ) → void
The road is the scene's own `ground` entity — re-skinned, never respawned.
igniteLamp(index: number) → void
A lamp taking: the mantle stops being a dead glass box, the point light comes up, and the fog gets a new source to scatter.
| arg | type | description |
|---|---|---|
| index | number |
douseLamp(index: number) → void
Put a lamp back out: dark mantle, no flame, nothing in the fog.
| arg | type | description |
|---|---|---|
| index | number |
syncLampsToRegistry( ) → void
Bring every lamp's flame back in step with the registry. A round resets through Core, which clears the registry and emits no per-lamp event, so a district that only ever listens for "lampLit" carries the last round's nine burning lamps into the next one: the street looks fully lit while the game treats it as fully dark, Dread climbs under a lamp that is visibly alight, and the round is unreadable from the first second.
build( ) → void
start( ) → void
update(dt: number) → void
| arg | type | description |
|---|---|---|
| dt | number |
stop( ) → void
invalidate( ) → void
Entrypoint calls this before a rebuild so hot-reload does not stack geometry.
Sub-parts
Everything contained inside this part. Assets are composite children (clickable cards). Files are leaf payloads. Expand any row to view its source.
Problems
Everything affecting this asset right now: its own problems, anything wrong inside it, and problems on its direct dependencies.
agent_score is exposed.+ 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".
Scoped to this part · feeds back into the world's score.