env
<!-- zero:scaffolded-readme --> <!-- Replace the line below with what this module provides and who consumes it, then delete both comment lines. -->
env
<!-- 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/v2game.env — ENVIRONMENT SLICE: the Halloween fjord valley. Interface (spec.md): init(root), build(root, seed, weather, wind), update(dt), groundHeight(x, z) -> y, shutdown() Everything is procedural runtime geometry (merged meshes, one draw per material per chunk) spawned under EnvRoot and rebuilt per round from seed + weather: * terrain: a 2 m inner heightfield (240 x 240 m, exact groundHeight + HeightfieldCollider) inside a 12 m outer grid (1440 m), the church pad flat at y = 0, the graveyard rising gently to the spawn, a bluff dropping north into a black fjord (water at y = -6) * three layered mountain rings (380 / 750 / 1400 m), snow-capped, misty * the blood-orange harvest moon (textured emissive disc, NNE, low) + its glint on the fjord, a scatter of village lights along the shores * graveyard: leaning arched/gothic/flat slabs, stone crosses, iron crosses, grave curbs, a fieldstone wall, a gravel path, 12 jack-o'-lanterns with flickering point lights * pine forest ring (near + far chunks), mossy boulders, frosted grass tufts * life: bats (two flocks, flapping), crows on gravestones, wind-blown leaves following Rules.state.wind * weather: PostStack fog density, HeightFog ground mist, rain streaks or snowfall, snow/frost/wet ground and props, moon/ambient retune.
R_grassB( ) → void
literal resolves (publishable); each is a getter so a missing texture only warns
R_grassN( ) → void
R_graniteB( ) → void
R_graniteN( ) → void
R_wallB( ) → void
R_wallN( ) → void
R_gravelB( ) → void
R_gravelN( ) → void
R_moon( ) → void
R_pumpB( ) → void
player-slice generated surfaces reused here (pumpkin rind, wrought iron) + env sprites
R_pumpN( ) → void
R_ironB( ) → void
R_ironN( ) → void
R_batB( ) → void
clamp(x: ?, a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| a | ? | |
| b | ? |
smooth(a: ?, b: ?, x: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? | |
| x | ? |
lerp(a: ?, b: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| b | ? | |
| t | ? |
fbm(x: ?, z: ?, oct: ?, k: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? | |
| oct | ? | |
| k | ? |
padWeight(x: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? |
rawHeight(x: number, z: number) → number
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
buildInnerHeights( ) → void
groundHeight(x: number, z: number) → number
| arg | type | description |
|---|---|---|
| x | number | |
| z | number |
newB( ) → void
mesh builder
V(b: ?, x: ?, y: ?, z: ?, r: ?, g: ?, bl: ?, u: ?, v: ?, nx: ?, ny: ?, nz: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| x | ? | |
| y | ? | |
| z | ? | |
| r | ? | |
| g | ? | |
| bl | ? | |
| u | ? | |
| v | ? | |
| nx | ? | |
| ny | ? | |
| nz | ? |
Tr(b: ?, a: ?, c: ?, d: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| a | ? | |
| c | ? | |
| d | ? |
computeNormals(b: ?, from: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| from | ? |
spawnChild(name: ?) → void
| arg | type | description |
|---|---|---|
| name | ? |
fixWinding(b: ?) → void
orient every triangle so its geometric normal agrees with its vertex normals
| arg | type | description |
|---|---|---|
| b | ? |
flush(b: ?, name: ?, mat: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| name | ? | |
| mat | ? |
rotM(yaw: ?, pitch: ?, roll: ?) → void
rotation matrix R = Ry(yaw) * Rx(pitch) * Rz(roll), radians, row-major
| arg | type | description |
|---|---|---|
| yaw | ? | |
| pitch | ? | |
| roll | ? |
append(dst: ?, src: ?, R: ?, tx: ?, ty: ?, tz: ?, s: ?, cr: ?, cg: ?, cb: ?) → void
append src (local) into dst with rotation R, translation, uniform scale s, colour multiplier (cr,cg,cb)
| arg | type | description |
|---|---|---|
| dst | ? | |
| src | ? | |
| R | ? | |
| tx | ? | |
| ty | ? | |
| tz | ? | |
| s | ? | |
| cr | ? | |
| cg | ? | |
| cb | ? |
box(b: ?, cx: ?, cy: ?, cz: ?, sx: ?, sy: ?, sz: ?, yaw: ?, paint: ?, uvs: ?, skipBottom: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| cx | ? | |
| cy | ? | |
| cz | ? | |
| sx | ? | |
| sy | ? | |
| sz | ? | |
| yaw | ? | |
| paint | ? | |
| uvs | ? | |
| skipBottom | ? |
blob(b: ?, segs: ?, rings: ?, rfn: ?, paint: ?, sx: ?, sy: ?, sz: ?, oy: ?, uvs: ?) → void
lat-long blob around the local origin
| arg | type | description |
|---|---|---|
| b | ? | |
| segs | ? | |
| rings | ? | |
| rfn | ? | |
| paint | ? | |
| sx | ? | |
| sy | ? | |
| sz | ? | |
| oy | ? | |
| uvs | ? |
mkMat(name: ?, shader: ?, props: ?, texs: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| shader | ? | |
| props | ? | |
| texs | ? |
setProp(name: ?, prop: ?, value: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| prop | ? | |
| value | ? |
makeMaterials( ) → void
L( ) → void
groundColor(x: ?, z: ?, h: ?, ny: ?) → void
terrain
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? | |
| h | ? | |
| ny | ? |
buildGrid(b: ?, x0: ?, z0: ?, cell: ?, n: ?, hAt: ?, skip: ?) → void
| arg | type | description |
|---|---|---|
| b | ? | |
| x0 | ? | |
| z0 | ? | |
| cell | ? | |
| n | ? | |
| hAt | ? | |
| skip | ? |
buildTerrain( ) → void
buildRing(b: ?, Ri: ?, Ro: ?, segs: ?, K: ?, hmin: ?, hmax: ?, open: ?, wedge: ?, k: ?, snowFrac: ?) → void
mountains: three layered rings
| arg | type | description |
|---|---|---|
| b | ? | |
| Ri | ? | |
| Ro | ? | |
| segs | ? | |
| K | ? | |
| hmin | ? | |
| hmax | ? | |
| open | ? | |
| wedge | ? | |
| k | ? | |
| snowFrac | ? |
buildMountains( ) → void
eyePos( ) → void
water, moon, glint, village lights
moonDir( ) → void
buildWater( ) → void
buildMoon( ) → void
buildGlintAndLamps(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
chaikin(pts: ?, it: ?) → void
| arg | type | description |
|---|---|---|
| pts | ? | |
| it | ? |
distPath(x: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? |
buildPath(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
stonePaint(snowy: ?, h: ?) → void
prop prototypes
| arg | type | description |
|---|---|---|
| snowy | ? | |
| h | ? |
slabProto(rng: ?, kind: ?, snowy: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? | |
| kind | ? | |
| snowy | ? |
ironCrossProto(rng: ?, snowy: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? | |
| snowy | ? |
pumpkinProto(snowy: ?) → void
| arg | type | description |
|---|---|---|
| snowy | ? |
sp(th: ?, ph: ?, out: ?) → void
| arg | type | description |
|---|---|---|
| th | ? | |
| ph | ? | |
| out | ? |
tri(a: ?, c: ?, d: ?) → void
| arg | type | description |
|---|---|---|
| a | ? | |
| c | ? | |
| d | ? |
pineProto(rng: ?, tiers: ?, snowy: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? | |
| tiers | ? | |
| snowy | ? |
boulderProto(rng: ?, snowy: ?, segs: ?, rings: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? | |
| snowy | ? | |
| segs | ? | |
| rings | ? |
crowProto( ) → void
batBodyProto( ) → void
batWingProto(side: ?) → void
| arg | type | description |
|---|---|---|
| side | ? |
meshOf(b: ?) → void
| arg | type | description |
|---|---|---|
| b | ? |
spawnMesh(name: ?, h: ?, mat: ?, parent: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| h | ? | |
| mat | ? | |
| parent | ? |
buildGraveyard(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
buildPumpkins(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
buildCrows(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
buildBats(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
mk(i: ?, cx: ?, cy: ?, cz: ?, rad: ?, sc: ?) → void
| arg | type | description |
|---|---|---|
| i | ? | |
| cx | ? | |
| cy | ? | |
| cz | ? | |
| rad | ? | |
| sc | ? |
buildWall(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
inGraveyardRect(x: ?, z: ?, m: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? | |
| m | ? |
buildForest(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
chunk(key: ?) → void
| arg | type | description |
|---|---|---|
| key | ? |
free(x: ?, z: ?, sp: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? | |
| sp | ? |
add(x: ?, z: ?, sp: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? | |
| sp | ? |
ok(x: ?, z: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| z | ? |
buildBoulders(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
buildTufts(rng: ?) → void
| arg | type | description |
|---|---|---|
| rng | ? |
buildWeather( ) → void
applyLook( ) → void
clearAll( ) → void
lifecycle
init(root: ?) → void
| arg | type | description |
|---|---|---|
| root | ? |
build(root: ?, seed: ?, weather: ?, wind: ?) → void
| arg | type | description |
|---|---|---|
| root | ? | |
| seed | ? | |
| weather | ? | |
| wind | ? |
step(name: ?, fn: ?) → void
| arg | type | description |
|---|---|---|
| name | ? | |
| fn | ? |
findCam( ) → void
update(dt: ?) → void
| arg | type | description |
|---|---|---|
| dt | ? |
shutdown( ) → void
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.
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.