farwoods
Port of farwoods.js: the far trees, orchards, poplars and the mill on the plain as small painted cards, with every placement as the original's random stream lays it. Called by paintedValley.far.far.
paintedValley.far.farwoods
Port of farwoods.js: the far trees, orchards, poplars and the mill on the plain as small painted cards, with every placement as the original's random stream lays it. Called by paintedValley.far.far.
Interface
What this asset declares: the schema it conforms to, what it exposes, and the rendered structured payload.
conforms to
zero/source-extract/v2native
mulberry(seed: number) → void
mulberry32 from `seed` (an unsigned 32-bit state). Returns the generator and a function that reads its state.
| arg | type | description |
|---|---|---|
| seed | number |
random( ) → number
villageRandom( ) → void
The random stream the village's and the farmsteads' layout continues (layVillage, then layFarm per FARMS).
jsRound(x: number) → number
JavaScript's Math.round (halves go up), and -0 made 0 so it keys a table as the original's strings do.
| arg | type | description |
|---|---|---|
| x | number |
newCanvas( ) → void
span(self: ?, xa: number, xb: number) → void
one sample row's span [xa, xb): a quarter of a pixel row's coverage
| arg | type | description |
|---|---|---|
| self | ? | |
| xa | number | |
| xb | number |
flush(self: ?, py: number) → void
| arg | type | description |
|---|---|---|
| self | ? | |
| py | number |
fill(self: ?, y0: number, y1: number, spans: (any, number) → void
Fills whatever `spans(self, y)` lays at each sample row y between y0 and y1.
| arg | type | description |
|---|---|---|
| self | ? | |
| y0 | number | |
| y1 | number | |
| spans | (any, number |
polygon(self: ?, pts: { number }) → void
A path of points {x1, y1, x2, y2, ...}, closed, filled by the non-zero rule.
| arg | type | description |
|---|---|---|
| self | ? | |
| pts | { number } |
ellipse(self: ?, cx: number, cy: number, rx: number, ry: number, rot: number, upper: boolean?) → void
An ellipse about (cx, cy), radii rx, ry, turned by `rot`; `upper` keeps only the half above cy (a dome, as ellipse(..., PI, 0) and fill draw it).
| arg | type | description |
|---|---|---|
| self | ? | |
| cx | number | |
| cy | number | |
| rx | number | |
| ry | number | |
| rot | number | |
| upper | boolean? |
rect(self: ?, x: number, y: number, w: number, h: number) → void
| arg | type | description |
|---|---|---|
| self | ? | |
| x | number | |
| y | number | |
| w | number | |
| h | number |
treePictures(breathe: (() → void
Eight pictures side by side, lit from the left: two stands of firs, two clumps of broadleaves, a row of poplars, a single round tree, a length of hedge, and haystacks. Grey is how light the paint is there (shade, half-light, light); the shader gives it its greens, or its straw. Returns RGBA bytes (2048 x 256, top row first, straight alpha, as a canvas hands its pixels to a texture).
| arg | type | description |
|---|---|---|
| breathe | (( |
tone(t: number) → void
| arg | type | description |
|---|---|---|
| t | number |
tri(ax: ?, ay: ?, bx: ?, by: ?, cx: ?, cy: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| ax | ? | |
| ay | ? | |
| bx | ? | |
| by | ? | |
| cx | ? | |
| cy | ? | |
| t | ? |
disc(x: ?, y: ?, r: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| y | ? | |
| r | ? | |
| t | ? |
dabs(m: ?, n: ?) → void
Leaves, as a brush puts them on a mass: small dabs, lighter towards the upper left where the light is.
| arg | type | description |
|---|---|---|
| m | ? | |
| n | ? |
skirt(shade: ?, x0: ?, x1: ?, inset: ?) → void
A skirt of boughs from the trunk out to a drooping tip, and back along a ragged underside.
| arg | type | description |
|---|---|---|
| shade | ? | |
| x0 | ? | |
| x1 | ? | |
| inset | ? |
inCell(k: ?, draw: ?) → void
Draws into one cell only, so nothing spills into its neighbours.
| arg | type | description |
|---|---|---|
| k | ? | |
| draw | ? |
oval(x: ?, y: ?, rx: ?, ry: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| x | ? | |
| y | ? | |
| rx | ? | |
| ry | ? | |
| t | ? |
dome(dx: ?, k: ?, t: ?) → void
| arg | type | description |
|---|---|---|
| dx | ? | |
| k | ? | |
| t | ? |
pictureTexture(bytes: buffer) → void
The pictures as a texture: mipmapped, a little anisotropy, as the original's CanvasTexture.
| arg | type | description |
|---|---|---|
| bytes | buffer |
place(breathe: (() → void
Every card the original stands on the plain: three flat lists, as its instanced attributes are. `at` (x, y, z of its foot), `dim` (width, height), `look` (which picture, how light a stand it is). Yields as it goes.
| arg | type | description |
|---|---|---|
| breathe | (( |
push3(t: ?, a: ?, b: ?, c: ?) → void
| arg | type | description |
|---|---|---|
| t | ? | |
| a | ? | |
| b | ? | |
| c | ? |
push2(t: ?, a: ?, b: ?) → void
| arg | type | description |
|---|---|---|
| t | ? | |
| a | ? | |
| b | ? |
put(x: number, z: number, fir: boolean, scale: number, h: number?) → void
(h: heightAt(x, z), when the caller has it already: the same sum the original makes twice)
| arg | type | description |
|---|---|---|
| x | number | |
| z | number | |
| fir | boolean | |
| scale | number | |
| h | number? |
place(u: number, v: number, cell: number, w: number, h: number) → void
| arg | type | description |
|---|---|---|
| u | number | |
| v | number | |
| cell | number | |
| w | number | |
| h | number |
key(a: number, b: number) → number
| arg | type | description |
|---|---|---|
| a | number | |
| b | number |
cylinder(rt: number, rb: number, height: number, segs: number, dy: number, part: number, P: ?, N: ?, U: ?) → void
three.js's CylinderGeometry / ConeGeometry / PlaneGeometry, made the way three makes them (smooth normals round the tower, flat on the caps), then laid out flat as the original's building() does. Each corner carries its part (0 wall, 1 roof) in uv.x.
| arg | type | description |
|---|---|---|
| rt | number | |
| rb | number | |
| height | number | |
| segs | number | |
| dy | number | |
| part | number | |
| P | ? | |
| N | ? | |
| U | ? |
corner(i: ?) → void
| arg | type | description |
|---|---|---|
| i | ? |
cap(top: boolean) → void
| arg | type | description |
|---|---|---|
| top | boolean |
finish(P: ?, N: ?, U: ?) → void
| arg | type | description |
|---|---|---|
| P | ? | |
| N | ? | |
| U | ? |
millMesh( ) → void
A windmill's tower: eight-sided, narrowing upwards, with a pointed cap. Its foot at the origin.
sailsMesh( ) → void
Its four sails, flat in the plane they turn in, round the origin.
plane(w: number, h: number, tx: number, ty: number, turn: number, part: number) → void
| arg | type | description |
|---|---|---|
| w | number | |
| h | number | |
| tx | number | |
| ty | number | |
| turn | number | |
| part | number |
millPlace( ) → void
Where the mill stands and how it faces: its foot, its yaw (it faces up the valley, towards the walk), its size.
matrix(pos: { number }, yaw: number, spin: number, scale: number) → void
A column-major matrix: rotation by the quaternion (facing about y) * (spin about z), uniform scale, translation.
| arg | type | description |
|---|---|---|
| pos | { number } | |
| yaw | number | |
| spin | number | |
| scale | number |
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.