Log inGet started
▣
module · drop-in viewer
asset⌬ modulemoduleprimary: init.luau·part ofpackage cityKit.package·originates fromworld 0a0b119f-a…

plan

`Plan.plan(seed, i0, i1, j0, j1, rules?)`: the plan of a city as a pure function of a seed, rules and a rectangle of superblock indices: a road graph, superblocks, blocks, oriented lots, a river with quays and bridges, a park. Growing the rectangle never changes what was there. T…

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

cityKit.plan

Plan.plan(seed, i0, i1, j0, j1, rules?): the plan of a city as a pure function of a seed, rules and a rectangle of superblock indices: a road graph, superblocks, blocks, oriented lots, a river with quays and bridges, a park. Growing the rectangle never changes what was there. The module's head documents every field; the package README says how a game steers it.

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

imul(a: number, b: number) → number

argtypedescription
anumber
bnumber

h32(a: number, b: number?, c: number?, d: number?) → number

argtypedescription
anumber
bnumber?
cnumber?
dnumber?

u01(a: number, b: number?, c: number?, d: number?) → number

argtypedescription
anumber
bnumber?
cnumber?
dnumber?

lerp(a: number, b: number, t: number) → number

argtypedescription
anumber
bnumber
tnumber

round(x: number) → number

argtypedescription
xnumber

smooth(a: number, b: number, x: number) → number

argtypedescription
anumber
bnumber
xnumber

riverRow(R: any, axis: number) → number

argtypedescription
Rany
axisnumber

gap(seed: number, axis: number, k: number, R: any) → number

the gap between line k and line k + 1 of an axis, where the seed lays it

argtypedescription
seednumber
axisnumber
knumber
Rany

lineAt(seed: number, axis: number, i: number, R: any) → number

argtypedescription
seednumber
axisnumber
inumber
Rany

nodeAt(seed: number, i: number, j: number, R: any) → void

Where crossing (i, j) of the lattice stands: its lines' crossing, moved by the bends and the jitter, except where the rules hold it still (the park's corners, the calm round rules.arterial.calm).

argtypedescription
seednumber
inumber
jnumber
Rany

isWater(R: any, i: number, j: number) → boolean

argtypedescription
Rany
inumber
jnumber

districtIndex(R: any, name: string) → number

argtypedescription
Rany
namestring

districtOf(seed: number, i: number, j: number, R: any, cache: { [string]: any }) → number

argtypedescription
seednumber
inumber
jnumber
Rany
cache{ [string]: any }

districtOf(seed: number, i: number, j: number, rules: any?) → number

argtypedescription
seednumber
inumber
jnumber
rulesany?

dist(ax: number, az: number, bx: number, bz: number) → number

argtypedescription
axnumber
aznumber
bxnumber
bznumber

inset(poly: { any }, by: { number }) → void

A convex polygon (counter-clockwise: its inside is on the left of every side) moved in by `by[k]` metres at its side k (from corner k to corner k + 1). nil when nothing is left of it.

argtypedescription
poly{ any }
by{ number }

area(poly: { any }) → number

argtypedescription
poly{ any }

insideBy(poly: { any }, x: number, z: number) → number

how far inside a convex counter-clockwise polygon a point is (negative outside)

argtypedescription
poly{ any }
xnumber
znumber

rectsOverlap(a: any, b: any) → boolean

whether two oriented rectangles (ox, oz, ex, ez, w, d) overlap by more than a hair

argtypedescription
aany
bany

corners(r: any) → void

argtypedescription
rany

apart(ux: number, uz: number) → boolean

argtypedescription
uxnumber
uznumber

inRect(r: any, x: number, z: number) → boolean

argtypedescription
rany
xnumber
znumber

plan(seed: number, i0: number, i1: number, j0: number, j1: number, rules: any?) → any

The plan of the superblocks i0..i1 by j0..j1 (inclusive).

argtypedescription
seednumber
i0number
i1number
j0number
j1number
rulesany?

newNode(x: number, z: number) → any

argtypedescription
xnumber
znumber

newLine(ax: number, az: number, bx: number, bz: number, cls: string, half: number, walk: number, lanes: number, key: number, district: number?) → any

a whole road: from a to b, with the places along it where streets may meet it, and the nodes that do stand on it

argtypedescription
axnumber
aznumber
bxnumber
bznumber
clsstring
halfnumber
walknumber
lanesnumber
keynumber
districtnumber?

addGates(ln: any, spacing: number) → void

argtypedescription
lnany
spacingnumber

stopAt(ln: any, t: number, nd: any) → void

argtypedescription
lnany
tnumber
ndany

sidePoint(s: any, t: number) → void

argtypedescription
sany
tnumber

sideLen(s: any) → number

argtypedescription
sany

pickGate(s: any, want: number, keep: number) → any

the gate of a side nearest to `want` (0..1 along the side), no nearer than `keep` metres to either end; a gate of its own is made when the road offers none (a gate another block made for itself is never taken: what one superblock does must not depend on whether its neighbour is in the plan)

argtypedescription
sany
wantnumber
keepnumber

gateNode(g: any) → any

argtypedescription
gany

cut(q: { any }, d: any, kind: number, key: number, depth: number, superIndex: number) → void

argtypedescription
q{ any }
dany
kindnumber
keynumber
depthnumber
superIndexnumber

quadOf(q: { any }) → void

argtypedescription
q{ any }

peakAt(x: number, z: number) → number

argtypedescription
xnumber
znumber

snapDown(x: number) → number

argtypedescription
xnumber

probe(px: number, pz: number, ox: number, oz: number, ax: number, az: number, len: number) → void

argtypedescription
pxnumber
pznumber
oxnumber
oznumber
axnumber
aznumber
lennumber

checksum(p: any) → number

A number that stands for a plan's lots (two plans with the same lots have the same number).

argtypedescription
pany

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.