Repository navigation
Road traffic as a stream of the world clock: same cars for host and guest, real hourly flows - #503
Merged
Merged
Conversation
…touched cars over the net; a driver who gives up the wheel always stands somewhere
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UiczdrQkRq9cma4smGik1v
…the road Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UiczdrQkRq9cma4smGik1v
Contributor
⏱ Performance: this PR against mainScenarios of src/game/98_perf.js, the two builds by turns on one runner (tools/perf.mjs, CPU side, draws counted not drawn). ❌ Slower than main in 2 gating metric(s)
Over budget (ms/frame, budget): drive Land.lightTick 20.91 > 1 · drive Land.gen 6.50 > 0 · tunnel Land.lightTick 3.34 > 1 · drive Land.meshChunk 1.99 > 1 · drive gl.upload 1.64 > 0.8 · tunnel Land.meshChunk 1.52 > 1 · drive Town.update 1.44 > 1 · flight Land.gen 0.17 > 0 Generated by Claude Code |
Contributor
Screenshots of build v476🚗 The road into the town at 8:00, the morning peak: as many cars as a road of one lane each way carries then 🚗 The same road at 3:00: next to nobody on it All of them are assets of the v476 release. |
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.


Requested by Anton · project thread
What
Second part of "every inhabitant runs its own deterministic algorithm" for the cars of the roads between towns.
jof a lane sets off atj·DofWx.clock(); its kind, seed and driver's pace follow from the lane's seed, its place from a time profile of the lane at that pace (Town.rdQ,rdCar,rdAt). The owner of a world and a guest have the same cars at the same places with nothing sent. The old per-device random filling (rdFill) is gone.Net.rdHot): ridden or pushed, it is sent while the player is with it; then every device drives it on. A row carries the lane (rt −1) or the stall of the town it visits (rt −2 − k), so a device that lacks the car brings it back as the same car (rdFind,rdRevive), does not make a second copy of a ridden one (rdHold), and turns it into the town to the same stall (rdSame,roadIn(c, want)).rdPeak: 380 on 1+1, 900/600 on 2+2, 1000/750 on 3+3) and the share present at an hour from a weekday curve (RD_HOURS: peaks at 8 and 17, a twentieth at 3).Drive.aside): beside the door, the other side, or on the road behind the vehicle when there is no ground at either side (a bridge edge). The driver used to get no place and vanish.Rules and tests
docs/ARCHITECTURE.md: "The traffic of a road is a stream of the world clock; only a car a player touches travels over the net" and "How many cars a road carries is measured against real roads, by the hour".tools/rdstream.test.mjs(new): a device that drove the world for 40 s and one that comes in then have the same cars at their places; nothing is made in sight; untouched cars are not sent; a missing car comes back on its lane and as a visitor to the same stall; a ridden car is not made again; flow past a point in a minute at 8:00 and at 3:00 against the flow asked for; the ceded driver stands on the road.tools/roadin.test.mjs: picks a road that has a way into its town and enough strangers' stalls (since build 454 many road ends stop short of the streets; that generator defect is with the town thread).Local runs on this branch built on main:
rdstreamOK,roadinOK,folkOK,urbanOK,trafficOK.Screenshots
tools/shots/468.mjs: the same road into a town at the morning peak and at 3 at night. The release workflow attaches them.Not in this PR
Cars still exist only in the physics circle around the player; drawing the stream on far roads straight from
rdAtcomes next.Generated by Claude Code