Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·originates fromworld 7f138801-7…

buildings

Port of Painted Valley's src/valley/village.js (blendi/painted-valley, MIT): the shapes of the village's buildings (eight kinds), layVillage / layFarm, and drawing them with the building material (building.shader) through renderer.mesh.drawInstanced.

byzero-proxy @ DESKTOP-DB3UJOJ·posted 2d ago
What it does

buildings

Port of Painted Valley's src/valley/village.js (blendi/painted-valley, MIT): the shapes of the village's buildings (eight kinds), layVillage / layFarm, and drawing them with the building material (building.shader) through renderer.mesh.drawInstanced.

Interface

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

conforms to

zero/source-extract/v2

native

Model

mulberry(seed: number, skip: number?) → void

mulberry32(seed), advanced `skip` draws (its state is a counter, so skipping is one multiply).

argtypedescription
seednumber
skipnumber?

cylinder(radiusTop: number, radiusBottom: number, height: number, radialSegments: number, heightSegments: number, openEnded: boolean) → void

CylinderGeometry(radiusTop, radiusBottom, height, radialSegments, heightSegments, openEnded), as triangle soup: { positions, normals } in the order toNonIndexed() gives.

argtypedescription
radiusTopnumber
radiusBottomnumber
heightnumber
radialSegmentsnumber
heightSegmentsnumber
openEndedboolean

cap(top: boolean) → void

argtypedescription
topboolean

sphere(radius: number, widthSegments: number, heightSegments: number, phiStart: number, phiLength: number, thetaStart: number, thetaLength: number) → void

SphereGeometry(radius, widthSegments, heightSegments, phiStart, phiLength, thetaStart, thetaLength), unindexed.

argtypedescription
radiusnumber
widthSegmentsnumber
heightSegmentsnumber
phiStartnumber
phiLengthnumber
thetaStartnumber
thetaLengthnumber

translate(g: any, x: number, y: number, z: number) → void

argtypedescription
gany
xnumber
ynumber
znumber

P(x: number, y: number, z: number, u: number, r: number?, hl: number?) → Corner

A corner: where it is, how far up the wall (or the roof), and along the wall from its middle with half the wall's length.

argtypedescription
xnumber
ynumber
znumber
unumber
rnumber?
hlnumber?

shell( ) → void

Collects flat-faced pieces of a building. A corner is a point with `u`: how far up the wall it is.

tri(a: Corner, b: Corner, c: Corner, p: number) → void

argtypedescription
aCorner
bCorner
cCorner
pnumber

quad(a: Corner, b: Corner, c: Corner, e: Corner, p: number) → void

argtypedescription
aCorner
bCorner
cCorner
eCorner
pnumber

add(g: any, p: number, upAt: (number) → void

A ready-made geometry (a cylinder, a dome): p is wall or roof, upAt gives how far up each point is.

argtypedescription
gany
pnumber
upAt(number

data( ) → void

walls(m: any, w: number, d: number, h: number, cx: number?, cz: number?) → void

Four walls round (cx, cz), w wide and d long, up to h.

argtypedescription
many
wnumber
dnumber
hnumber
cxnumber?
cznumber?

gable(m: any, w: number, d: number, h: number, r: number, cx: number?, cz: number?) → void

A pitched roof with gables at both ends, its ridge r above the eaves and running the length of the house.

argtypedescription
many
wnumber
dnumber
hnumber
rnumber
cxnumber?
cznumber?

hip(m: any, w: number, d: number, h: number, r: number, cx: number?, cz: number?) → void

A roof that slopes on all four sides to a short ridge.

argtypedescription
many
wnumber
dnumber
hnumber
rnumber
cxnumber?
cznumber?

cap(m: any, s: number, y0: number, tall: number, cx: number?, cz: number?) → void

A pointed cap on a square tower s across, from y0 up by tall.

argtypedescription
many
snumber
y0number
tallnumber
cxnumber?
cznumber?

chimney(m: any, cx: number, cz: number, y0: number, y1: number, s: number?) → void

A chimney: a plain stack s square from y0 up to y1.

argtypedescription
many
cxnumber
cznumber
y0number
y1number
snumber?

c(x: number, y: number, z: number) → Corner

argtypedescription
xnumber
ynumber
znumber

make(m: ?) → void

argtypedescription
m?

make(m: ?) → void

argtypedescription
m?

make(m: ?) → void

argtypedescription
m?

make(m: ?) → void

argtypedescription
m?

make(m: ?) → void

argtypedescription
m?

make(m: ?) → void

argtypedescription
m?

make(m: ?) → void

argtypedescription
m?

round(x: number, _y: number, z: number) → void

(round it, a wall has no ends: only how far round you are)

argtypedescription
xnumber
_ynumber
znumber

make(m: ?) → void

argtypedescription
m?

layVillage(random: () → void

Where the village's buildings stand: a tight cluster on its rise, the towers and the tall houses at the top, the cottages and barns round the edge, set along two streets and not every which way. Returns { { x, z, turn, scale, shape, wall, roof } }.

argtypedescription
random(

pick(from: { any }) → any

argtypedescription
from{ any }

put(du: number, dv: number, shape: string, scale: number, turn: number, wall: any?, roof: any?) → void

argtypedescription
dunumber
dvnumber
shapestring
scalenumber
turnnumber
wallany?
roofany?

layFarm(random: () → void

A farmstead at (u, v): a house, a barn bigger than it, a shed.

argtypedescription
random(

layAll( ) → void

Every building the original's farwoods.js puts up: layVillage, then a farm at each of FARMS, from the same random stream at the same point in it.

meshFrom(d: any) → any

Packs a shell's attributes into a Zero mesh (uv = aUp, aFace.x; colour = aPart, aFace.y, see the top).

argtypedescription
dany

shapeData(name: string) → void

The geometry of one kind of building, as the original's shell().build() makes it.

argtypedescription
namestring

compose(x: number, y: number, z: number, turn: number, sx: number, sy: number?, sz: number?) → void

Column-major matrix of compose(position, rotation about y by turn, uniform scale), and that rotation's quaternion.

argtypedescription
xnumber
ynumber
znumber
turnnumber
sxnumber
synumber?
sznumber?

createBuildingMaterial(core: any, key: string?) → void

The building material (the original's createBuildingMaterial): one for every building in the valley.

argtypedescription
coreany
keystring?

drawShells(mesh: any, material: any, items: { any }, name: string, parent: any?) → void

Draws `count` copies of a building mesh with the building material. `items[i]` = { matrix (16, column-major), quat {x,y,z,w}, scale, origin {x,y,z}, roof {r,g,b}, wall {r,g,b} }. Returns a handle with :set(i, item) to move one (the mill's sails) and :destroy(). `parent` (an entity at the origin) stands the copies in its space.

argtypedescription
meshany
materialany
items{ any }
namestring
parentany?

pack(list: { any }) → void

argtypedescription
list{ any }

set(_self: ?, i: number, it: any) → void

argtypedescription
_self?
inumber
itany

destroy(_self: ?) → void

argtypedescription
_self?

addBuildingEntities(material: any, list: { any }, parent: any) → void

Puts every building in the list on the ground (the original's addBuildings), each as a local, temporary entity under `parent`: a Model wearing its kind's mesh (made once a kind) and the building material as a session material, with the building's instance lanes set on it. Entities, not instanced draws, because the frame's tag pass (the original's "already painted" alpha, 0.4) finds what it tags by entity. Returns { entities, meshes, destroy() }.

argtypedescription
materialany
list{ any }
parentany

destroy(_self: ?) → void

argtypedescription
_self?

addBuildings(material: any, list: { any }, prefix: string?, parent: any?) → void

Puts every building in the list on the ground, one instanced draw to a kind (the original's addBuildings, drawn the way it draws them; the frame's tag pass does not reach instanced draws, so the valley uses addBuildingEntities).

argtypedescription
materialany
list{ any }
prefixstring?
parentany?

Sub-parts

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

7items
▣
module · born here
❒asset
# paintedValley.world The land of Painted Valley (port of blendi/painted-valley src/valley/world.js, MIT): heightAt, land, paint/paintAt, pathDistance, tarnDistance, riverDistance, fieldsAt, forestAt, fbm, ridged and the valley's fixed places (HERO, START, TREE, VILLAGE, TARN). Bit-exact with the original (integer hash included). Every part uses it for CPU placement; the GPU twin is paintedValley.core.valleyLand.
▲ 0↑ born
backing path · paintedValley/village/buildings.module

Problems

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

0problems
No problems reported. This asset, its contents, and its direct deps are clean as of the latest commit.
⌬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.