City and race track are one engine: sealed-off street races + better cities - #1614
Closed
Noisemaker111 wants to merge 11 commits into
Closed
City and race track are one engine: sealed-off street races + better cities#1614Noisemaker111 wants to merge 11 commits into
Noisemaker111 wants to merge 11 commits into
Conversation
…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>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
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>
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>
Co-authored-by: NoisemakerJon <Noisemaker111@users.noreply.github.com>
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).
generateStreetsforked atstreetNetworkMode: 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.ts—extractCircuitRoutelifts a sealed lap out of aStreetNetworkpackages/core/src/world/cityKind.ts/cityContent.ts— full street dials; Race group; parked cars/signals; denser commercial streetwall + L-plan/court massing under highblockDensitypackages/shell/src/scene/CityRenderer.tsx—buildTrimmedIntersections+buildIntersectionMarkings(same opts as StreetGeometryPreview / playground); no plaza aprons/discs/zebras; race surface/kerbs break at mouthspackages/editor+check-street-rule-parity— bake forwards the full rule setapps/webplayground — one shared slider set; Street race modeGames/studio-showcase— metro opts into race + denser capital dialsVerification
bun test packages/core/src/world/raceCircuit.test.ts cityKind.test.ts cityContent.test.ts roads.test.ts— passbun run check-street-rule-parity— okbun run check-changelog— okbun run shoot --fixture StreetGeometryPreview+ metro aerial/street — capturedScreenshots
Before (metro aerial — lawn/gray pads, plaza-ish crossings):

After (welded junctions + denser metro dials/massing):



StreetGeometryPreview (canonical welded seam):

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.