Skip to content

City and race track are one engine: sealed-off street races + better cities - #1614

Closed
Noisemaker111 wants to merge 11 commits into
mainfrom
cursor/unify-city-and-race-track-generation-de6d
Closed

City and race track are one engine: sealed-off street races + better cities#1614
Noisemaker111 wants to merge 11 commits into
mainfrom
cursor/unify-city-and-race-track-generation-de6d

Conversation

@Noisemaker111

@Noisemaker111 Noisemaker111 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

A race track was a separate abstract shape floating on a void grid. A street race is now a section of the city blocked off — same asphalt, barriers on every side street leaving the lap.

Root cause (structure). generateStreets forked at streetNetworkMode: circuit mode threw away the street graph. CityRules / editor bake also dropped dials; playground hid them in Race circuit mode.

Root cause (junctions). CityRenderer trimmed roads but then stacked plaza hull aprons, fallback discs, and fat zebra ladders on top of the welded surface, and race resurfacing painted over junction mouths — undoing the #1511 carriageway-union look that StreetGeometryPreview already had.

Changes

  • packages/core/src/world/raceCircuit.tsextractCircuitRoute lifts a sealed lap out of a StreetNetwork
  • packages/core/src/world/cityKind.ts / cityContent.ts — full street dials; Race group; parked cars/signals; denser commercial streetwall + L-plan/court massing under high blockDensity
  • packages/shell/src/scene/CityRenderer.tsxbuildTrimmedIntersections + buildIntersectionMarkings (same opts as StreetGeometryPreview / playground); no plaza aprons/discs/zebras; race surface/kerbs break at mouths
  • packages/editor + check-street-rule-parity — bake forwards the full rule set
  • apps/web playground — one shared slider set; Street race mode
  • Games/studio-showcase — metro opts into race + denser capital dials

Verification

  • bun test packages/core/src/world/raceCircuit.test.ts cityKind.test.ts cityContent.test.ts roads.test.ts — pass
  • bun run check-street-rule-parity — ok
  • bun run check-changelog — ok
  • bun run shoot --fixture StreetGeometryPreview + metro aerial/street — captured

Screenshots

Before (metro aerial — lawn/gray pads, plaza-ish crossings):
before-metro-aerial

After (welded junctions + denser metro dials/massing):
after-metro-aerial
after-metro-junction
after-metro-street

StreetGeometryPreview (canonical welded seam):
after-StreetGeometryPreview

Still not AAA — continuous streetwall and mid-block fabric need another density pass — but junctions now share the fixture/playground seam and metro is denser than the lawn-under-towers baseline.

Open in Web Open in Cursor 

cursoragent and others added 5 commits July 26, 2026 19:40
…t network

A race circuit was a separate abstract shape: generateStreets forked at
streetNetworkMode and circuit mode synthesized a hull-loop spline with no
relationship to any city, so a street race could never be a section of a city.

extractCircuitRoute searches the street graph for the closed cycle that best
matches a target lap length and arterial bias, then seals every side street
leaving it — the barriers that turn public roads into an instanced event. The
lap is resampled to a racing-surface resolution and its inherited junction
kinks rounded into a drivable line, bounded so the line never leaves the
asphalt it came from. Ships checkpoints that hand straight to raceTrack(),
start/finish, a staggered grid, corner analysis, kerbs, and timing sectors.

Circuit-mode networks take the same path: their loop edges are the cycle.

Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
…jection

- resampleClosed skipped the wrap-around segment, collapsing a handful of
  trailing samples onto the first point.
- circuitKerbs offset on per-segment normals, which fans the strip open on the
  outside of a corner; mitre on the neighbour tangent instead.
- A candidate lap could fold back through itself at a junction and hand back a
  "lap" that drives over its own surface. Reject on self-clearance measured
  along the lap, the invariant the generator already holds for its own circuits,
  and cap a junction turn at 120 degrees.
- minCornerRadius was rejecting candidates on pre-rounding sampling artifacts,
  so any target above ~12 returned null for every city. It is a bounded target,
  not a guarantee, so report the achieved figure as tightestRadius instead.

Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
The playground hid 18 layout sliders the moment you pressed "Race circuit" and
offered one in their place, teaching that a city and a track are two different
tools. Modes are now presets over a single shared slider set, loopiness and min
curve radius are exposed as the dials that actually decide the topology, and the
computed net/circuit verdict is shown.

Adds a street-race mode: grow the city, extract a lap from it, and render the
lap surface, kerbs, start/finish, grid, and the barriers sealing every side
street the lap leaves.

Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
…itor can author

CityRules dropped elevation, maxGrade, compactness, sidewalkWidth, outline, and
residentialBranches when it mapped to StreetNetworkRules, and the editor bake's
RULE_KEYS omitted the same set, so the engine's claim that a city and a track
are one generator was false at both authoring seams. Every dial now reaches
both, and check-street-rule-parity fails CI if one drifts again.

Adds the race dials to the city volume: a district grows a lap through its own
streets and resolves it in world space with seals, gates, kerbs, start/finish,
and grid, so an instanced street race is authored as a section of the city.

City ground fabric, facade palettes, rooflines, storefront plinths, window
banding, and junction-only crosswalks address the look.

Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
Parked vehicles and junction signals fill the empty streets. CityRenderer
draws a ResolvedRace (lap surface, kerbs, start/finish, seals) so an
authored street race is visible in the editor and in play, not only in the
playground. Facades dissolve their window stripes before they alias into
speckle. Studio Showcase's metro district opts into a street race so the
product claim is visible in-game.

Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
@vercel

vercel Bot commented Jul 26, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
jgengine-web Ignored Ignored Preview Jul 26, 2026 9:48pm

cursoragent and others added 3 commits July 26, 2026 21:28
Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
CityRenderer now consumes buildTrimmedIntersections + markings like
StreetGeometryPreview/playground — no plaza aprons, discs, or fat zebras.
Commercial massing tightens to a streetwall with L-plans and mid-block courts.

Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
cursoragent and others added 2 commits July 26, 2026 21:45
Skip welded sidewalk aprons when block curb rings already own the walk,
break race kerbs at mouths, and only tighten commercial packing under
high blockDensity so suburbs keep their lot counts.

Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
@cursor
cursor Bot marked this pull request as ready for review July 26, 2026 21:47
@cursor
cursor Bot enabled auto-merge (squash) July 26, 2026 21:47
Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>

Copy link
Copy Markdown
Owner Author

Superseded by the rebased replacement PR #1656, which carries the verified city/race-track implementation.

auto-merge was automatically disabled July 31, 2026 04:23

Pull request was closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants