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

streets

This module generates the local streets of a city, growing them district by district based on each district's defined pattern. It uses a tensor-field tracing method to determine street directions, blending influences from district headings, ground contours, existing arterials, an…

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

streets

This module generates the local streets of a city, growing them district by district based on each district's defined pattern. It uses a tensor-field tracing method to determine street directions, blending influences from district headings, ground contours, existing arterials, and noise. Streets are laid out as streamlines of this field, spaced evenly, starting from existing ways, and stopping or joining other streets when they meet. It handles jitter for uneven spacing, thins cross streets, and can end streets in T-junctions. The module assigns names to grown streets and calculates their width, length, and grade. It outputs these streets as curves with various attributes. It is called by the city generation pipeline after districts and major ways have been defined.

Interface

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

conforms to

zero/source-extract/v2

cityGen.streets: the local streets of a city, grown district by district from each district's pattern. The method is the tensor-field tracing of Chen et al., "Interactive Procedural Street Modeling": a district has a field that gives, at every point, the two directions its streets run in (a cross: the grain and the cross streets square to it). The field is a blend of bases its rules weigh: the district's own heading (`angle`), or rays and rings about its anchor (`radial`), the contours of the ground where it slopes (`contour`), the arterials, shore and edges it meets, which turn the cross until streets run along and square to them (`align`, `alignReach`), and a slow noise that turns it (`wander`, `wanderSize`). Streets are streamlines of that field, laid evenly: a street of the grain every `blockDepth` metres, a cross street every `blockLength`, each started ON a way that is already there (so streets leave arterials at junctions rather than beside them), stopped where they would crowd another, and joined to what they reach. `jitter` unevens the spacing, `crossRate` thins the cross streets, `tee` and `stopAt` end streets on one another the way old quarters do. A district's draws come from the template seed and its own name alone. Result: curves with primitive `class`, `kind` ("ground"), `width`, `district` (name), `family` (grain | cross | edge | design), `name`, `deadEnds`, `maxGrade`, `stairsGrade`; `P.y` is the ground.

buildField(S: ?, d: ?, lines: ?, seed: ?) → void

The field of one district, on a grid over its bounds. Two fields are kept: the district's own heading (a line field: `A2`, `B2` hold cos 2a, sin 2a), which says which of the two street directions is the grain; and the cross of streets itself (`A4`, `B4` hold cos 4a, sin 4a), which the ways and edges nearby turn.

argtypedescription
S?
d?
lines?
seed?

lerp(T: ?, k: ?, tx: ?, tz: ?) → void

argtypedescription
T?
k?
tx?
tz?

at(x: ?, z: ?) → void

The heading of the grain at a point, as a unit vector (the cross streets run square to it).

argtypedescription
x?
z?

segRecord(ax: ?, az: ?, bx: ?, bz: ?, kind: ?, class: ?, line: ?) → void

argtypedescription
ax?
az?
bx?
bz?
kind?
class?
line?

fileLine(grid: ?, pts: ?, closed: ?, kind: ?, class: ?, line: ?) → void

File a polyline's segments in the grid of everything a street can meet.

argtypedescription
grid?
pts?
closed?
kind?
class?
line?

firstHit(grid: ?, ax: ?, az: ?, bx: ?, bz: ?, skipNear: ?, take: ?) → void

The first thing a step from (ax, az) to (bx, bz) crosses that `take` accepts: the segment, where along the step, and the point.

argtypedescription
grid?
ax?
az?
bx?
bz?
skipNear?
take?

crowd(occ: ?, x: ?, z: ?, reach: ?, ignoreLine: ?) → void

How close the nearest sample of a family's streets lies, within `reach`.

argtypedescription
occ?
x?
z?
reach?
ignoreLine?

growDistrict(S: ?, d: ?, world: ?, seed: ?, out: ?, report: ?) → void

One district's streets.

argtypedescription
S?
d?
world?
seed?
out?
report?

draw(tag: ?) → void

argtypedescription
tag?

inside(x: ?, z: ?) → void

Inside the district and outside every designed place (a square is nobody's building ground).

argtypedescription
x?
z?

familyOf(x: ?, z: ?, dx: ?, dz: ?) → void

Which family a heading runs with at a point: 1 along the grain, 2 across it.

argtypedescription
x?
z?
dx?
dz?

follow(x: ?, z: ?, dx: ?, dz: ?) → void

The street direction at a point nearest a heading: a street follows the cross of the field, whichever of its arms it is on.

argtypedescription
x?
z?
dx?
dz?

occupy(pts: ?, line: ?) → void

Mark a line as taken, each stretch by the family it runs with there (so later streets keep their distance).

argtypedescription
pts?
line?

push(seedPoint: ?) → void

argtypedescription
seedPoint?

seedsFrom(pts: ?, fixedLine: ?) → void

Seeds a line gives: streets that start ON it and leave square to it, and the next streets beside it.

argtypedescription
pts?
fixedLine?

frame(at: ?) → void

argtypedescription
at?

run(sx: ?, sz: ?, dx: ?, dz: ?, lineId: ?) → void

Trace one way from a point. Answers the points after the start and how the run ended.

argtypedescription
sx?
sz?
dx?
dz?
lineId?

take(s: ?) → void

argtypedescription
s?

trace(seedPoint: ?) → void

argtypedescription
seedPoint?

flush( ) → void

flush( ) → void

emit( ) → void

plan(S: ?, ways: ?, shore: ?, districts: ?, designs: ?, seed: ?, options: ?) → void

The streets as a list of ways. `ways` is the skeleton, `shore` the shoreline, `districts` what city.districts answered (read back), `designs` the designed streets of the template.

argtypedescription
S?
ways?
shore?
districts?
designs?
seed?
options?

fix(line: ?, kind: ?) → void

argtypedescription
line?
kind?

build(survey: ?, seaLevel: ?, ways: ?, shore: ?, districts: ?, designs: ?, seed: ?, options: ?) → void

The node's function.

argtypedescription
survey?
seaLevel?
ways?
shore?
districts?
designs?
seed?
options?

Problems

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

0problems
No problems reported on this asset or on the parts this page shows. Parts it leaves out are not counted here.
⌬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.