Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.
JavaScript 3d-generationai-agentsanimationavatardigital-humangenerative-aiglbgltfimage-to-3dllmmcpmcp-servermodel-context-protocolsolanatext-to-3dthreejsweb-componentswebglwebxrx402
feat(play): make the Trench Car the one car in every town, frontier ones included
nirholas0a1f9236a726
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 48f31d450..ab5bba4f6 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -29,6 +29,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Every Crypto Converter result now has its own link you can share**: The converter promised a shareable result and never had one: the address bar stayed on /converter no matter what you picked, so there was no way to hand someone a rate. Now the page reads and writes its own URL. Pick BTC to EUR and type an amount and the address becomes /converter?from=bitcoin&to=EUR&amount=3, a new Copy link button puts that on your clipboard, and opening the link restores both sides and the amount exactly. Alongside that: the asset picker is fully keyboard-driven (arrow keys move the highlight, Enter picks, Escape closes and returns focus to the button you came from), the amount field says what it wants when you type something it cannot use instead of showing a silent dash, a coin whose price failed to load says price unavailable rather than a bare dash, the four quick presets light up when they match what you are looking at and stay disabled until live rates arrive, and the whole widget fits a 320px phone screen, where the currency buttons used to be pushed off the right edge and the picker off the left. (`/converter`) `[feature, improvement, fix]`- **Forgot password now answers in your language, announces itself, and shows a focus ring you can see**: The password-reset request page at /forgot-password was audited end to end in a real browser. Four things were wrong. Its result messages were the only copy on the page not wired into translation, so a visitor reading the page in Spanish typed their email and got the outcome back in English; worse, the first submit permanently reset the button to its English label. Those messages also carried no live-region role, so a screen reader announced nothing at all when the reset link went out and the visitor had no way to know it had. Every link and button on the page fell back to the browser default focus ring, which is a near-black outline drawn on a near-black page: keyboard users could not see where they were. And the avatar beside the form pulsed a loading skeleton forever if its model failed to load, promising something that was never coming. All four are fixed. The result copy, the two failure messages, and the inline email hint now come from the translation catalog, the success notice is announced, focus rings are drawn in a high-contrast accent across every sign-in and account page, and the avatar panel settles into a designed resting state when its model cannot load. The decorative avatar no longer catches Tab, which used to strand keyboard users inside a panel screen readers cannot see. (`/forgot-password`) `[fix, improvement]`- **My Collection loads visibly, keeps its counts, and never mangles an agent's name**: The collection page had a loading state nobody could see: the shimmer placeholders were drawn inside a container the page kept hidden until the data had already arrived, so a slow connection got a blank stretch of nothing instead. The tabs, the placeholders and the counts now appear from the first frame. The counts next to Skills and Subscriptions used to vanish at random, because the page's own translation pass could overwrite the tab label a split second after the number was written into it; the count now lives in its own slot and survives. A skill published by an agent whose name contains a quotation mark or an angle bracket rendered as broken markup rather than as the name, and a publisher who earned a vanity wallet address had it shown as an ordinary one, because the card was reading a field the collection endpoint does not return. Both are fixed, so tipping a creator from your collection now shows the wallet they actually have. Empty states are centred under the tabs instead of squeezed into the first column, both of them now point you at the marketplace, the Retry button on a failed load is a real button rather than a raw grey box, and the whole page is keyboard-navigable: arrow keys move between tabs, Home and End jump to the ends, and every link and button shows a clear focus ring. (`/collection`) `[fix, improvement]`+- **One car in the world: the Trench Car now drives every road in /play**: The cars in a coin world no longer come in four unrelated shapes. Alongside the Trench Car, the community model from the avatar gallery, /play was also parking three procedural box cars in its depots: a boxy sedan, a pickup, and an amber roll-caged buggy on oversized wheels that looked nothing like anything else in the town. All three are gone. Every bay in every world, plaza and depot alike, now parks the Trench Car, so the car that drives past you on the ring road is the car you walk up to, press F, and drive away in. Frontier towns are included: their traffic used to be horse-drawn covered wagons, and it is the same car as everywhere else now. The car still appears the instant a world loads, as a plain silhouette on the same wheels, and fills in with the real model the moment it finishes downloading, so nothing waits on the asset and a slow connection never leaves an empty road. (`/play`) `[improvement, fix]`- **Pausing a skill bundle is no longer permanent, and every tooltip fits on a phone**: The bundle builder at /bundles was audited end to end in a real browser: signing in, picking priced skills, the price panel and its backtest, publishing, the published list, and the loading, empty and error states, at phone, tablet and desktop widths. The worst finding was that Deactivate was a one-way door. It hid the bundle from buyers, which is correct, but it also removed it from the only page that could put it back, so a misclick permanently retired a bundle you had just priced. The button is now called Pause, a paused bundle stays on the page dimmed and clearly marked, and a Reactivate button puts it back on sale. Buyers still never see a paused bundle: the public list is unchanged, and paused ones are returned only to a signed-in owner of that agent. The small question-mark tooltips that explain every number on the page were also cut off at the edge of a phone screen, so four of the seven explanations were partly unreadable at 320 pixels wide; they now shift to stay on screen at any width. The sum of the parts and the suggested price were cramped into a broken-looking two-line squeeze on a narrow screen and now stack cleanly. Finally, a pricing error raised by one agent no longer sits on screen after you switch to another agent, where it read as a verdict on an agent it had never looked at. (`/bundles`) `[fix, improvement]`- **Scene Composer works on a phone, starts you off with real models, and answers the keyboard**: Scene Composer was unusable on anything narrower than a laptop. Below 900px the scene panel was switched off, which pushed the 3D canvas into a zero-width column, so a tablet visitor got no viewport at all and no way back to the hierarchy, inspector or bone-attach controls; at phone widths the toolbar forced the whole editor wider than the screen and shoved the right-hand panel out of view. The panel is now a drawer behind a toolbar button, the toolbar scrolls instead of stretching the layout, and the canvas keeps real dimensions at 320, 768 and 1440 pixels. The Recent Creations strip also no longer greets a first-time visitor with an empty box: until you have forged something it shows the live community showcase, so there are real models to drop into the scene straight away. The avatar picker was asking the directory a question it does not answer and got back a feed of on-chain agents with no 3D model attached, so most slots were silently dropped and the rest never showed their thumbnails; it now asks for public 3D avatars and renders them. The start panel finally honours what it always promised: paste an avatar ID, not just a URL, and a model that cannot be loaded leaves a written explanation instead of a toast that vanishes before you can read it. Both the creations strip and the avatar picker now offer a Try again that works when a request fails. On the keyboard side: the page has a real heading, the camera-view menu and every creation and avatar tile are proper buttons, the scene rows expose their hide and remove actions on focus, the prompt and avatar fields have labels, dialogs trap focus and hand it back on Escape, and there is a visible focus ring throughout. Removing an object now frees its GPU memory once the step drops out of undo range, undo puts a bone-attached item back on its bone, and saving an outfit refuses a locally dropped file rather than storing a link that breaks on reload. (`/compose`) `[fix, improvement]`- **Self-hosted NIM says up front that no endpoint is wired, and a finished reconstruction actually appears on screen**: The /forge-nim page drives a TRELLIS NIM you host yourself, and it was driven end to end in a real browser. It already asked the API on load whether a NIM was configured, then threw the answer away: there was nowhere on the page to show it. So a first-time visitor dropped a photo, waited, and got a failure at the end of the trip, and the failure read as the raw code nim_unconfigured because the page was reading the machine code instead of the sentence next to it. The page now carries a status pill that says whether a NIM is wired and reachable, and when none is, the stage explains that this page needs a NIM you host, offers a button that opens the endpoint field, and links to the hosted forge and the NVIDIA model docs in the meantime; the Reconstruct button stays switched off rather than promising a trip that cannot arrive. Typing your own endpoint now re-probes that box and reports what it found, and an address the server refuses comes back with the reason instead of a silent failure later. The bigger fix was invisible until a reconstruction finished: the 3D viewer had collapsed to zero height, so the model was never even loaded and a completed job showed an empty stage under its own result bar. The viewer now fills the stage. The button also never showed its loading spinner, because translating the page had quietly replaced the label it was written into. The page carries a real heading, the loading and error states announce themselves to screen readers, every control has a visible keyboard focus ring, and it holds up at phone width. (`/forge-nim`) `[fix, improvement]`diff --git a/STRUCTURE.md b/STRUCTURE.mdindex 9a1d19fa4..19b839f79 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -92,7 +92,7 @@ bottom.| `/play` forge-in-world (prompt or photo to a live prop) | Lane client [src/game/forge-prop.js](src/game/forge-prop.js), palette form + `/forge` chat command [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) (`_buildForgeRow()`, `_submitForge()`), placement handler [src/game/coincommunities.js](src/game/coincommunities.js) (`_forgeProp()`), styles [src/game/coincommunities.css](src/game/coincommunities.css), rendering [src/game/world-objects.js](src/game/world-objects.js) (`registerUploadedProp`), server gate [multiplayer/src/build-limits.js](multiplayer/src/build-limits.js) (`normalizePropAssetUrl`) | In-repo | Describe an item in the build palette's Forge form (or type `/forge a glowing campfire` in world chat, or attach a reference photo) and the free draft forge lane generates a real textured GLB in about half a minute. The finished model is registered as a placeable prop and armed, so the next click drops it into the shared world through the SAME `obj:spawn` channel player uploads use: the URL travels on the object, every connected player renders it, and the room persists it like any other build. No new server surface was needed because the durable forge URL (`S3_PUBLIC_DOMAIN`, an `*.r2.dev` host) already satisfies the world asset allow-list; an off-list host is refused with `obj:reject`/`asset_url`. Generation is one-at-a-time per player, and every failure (rate limit, refused prompt, dead upload, timeout) reports a recovery line in the palette's status strip. Docs: [docs/play-forge-in-world.md](docs/play-forge-in-world.md). Tests: [tests/forge-prop.test.js](tests/forge-prop.test.js) || `/play` combat & weapons (server-authoritative, danger zones, wanted, tombstones) | Client: [src/game/combat-system.js](src/game/combat-system.js) `→ /play` (vitals HUD wiring, danger-zone ground, tombstone loot, hit feedback, the `window.twsCombat` bridge into W08's `MobSystem`), HUD [src/game/hud/world-hud.js](src/game/hud/world-hud.js). Server: [multiplayer/src/combat-handlers.js](multiplayer/src/combat-handlers.js) (mob AI, attack/loot intents, death + respawn), pure math [multiplayer/src/combat.js](multiplayer/src/combat.js), weapon/mob/loot tables [multiplayer/src/items.js](multiplayer/src/items.js), zone geometry [multiplayer/src/world-features.js](multiplayer/src/world-features.js), handlers wired in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W07 of the World Online program (program brief retired to git history). Equip a sword/bat/pistol/bow from the hotbar and press `X` (or tap the touch Attack button) to fight; but only inside one of three named danger zones (Southern Wilds, Northern Wilds, Eastern Marches); town stays lawful by construction. PvE mobs chase and swing back through the same server-side damage path a player's attack uses; a kill (mob or PvP) spills a lootable tombstone, PvP raises the attacker's wanted/heat stars (visible on `WorldHud` and a downed peer's nameplate), and death drops carried cash/pack before an automatic respawn in town. || `/play` NPCs & world life (traffic, vendors, quest-givers, mobs) | Manager [src/game/npc/world-life.js](src/game/npc/world-life.js), nav graph [src/game/npc/nav-graph.js](src/game/npc/nav-graph.js), ambient crowd/traffic [src/game/npc/ambient-life.js](src/game/npc/ambient-life.js), quest-giver NPCs [src/game/npc/quest-npcs.js](src/game/npc/quest-npcs.js), quest-zone waypoints [src/game/npc/quest-markers.js](src/game/npc/quest-markers.js), Jobs Board UI [src/game/quests-ui.js](src/game/quests-ui.js), W07-gated mobs [src/game/npc/mobs.js](src/game/npc/mobs.js). Server: quest engine [multiplayer/src/quests.js](multiplayer/src/quests.js), quest zones [multiplayer/src/quest-zones.js](multiplayer/src/quest-zones.js), handlers in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W08 of the World Online program (program brief retired to git history). A deterministic nav graph drives client-side ambient pedestrians + ring-road traffic that read identically for every player without a single packet; real gameplay stays server-authoritative. Five quest-giver NPCs (Dockmaster Reyes, Warden Okoro, Cook Mara, Foreman Dell, The Fixer) front the jobs board the quest engine (W05) already ran server-side but no client ever reached; pressing E opens the real board, accepting a job drops a waypoint at its objective (goto zones auto-complete by walking there, interact zones get their own "press E"), and finishing pays real cash server-side. Hostile mobs are live: W07's `CombatSystem` ([src/game/combat-system.js](src/game/combat-system.js)) installs the `window.twsCombat` contract this module's mobs were built against, so `MobSystem` renders real server-authoritative PvE hostiles with zero changes here. Two jobs; `cross-town-delivery` (North↔South) and `east-west-express` (East↔West); are real driving missions: each `goto` leg is flagged `vehicle: true` and only completes off the authoritative vehicle-driver map ([multiplayer/src/vehicles.js](multiplayer/src/vehicles.js)), so walking through a depot never counts, only driving through it does. Depots sit on the avenue vehicle spawns, so a car is always parked at the start. Tests: [tests/quests-vehicle-delivery.test.js](tests/quests-vehicle-delivery.test.js). |-| `/play` vehicles (the drivable fleet & the Trench Car) | Handling spec + fleet registry [multiplayer/src/vehicles.js](multiplayer/src/vehicles.js), client manager [src/game/vehicles.js](src/game/vehicles.js), meshes [src/game/vehicle-mesh.js](src/game/vehicle-mesh.js), shared GLB loader [src/game/vehicle-model.js](src/game/vehicle-model.js), staged model [public/vehicles/](public/vehicles) (built by [scripts/build-trench-car.mjs](scripts/build-trench-car.mjs), `npm run build:trench-car`), Rapier chassis [src/physics/physics-world.js](src/physics/physics-world.js), server gate + anti-cheat [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W02 of the World Online program. Real cars you drive with WASD (touch gets pedals and a wheel), simulated locally on the SAME Rapier world the character controller uses, so a car collides with the town exactly as a walking avatar does, and relayed through a server that validates per-type speed and bounds and owns who may drive what. The world's default car is the **Trench Car**, a community model from the avatar gallery (`trench-car`): ambient traffic drives it ([src/game/npc/ambient-life.js](src/game/npc/ambient-life.js)) and it is parked at both plaza bays and the North Depot, so the car you watch go past is the car you can get into. Model-backed types build a procedural stand-in instantly and swap the GLB body and wheels into the same group and pivots when the download lands, so a car that upgrades mid-drive keeps its physics, camera and driver, and a failed download still leaves a drivable car. One shared template per model; only the brake-light material is per car. Drivers sit in a seated pose that peers see too (server-authored `drive` motion). Docs: [docs/play-vehicles.md](docs/play-vehicles.md). Tests: [tests/vehicles-trench-car.test.js](tests/vehicles-trench-car.test.js), [tests/e2e/play-vehicles.spec.js](tests/e2e/play-vehicles.spec.js), [tests/quests-vehicle-delivery.test.js](tests/quests-vehicle-delivery.test.js); real-Rapier repro `node scripts/verify-w02-physics-core.mjs trench` |+| `/play` vehicles (the drivable fleet & the Trench Car) | Handling spec + fleet registry [multiplayer/src/vehicles.js](multiplayer/src/vehicles.js), client manager [src/game/vehicles.js](src/game/vehicles.js), meshes [src/game/vehicle-mesh.js](src/game/vehicle-mesh.js), shared GLB loader [src/game/vehicle-model.js](src/game/vehicle-model.js), staged model [public/vehicles/](public/vehicles) (built by [scripts/build-trench-car.mjs](scripts/build-trench-car.mjs), `npm run build:trench-car`), Rapier chassis [src/physics/physics-world.js](src/physics/physics-world.js), server gate + anti-cheat [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W02 of the World Online program. Real cars you drive with WASD (touch gets pedals and a wheel), simulated locally on the SAME Rapier world the character controller uses, so a car collides with the town exactly as a walking avatar does, and relayed through a server that validates per-type speed and bounds and owns who may drive what. The **Trench Car**, a community model from the avatar gallery (`trench-car`), is the only car in the world: ambient traffic drives it in every town ([src/game/npc/ambient-life.js](src/game/npc/ambient-life.js)) and it is parked in every vehicle bay, so the car you watch go past is the car you can get into (the four procedural box types it used to share the road with were retired 2026-08-17). A car builds a procedural stand-in instantly and swaps the GLB body and wheels into the same group and pivots when the download lands, so a car that upgrades mid-drive keeps its physics, camera and driver, and a failed download still leaves a drivable car. One shared template per model; only the brake-light material is per car. Drivers sit in a seated pose that peers see too (server-authored `drive` motion). Docs: [docs/play-vehicles.md](docs/play-vehicles.md). Tests: [tests/vehicles-trench-car.test.js](tests/vehicles-trench-car.test.js), [tests/e2e/play-vehicles.spec.js](tests/e2e/play-vehicles.spec.js), [tests/quests-vehicle-delivery.test.js](tests/quests-vehicle-delivery.test.js); real-Rapier repro `node scripts/verify-w02-physics-core.mjs trench` || Frame governor & power saver (`/play`, `/club`, `/walk`) | [src/shared/frame-governor.js](src/shared/frame-governor.js), wired in [src/game/coincommunities.js](src/game/coincommunities.js), [src/club.js](src/club.js), [src/club-entrance.js](src/club-entrance.js), [src/walk.js](src/walk.js); toggle UI in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) | Live | Shared frame-rate governor for the heavy 3D surfaces: 60fps while active, 30fps when idle or unfocused, plus a user-facing Power-saver mode (30fps + lighter rendering, "for a cooler, quieter machine") persisted in localStorage `tws-power-saver` and shared across surfaces (`getPowerSaver`/`setPowerSaver`/`onPowerSaverChange`, `trackWindowFocus`). Tests: [tests/frame-governor.test.js](tests/frame-governor.test.js) || `/play` safety & lifecycle invariants | Doc [docs/play-hardening.md](docs/play-hardening.md) `→ /docs/play-hardening`. Guards: `cssBgImage()` + `clampParam()` + `isPlausibleMint()` in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) / [src/game/coincommunities.js](src/game/coincommunities.js), avatar template cache + `releaseAvatar()` in [src/game/avatar-rig.js](src/game/avatar-rig.js), reconnect pruning (`_markRemotesStale`/`_pruneStaleRemotes`) and `_disposeObject3D()` in [src/game/coincommunities.js](src/game/coincommunities.js). Harnesses: [scripts/play-desktop-audit.mjs](scripts/play-desktop-audit.mjs), [scripts/play-mobile-repro.mjs](scripts/play-mobile-repro.mjs) | Live | The rules that keep the platform's largest interactive surface safe, honest and phone-survivable, each written against a failure that actually shipped: untrusted display names and coin metadata never become markup or CSS (a tombstone owner's name once ran as HTML for everyone who walked past it; a crafted coin `image_uri` could paint a full-screen overlay across the lobby), a malformed `?coin=` is refused instead of building a convincing world nobody else can join, a *valid* `?coin=` that lost the rest of its query (a hand-typed link, a truncated share, an unfurl that kept only the mint) is named from the coin feed by `_fetchCoinIdentity()`/`mergeCoinIdentity()` instead of building a real district under a totem reading "COMMUNITY" with a blank market cap, a reconnect retires the peers who left rather than accumulating frozen ghosts and a tripled headcount, and everything the world loads (crowd/NPC GLBs, the sun's 2048² shadow map, totem, jumbotron, dance floor, district, environment) is genuinely freed on the way out instead of held until the tab is killed. Tests: [tests/play-deeplink-safety.test.js](tests/play-deeplink-safety.test.js), [tests/play-deeplink-identity.test.js](tests/play-deeplink-identity.test.js) || Cinematic rendering (shared 3D quality bar) | [src/shared/cinematic-render.js](src/shared/cinematic-render.js) — `applyCinematicDefaults()`, `loadEnvironment()`, `detectQualityTier()`, `updateGroundContactShadow()`; curated HDRIs in [public/hdri/](public/hdri) (CC0, Poly Haven) | Live, wired into every three.js viewer on the platform (`/irl`, talk mode, `/play`, `/club`, `/ar`, `/xr`, `/walk`, `/coin3d`, marketplace lobby, demo pages, the `<agent-3d>`/`<page-agent>` embeds, and more) | One module every WebGLRenderer-based viewer calls into instead of re-deriving ACES tone mapping, sRGB output color space, HDRI image-based lighting, and soft VSM shadows per file. `detectQualityTier()` picks high/medium/mobile from real device signals and caps pixel ratio + disables shadows/HDRI accordingly; `loadEnvironment()` fetches a real photographic HDRI (`studio`/`outdoor`/`sunset`) and falls back to a procedural room environment on mobile tier or fetch failure (including cross-origin embed contexts where the absolute `/hdri/*.hdr` URL can't resolve). `/walk` keeps its own richer per-biome HDR system ([src/walk-environments.js](src/walk-environments.js)); surfaces already running a postprocessing tone-mapping pass (`/oracle-graph`, `/club-entrance`) only take the sRGB/HDRI half to avoid double-applying the curve. |diff --git a/data/changelog.json b/data/changelog.jsonindex 99bbffd0e..f80426fef 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -1,6 +1,16 @@{"$comment": "Curated changelog entries for three.ws, the editorial layer of the public changelog. New PAGE launches are tracked automatically via the `added` field in data/pages.json; this file is for everything else holders care about: improvements, fixes, SDK releases, trading/payments capabilities, security work. scripts/build-page-index.mjs merges both sources into CHANGELOG.md, public/changelog.json, and public/changelog.xml. Newest first. Allowed tags: feature, improvement, fix, sdk, infra, docs, security. `link` is optional and must be a live three.ws path.","entries": [+ {+ "date": "2026-08-17",+ "title": "One car in the world: the Trench Car now drives every road in /play",+ "summary": "The cars in a coin world no longer come in four unrelated shapes. Alongside the Trench Car, the community model from the avatar gallery, /play was also parking three procedural box cars in its depots: a boxy sedan, a pickup, and an amber roll-caged buggy on oversized wheels that looked nothing like anything else in the town. All three are gone. Every bay in every world, plaza and depot alike, now parks the Trench Car, so the car that drives past you on the ring road is the car you walk up to, press F, and drive away in. Frontier towns are included: their traffic used to be horse-drawn covered wagons, and it is the same car as everywhere else now. The car still appears the instant a world loads, as a plain silhouette on the same wheels, and fills in with the real model the moment it finishes downloading, so nothing waits on the asset and a slow connection never leaves an empty road.",+ "tags": [+ "improvement",+ "fix"+ ],+ "link": "/play"+ },{"date": "2026-08-17","title": "Trading Swarms reads on a phone, says what actually went wrong, and lets you get back to the full directory",diff --git a/docs/play-vehicles.md b/docs/play-vehicles.mdindex d20e06e95..7cc548a40 100644--- a/docs/play-vehicles.md+++ b/docs/play-vehicles.md@@ -4,10 +4,13 @@ Every coin world in [`/play`](https://three.ws/play) has cars in it. They are noyou walk past: the same car that drives by you on the ring road is the car parked at theplaza that you can get into and drive across town.-The world's default car is the **Trench Car**, a community model published to the three.ws+The car is the **Trench Car**, a community model published to the three.wsavatar gallery ([avatar `e702d59a-d29f-4f21-af8a-6400dd1a2c6f`](https://three.ws/avatars/e702d59a-d29f-4f21-af8a-6400dd1a2c6f),-slug `trench-car`). It is what ambient traffic drives, what is parked at the two plaza bays-and the North Depot, and what an unknown vehicle type falls back to.+slug `trench-car`), and it is the *only* car in the world: it is what ambient traffic drives+in every town (frontier ones included), what is parked in all six vehicle bays, and what an+unknown vehicle type falls back to. There is no fleet of mismatched shapes; four procedural+box cars (coupe, sedan, pickup, buggy) used to share the road with it and were retired on+2026-08-17.## Driving one@@ -41,14 +44,14 @@ A car is three things that all have to agree, or it looks wrong or drives wrong:|---|---|---|| Handling spec | [multiplayer/src/vehicles.js](../multiplayer/src/vehicles.js) | Mass, forces, top speed, dimensions, wheel geometry, suspension, seat. Shared by client and server, so "feels fast" and "rejected as cheating" can never drift apart. || Physics chassis | [src/physics/physics-world.js](../src/physics/physics-world.js) | A Rapier raycast vehicle controller built from that spec. |-| The mesh | [src/game/vehicle-mesh.js](../src/game/vehicle-mesh.js), [src/game/vehicle-model.js](../src/game/vehicle-model.js) | What you look at: either a procedural silhouette or a GLB. |+| The mesh | [src/game/vehicle-mesh.js](../src/game/vehicle-mesh.js), [src/game/vehicle-model.js](../src/game/vehicle-model.js) | What you look at: the GLB, plus the procedural stand-in silhouette that holds its place while the model downloads. |The mesh group's origin is the **chassis centre**, `+z` is forward, and the four wheels arepivot/spinner pairs the vehicle controller writes suspension, steering and roll into everyframe. A GLB is authored with its contact patch on the road, so it is dropped into chassisspace by `vehicleRestHeight()`.-Model-backed cars never block the world on a download. `buildVehicleMesh()` returns its+A car never blocks the world on a download. `buildVehicleMesh()` returns itsprocedural stand-in immediately and swaps the GLB body and wheels into the *same* group andthe *same* wheel pivots when the model lands, so a car that upgrades mid-drive keeps itsphysics, its camera and its driver. If the model cannot be fetched at all, the stand-in@@ -80,6 +83,9 @@ and the metal-roughness map at 1024px, and writessits with its contact patch at `y = 0`, facing `+z`. Stage it into `public/vehicles/`.2. Add a type to `VEHICLE_TYPES` with a `model` key, and measure `dims`, `wheel` and`suspension` off the mesh. `dims.h` is road-to-roof, not the body's own bounding box.+ Nothing spawns it until a `VEHICLE_SPAWNS` bay names it, and+ `tests/vehicles-trench-car.test.js` pins the fleet as Trench-Car-only, so a second car in+ the world is a deliberate change to that test, not an accident.3. Check the clearance rule: the chassis collider's underside sits `1.3 * (h / 2)` below thebody origin, so `vehicleRestHeight()` has to clear it. Too little and the hull rests onthe road and its own friction pins the car, whatever the engine force says.diff --git a/multiplayer/src/vehicles.js b/multiplayer/src/vehicles.jsindex 159a69762..b8422a98b 100644--- a/multiplayer/src/vehicles.js+++ b/multiplayer/src/vehicles.js@@ -15,17 +15,19 @@// speed, and it owns who is allowed to drive which vehicle.// Handling profiles. Lengths in metres, mass in kg, forces in Newtons, speeds in-// m/s, angles in radians. Each type has a distinct feel:-// trench: the world's default car, the Trench Car GLB, balanced and quick-// coupe — low, fast, light, twitchy steering, less grip (slides)-// sedan — the balanced everyday car-// pickup — heavy, slower, planted, wide turning, lots of grip-// buggy — light off-roader, high grip + stiff suspension, nimble+// m/s, angles in radians.//-// A type with a `model` drives a real GLB (src/game/vehicle-model.js) instead of-// the procedural silhouettes in src/game/vehicle-mesh.js. Its dims, wheel-// geometry and seat are measured off that mesh, so the physics chassis, the-// wheels the player watches turn, and the driver in the seat all agree.+// The Trench Car is the world's ONLY car (owner directive 2026-08-17): every+// parked vehicle a player can take the wheel of and every car ambient traffic+// drives is this one model, so the fleet reads as one coherent world instead of+// a mix of boxy procedural silhouettes (a coupe/sedan/pickup/buggy table used to+// live here, and the amber buggy in particular looked nothing like the rest of+// the town). Handling variety, if it ever comes back, comes back as real models.+//+// `model` names a real GLB (src/game/vehicle-model.js) rather than a procedural+// silhouette. Its dims, wheel geometry and seat are measured off that mesh, so+// the physics chassis, the wheels the player watches turn, and the driver in the+// seat all agree.export const VEHICLE_TYPES = {trench: {id: 'trench',@@ -48,109 +50,24 @@ export const VEHICLE_TYPES = {// collider wraps the whole visible car.dims: { l: 4.31, w: 1.85, h: 1.31 },wheel: { radius: 0.3, halfWidth: 0.11, inset: 0.22, frontZ: 1.21, rearZ: -1.29 },- // rest=0.58 follows the clearance rule the other types learned the hard- // way (see coupe below): the chassis collider's underside sits+ // rest=0.58 satisfies the clearance rule the retired procedural types+ // learned the hard way: the chassis collider's underside sits// 1.3 * (h/2) below the body origin, so the resting chassis centre- // (vehicleRestHeight = 1.011) has to clear it. 0.58 leaves 0.16 m of air- // under the collider, matching the sedan's proven margin, so the wheels- // carry the car instead of the hull grinding on the road.+ // (vehicleRestHeight = 1.011) has to clear it. Too little lift and the hull+ // rests on the road, where its own friction pins the car no matter how much+ // engine force is applied (verified against real Rapier in+ // scripts/verify-w02-physics-core.mjs). 0.58 leaves 0.16 m of air under the+ // collider, so the wheels carry the car instead of the hull grinding along.+ // tests/vehicles-trench-car.test.js holds that margin.suspension: { rest: 0.58, stiffness: 25, travel: 0.18, compression: 0.84, relax: 0.9 },- // Driver's seat: the model's footwell floor, 0.30 m above the road.+ // Driver's seat, as the offset from the chassis CENTRE to where the driver's+ // rig origin (their feet) belongs: the model's footwell floor, 0.30 m above+ // the road, which is below the chassis centre, hence the negative y. Both+ // the client (VehicleManager._seatAvatar) and the server (WalkRoom's rider+ // height) read this, so a driver sits in the same place for everyone.seat: { x: -0.42, y: -0.71, z: -0.15 },color: 0x1b1d22,},- coupe: {- id: 'coupe',- label: 'Coupe',- mass: 1100,- topSpeed: 28, // ~100 km/h- engineForce: 5200, // forward drive force per powered axle- brakeForce: 110,- reverseForce: 2600,- steerMax: 0.52, // max front-wheel steer angle- steerSpeed: 3.2, // how fast steering approaches the target (per second)- grip: 1.9, // wheel friction slip — lower = looser tail- dims: { l: 4.1, w: 1.85, h: 1.05 },- wheel: { radius: 0.34, halfWidth: 0.18, inset: 0.16, frontZ: 1.35, rearZ: -1.3 },- // rest=0.4, not the more "sporty-low" 0.32 it started at: verified against- // the real Rapier raycast vehicle controller (createVehicle in- // src/physics/physics-world.js) that at 0.32 the chassis collider (offset- // -0.3*hy below the body origin) settles low enough to rest on/against the- // ground itself, so its own friction pins the car almost dead still no- // matter how much engine force is applied (0.61 m/s after 3s of full- // throttle in a scripted repro — scripts/verify-w02-physics-core.mjs).- // 0.4 gives the chassis clearance over the wheel contact line so the wheels- // (not the hull) carry the car's weight and traction (10.8 m/s after the- // same 3s in the same repro).- suspension: { rest: 0.4, stiffness: 26, travel: 0.16, compression: 0.82, relax: 0.88 },- // Driver's seat, as the offset from the chassis CENTRE to where the- // driver's rig origin (their feet) belongs: the footwell floor, which is- // below the chassis centre on every car, hence the negative y. Both the- // client (VehicleManager._seatAvatar) and the server (WalkRoom's rider- // height) read this, so a driver sits in the same place for everyone.- seat: { x: -0.42, y: -0.53, z: -0.2 },- color: 0xc8402f,- },- sedan: {- id: 'sedan',- label: 'Sedan',- mass: 1350,- topSpeed: 24,- engineForce: 4600,- brakeForce: 120,- reverseForce: 2400,- steerMax: 0.5,- steerSpeed: 2.6,- grip: 2.3,- dims: { l: 4.4, w: 1.9, h: 1.25 },- wheel: { radius: 0.36, halfWidth: 0.19, inset: 0.16, frontZ: 1.45, rearZ: -1.4 },- // rest=0.5 (was 0.36 — same chassis-clearance bug as coupe's, see its- // comment above; a taller sedan needed more lift than the coupe did).- // Verified: stock 0.36 never moves (0.00 m/s after 3s full throttle) in- // the real-Rapier repro; 0.5 reaches 7.9 m/s in the same window.- suspension: { rest: 0.5, stiffness: 24, travel: 0.18, compression: 0.85, relax: 0.9 },- seat: { x: -0.44, y: -0.61, z: -0.1 },- color: 0x2f6fc8,- },- pickup: {- id: 'pickup',- label: 'Pickup',- mass: 1950,- topSpeed: 21,- engineForce: 6200,- brakeForce: 150,- reverseForce: 3000,- steerMax: 0.46,- steerSpeed: 2.1,- grip: 2.7,- dims: { l: 5.0, w: 2.05, h: 1.5 },- wheel: { radius: 0.42, halfWidth: 0.22, inset: 0.14, frontZ: 1.6, rearZ: -1.55 },- // rest=0.6 (was 0.42 — the same chassis-clearance bug, worst here because- // the pickup is the tallest chassis: h=1.5). At 0.42 it was FULLY pinned —- // speed stayed ~0.00 m/s even at 10x its stock engine force in the- // real-Rapier repro. 0.6 clears the chassis off the ground and reaches- // 4.1 m/s in 3s, matching a heavy/planted truck's slower character.- suspension: { rest: 0.6, stiffness: 22, travel: 0.22, compression: 0.85, relax: 0.9 },- seat: { x: -0.5, y: -0.55, z: 0.35 },- color: 0x2b2f36,- },- buggy: {- id: 'buggy',- label: 'Buggy',- mass: 850,- topSpeed: 25,- engineForce: 4200,- brakeForce: 100,- reverseForce: 2200,- steerMax: 0.6,- steerSpeed: 3.6,- grip: 3.0,- dims: { l: 3.4, w: 1.8, h: 1.0 },- wheel: { radius: 0.4, halfWidth: 0.24, inset: 0.06, frontZ: 1.2, rearZ: -1.15 },- suspension: { rest: 0.46, stiffness: 28, travel: 0.26, compression: 0.8, relax: 0.86 },- seat: { x: -0.4, y: -0.62, z: -0.1 },- color: 0xe0a52e,- },};export const VEHICLE_TYPE_IDS = Object.keys(VEHICLE_TYPES);@@ -186,15 +103,14 @@ export function vehicleRestHeight(type) {// plaza-edge cars sit near the Downtown spawn so a freshly-dropped player finds a// ride within a few seconds' walk (clear of the totem (0,0,-12), the jumbotron// (0,0,-30) and the Agent Exchange (8,0,-6)). yaw is the resting heading (0 = +z).-// The default car takes the two plaza bays and the North Depot, so the first-// vehicle a player ever walks up to is the one ambient traffic is driving past-// them; the other depots keep the handling variety.+// Every bay parks the Trench Car: the car a player walks up to anywhere in the+// world is the same one ambient traffic is driving past them.export const VEHICLE_SPAWNS = [// Avenue bays — keep in sync with world-zones.js type:'vehicle' points.{ id: 'veh-north-ave', type: 'trench', x: 6, z: -90, yaw: 0 },- { id: 'veh-south-ave', type: 'sedan', x: -6, z: 90, yaw: Math.PI },- { id: 'veh-east-ave', type: 'pickup', x: 90, z: 6, yaw: -Math.PI / 2 },- { id: 'veh-west-ave', type: 'buggy', x: -90, z: -6, yaw: Math.PI / 2 },+ { id: 'veh-south-ave', type: 'trench', x: -6, z: 90, yaw: Math.PI },+ { id: 'veh-east-ave', type: 'trench', x: 90, z: 6, yaw: -Math.PI / 2 },+ { id: 'veh-west-ave', type: 'trench', x: -90, z: -6, yaw: Math.PI / 2 },// Plaza-edge starters for discoverability.{ id: 'veh-plaza-1', type: 'trench', x: -16, z: 14, yaw: Math.PI },{ id: 'veh-plaza-2', type: 'trench', x: 18, z: 14, yaw: Math.PI },diff --git a/public/changelog.json b/public/changelog.jsonindex 8b5323a1b..1b4d36015 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-17T13:53:45.524Z",+ "generated_at": "2026-08-17T14:14:53.946Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -258,6 +258,17 @@"improvement"]},+ {+ "date": "2026-08-17",+ "type": "update",+ "title": "One car in the world: the Trench Car now drives every road in /play",+ "summary": "The cars in a coin world no longer come in four unrelated shapes. Alongside the Trench Car, the community model from the avatar gallery, /play was also parking three procedural box cars in its depots: a boxy sedan, a pickup, and an amber roll-caged buggy on oversized wheels that looked nothing like anything else in the town. All three are gone. Every bay in every world, plaza and depot alike, now parks the Trench Car, so the car that drives past you on the ring road is the car you walk up to, press F, and drive away in. Frontier towns are included: their traffic used to be horse-drawn covered wagons, and it is the same car as everywhere else now. The car still appears the instant a world loads, as a plain silhouette on the same wheels, and fills in with the real model the moment it finishes downloading, so nothing waits on the asset and a slow connection never leaves an empty road.",+ "link": "/play",+ "tags": [+ "improvement",+ "fix"+ ]+ },{"date": "2026-08-17","type": "update",diff --git a/public/changelog.xml b/public/changelog.xmlindex 722073115..ad7c99c0d 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -190,6 +190,14 @@<category>fix</category><description>The collection page had a loading state nobody could see: the shimmer placeholders were drawn inside a container the page kept hidden until the data had already arrived, so a slow connection got a blank stretch of nothing instead. The tabs, the placeholders and the counts now appear from the first frame. The counts next to Skills and Subscriptions used to vanish at random, because the page's own translation pass could overwrite the tab label a split second after the number was written into it; the count now lives in its own slot and survives. A skill published by an agent whose name contains a quotation mark or an angle bracket rendered as broken markup rather than as the name, and a publisher who earned a vanity wallet address had it shown as an ordinary one, because the card was reading a field the collection endpoint does not return. Both are fixed, so tipping a creator from your collection now shows the wallet they actually have. Empty states are centred under the tabs instead of squeezed into the first column, both of them now point you at the marketplace, the Retry button on a failed load is a real button rather than a raw grey box, and the whole page is keyboard-navigable: arrow keys move between tabs, Home and End jump to the ends, and every link and button shows a clear focus ring.</description></item>+ <item>+ <title>One car in the world: the Trench Car now drives every road in /play</title>+ <link>https://three.ws/play</link>+ <guid isPermaLink="false">2026-08-17:One car in the world: the Trench Car now drives every road in /play</guid>+ <pubDate>Mon, 17 Aug 2026 12:00:00 GMT</pubDate>+ <category>improvement</category>+ <description>The cars in a coin world no longer come in four unrelated shapes. Alongside the Trench Car, the community model from the avatar gallery, /play was also parking three procedural box cars in its depots: a boxy sedan, a pickup, and an amber roll-caged buggy on oversized wheels that looked nothing like anything else in the town. All three are gone. Every bay in every world, plaza and depot alike, now parks the Trench Car, so the car that drives past you on the ring road is the car you walk up to, press F, and drive away in. Frontier towns are included: their traffic used to be horse-drawn covered wagons, and it is the same car as everywhere else now. The car still appears the instant a world loads, as a plain silhouette on the same wheels, and fills in with the real model the moment it finishes downloading, so nothing waits on the asset and a slow connection never leaves an empty road.</description>+ </item><item><title>Pausing a skill bundle is no longer permanent, and every tooltip fits on a phone</title><link>https://three.ws/bundles</link>diff --git a/public/features.json b/public/features.jsonindex cb11b16e9..4cf95bb29 100644--- a/public/features.json+++ b/public/features.json@@ -1,5 +1,5 @@{- "generated_at": "2026-08-17T13:53:45.413Z",+ "generated_at": "2026-08-17T14:14:53.937Z","generated_by": "scripts/build-page-index.mjs from data/pages.json","site": {"name": "three.ws",diff --git a/scripts/verify-w02-physics-core.mjs b/scripts/verify-w02-physics-core.mjsindex 3da3713d5..dd0346d13 100644--- a/scripts/verify-w02-physics-core.mjs+++ b/scripts/verify-w02-physics-core.mjs@@ -15,7 +15,7 @@ async function main() {// Any type in the table can be put through this, so a new car's suspension and// clearance are proved against real Rapier before it ships:// node scripts/verify-w02-physics-core.mjs trench- const type = process.argv[2] || 'sedan';+ const type = process.argv[2] || 'trench';const spec = vehicleSpec(type);if (spec.id !== type && process.argv[2]) fail(`unknown vehicle type "${type}", fell back to ${spec.id}`);console.log(`--- vehicle type under test: ${spec.id} (${spec.label}) ---`);diff --git a/src/agent-screen-world.js b/src/agent-screen-world.jsindex 2161be17d..1e8d13337 100644--- a/src/agent-screen-world.js+++ b/src/agent-screen-world.js@@ -86,7 +86,7 @@ export function createAmbientWorld({ agentId, seed, container, cycleMs = DEFAULTconst env = createWorldEnvironment(scene, renderer, PLAY_RADIUS, { seed: numericSeed });const nav = new NavGraph({ radius: NAV_RADIUS, seed: numericSeed });- const ambient = new AmbientLife({ scene, nav, biome: env.biome });+ const ambient = new AmbientLife({ scene, nav });const cycle = createDayNightCycle(env);const landmark = landmarkFor(env.biome);diff --git a/src/game/npc/ambient-life.js b/src/game/npc/ambient-life.jsindex 7cde31402..3eb871c39 100644--- a/src/game/npc/ambient-life.js+++ b/src/game/npc/ambient-life.js@@ -31,7 +31,7 @@ const DEFAULT_AVATAR = '/avatars/default.glb';const PED_WALK_SPEED = 1.35; // m/s along the loop, an unhurried strollconst DETAILED_PEDS = 6; // GLB-bodied pedestrians near the centreconst IMPOSTOR_PEDS = 14; // cheap instanced crowd in the distance-const VEHICLES = 5; // cars/wagons on the ring road+const VEHICLES = 5; // cars on the ring roadconst VEHICLE_SPEED = 6.5; // m/sconst PED_AVOID_RADIUS = 2.0; // how close before a ped sidesteps the playerconst CAR_BRAKE_RADIUS = 5.5; // how close before a car yields to the player@@ -195,17 +195,19 @@ class Pedestrian {}}-// ---- vehicle (grouped, biome-styled) -----------------------------------------+// ---- vehicle (the Trench Car, on the ring road) --------------------------------// Build a low-poly vehicle. style 'wagon' for frontier towns, 'car' elsewhere.-// Shared unit geometry scaled per part keeps a vehicle to a handful of meshes.+// Build the low-poly stand-in car. Shared unit geometry scaled per part keeps a+// vehicle to a handful of meshes.//-// Modern towns upgrade the 'car' silhouette to the Trench Car GLB as soon as the-// shared model lands (see Vehicle._upgradeToModel), the same model the drivable-// fleet uses, so the traffic a player watches go by is the traffic they can flag-// down and take the wheel of. This box car is the instant stand-in that holds-// the road until then, and the permanent body if the model can't be fetched.-function buildVehicle(style) {+// Traffic is the Trench Car GLB in EVERY town, frontier ones included (owner+// directive 2026-08-17: it is the one car in the world). The same model the+// drivable fleet wears, so the traffic a player watches go by is the traffic they+// can flag down and take the wheel of. Each vehicle upgrades itself the moment+// the shared model lands (see Vehicle._upgradeToModel); this box car is the+// instant stand-in that holds the road until then, and the permanent body if the+// model can't be fetched.+function buildVehicle() {const g = new Group();const box = new BoxGeometry(1, 1, 1);const wheelGeo = new CylinderGeometry(0.34, 0.34, 0.22, 12);@@ -219,30 +221,19 @@ function buildVehicle(style) {g.add(w); wheels.push(w);};- let brakeLights = null;- if (style === 'wagon') {- const bodyMat = new MeshStandardMaterial({ color: 0x6e5238, roughness: 1 });- const coverMat = new MeshStandardMaterial({ color: 0xd8cdb0, roughness: 1 });- const body = new Mesh(box, bodyMat); body.scale.set(1.5, 0.7, 3.0); body.position.y = 0.75; body.castShadow = true; g.add(body);- const cover = new Mesh(box, coverMat); cover.scale.set(1.45, 1.0, 2.2); cover.position.set(0, 1.45, -0.1); cover.castShadow = true; g.add(cover);- // A simple draft animal up front so a wagon isn't gliding on its own.- const horse = new Mesh(box, new MeshStandardMaterial({ color: 0x3a2a1e, roughness: 1 }));- horse.scale.set(0.7, 0.9, 1.4); horse.position.set(0, 0.9, 2.4); horse.castShadow = true; g.add(horse);- addWheel(-0.85, 1.0); addWheel(0.85, 1.0); addWheel(-0.85, -1.0); addWheel(0.85, -1.0);- } else {- const bodyMat = new MeshStandardMaterial({ color: 0x2b3340, roughness: 0.5, metalness: 0.3 });- const cabinMat = new MeshStandardMaterial({ color: 0x10151c, roughness: 0.3, metalness: 0.2 });- const body = new Mesh(box, bodyMat); body.scale.set(1.7, 0.7, 3.6); body.position.y = 0.62; body.castShadow = true; g.add(body);- const cabin = new Mesh(box, cabinMat); cabin.scale.set(1.5, 0.7, 1.9); cabin.position.set(0, 1.15, -0.1); cabin.castShadow = true; g.add(cabin);- const head = new Mesh(box, new MeshBasicMaterial({ color: 0xfff3cf })); head.scale.set(1.5, 0.16, 0.1); head.position.set(0, 0.62, 1.81); g.add(head);- brakeLights = new Mesh(box, new MeshBasicMaterial({ color: 0x551111 })); brakeLights.scale.set(1.5, 0.18, 0.1); brakeLights.position.set(0, 0.62, -1.81); g.add(brakeLights);- addWheel(-0.92, 1.15); addWheel(0.92, 1.15); addWheel(-0.92, -1.2); addWheel(0.92, -1.2);- }+ const bodyMat = new MeshStandardMaterial({ color: 0x2b3340, roughness: 0.5, metalness: 0.3 });+ const cabinMat = new MeshStandardMaterial({ color: 0x10151c, roughness: 0.3, metalness: 0.2 });+ const body = new Mesh(box, bodyMat); body.scale.set(1.7, 0.7, 3.6); body.position.y = 0.62; body.castShadow = true; g.add(body);+ const cabin = new Mesh(box, cabinMat); cabin.scale.set(1.5, 0.7, 1.9); cabin.position.set(0, 1.15, -0.1); cabin.castShadow = true; g.add(cabin);+ const head = new Mesh(box, new MeshBasicMaterial({ color: 0xfff3cf })); head.scale.set(1.5, 0.16, 0.1); head.position.set(0, 0.62, 1.81); g.add(head);+ const brakeLights = new Mesh(box, new MeshBasicMaterial({ color: 0x551111 })); brakeLights.scale.set(1.5, 0.18, 0.1); brakeLights.position.set(0, 0.62, -1.81); g.add(brakeLights);+ addWheel(-0.92, 1.15); addWheel(0.92, 1.15); addWheel(-0.92, -1.2); addWheel(0.92, -1.2);+return { group: g, wheels, brakeLights };}class Vehicle {- constructor(scene, nav, { phase, lane, style, dir }) {+ constructor(scene, nav, { phase, lane, dir }) {this.nav = nav;this.phase = phase;this.lane = lane;@@ -254,14 +245,14 @@ class Vehicle {this._braking = false;this.group = new Group();- const built = buildVehicle(style);+ const built = buildVehicle();this.group.add(built.group);this._standIn = built.group;this.wheels = built.wheels; // spun by update(), whichever body is onthis.brakeLights = built.brakeLights;scene.add(this.group);- if (style === 'car') this._upgradeToModel();+ this._upgradeToModel();}// Swap the box stand-in for the real car. The model is shared with every other@@ -337,10 +328,9 @@ export class AmbientLife {// `onInspectPed` (optional) makes the detailed pedestrians selectable: called// with the Pedestrian when a player clicks its nameplate or body. The world// manager wires it to the citizen profile card (see citizens.js).- constructor({ scene, nav, biome, onInspectPed }) {+ constructor({ scene, nav, onInspectPed }) {this.scene = scene;this.nav = nav;- this.biome = biome;this.onInspectPed = onInspectPed || null;this.peds = [];this.vehicles = [];@@ -383,7 +373,6 @@ export class AmbientLife {_buildVehicles() {const rand = mulberry32((this.nav.seed ^ 0x85ebca6b) >>> 0);- const style = this.biome?.town === 'frontier' ? 'wagon' : 'car';const spacing = this.nav.roadLen / VEHICLES;for (let i = 0; i < VEHICLES; i++) {const dir = i % 2 === 0 ? 1 : -1;@@ -392,7 +381,6 @@ export class AmbientLife {phase: i * spacing + rand() * spacing * 0.4,lane,dir,- style,}));}}diff --git a/src/game/npc/world-life.js b/src/game/npc/world-life.jsindex e28b7d70a..3096010e1 100644--- a/src/game/npc/world-life.js+++ b/src/game/npc/world-life.js@@ -51,7 +51,6 @@ export class WorldLife {this.ambient = new AmbientLife({scene,nav: this.nav,- biome: world?.biome,// Any detailed pedestrian with a gallery identity is selectable: its// profile card opens with the real agent behind the avatar, and a// "Talk 1-on-1" that starts a live in-character conversation.diff --git a/src/game/vehicle-mesh.js b/src/game/vehicle-mesh.jsindex 53da61560..177e15b70 100644--- a/src/game/vehicle-mesh.js+++ b/src/game/vehicle-mesh.js@@ -1,13 +1,15 @@// Vehicle meshes for the drivable fleet.//-// Two kinds of car live here. Procedural silhouettes (coupe / sedan / pickup /-// buggy) are built from primitives so they load instantly and theme to each-// vehicle's colour. Model-backed types (the Trench Car, VEHICLE_TYPES.trench)-// carry a `model` key and drive a real GLB from src/game/vehicle-model.js: the-// procedural silhouette is built first as an instant stand-in, and the GLB body-// and wheels are swapped into the SAME group and wheel pivots the moment the-// download lands. Nothing downstream re-binds, so a car that upgrades mid-drive-// keeps its physics, its camera and its driver.+// Every car in the world is the Trench Car (VEHICLE_TYPES.trench), a real GLB+// loaded by src/game/vehicle-model.js. Because that GLB is a download and a+// player can walk up to a car before it lands, each vehicle is built with a+// procedural stand-in silhouette first: a primitive car sized from the type's own+// dims and tinted its colour, on screen and fully drivable in the same frame the+// vehicle state arrives. The GLB body and wheels are then swapped into the SAME+// group and wheel pivots the moment the download lands. Nothing downstream+// re-binds, so a car that upgrades mid-drive keeps its physics, its camera and+// its driver, and a car whose model never arrives stays drivable in its stand-in+// rather than vanishing.//// The returned group's origin is the chassis CENTRE, aligned with the Rapier// rigid body's origin, with +z forward and +y up — so the physics transform maps@@ -33,11 +35,6 @@ function lighten(hex, amt) {c.lerp(new Color(0xffffff), amt);return c.getHex();}-function darken(hex, amt) {- const c = new Color(hex);- c.lerp(new Color(0x000000), amt);- return c.getHex();-}// A reusable wheel: a black tyre cylinder (axle along x) plus a metallic hub, so// the spin reads. Built once per wheel; the geometry is pre-oriented so the@@ -97,28 +94,10 @@ function buildHeadLights(width, z, y) {return out;}-function buildCoupe(spec, color) {- const body = new Group();- const { l, w } = spec.dims;- const main = bodyMat(color);- const lower = new Mesh(new BoxGeometry(w, 0.55, l), main);- lower.position.y = 0.05; lower.castShadow = true; lower.receiveShadow = true;- body.add(lower);- // Sleek raked cabin, set back.- const cabin = new Mesh(new BoxGeometry(w * 0.82, 0.46, l * 0.42), bodyMat(lighten(color, 0.05)));- cabin.position.set(0, 0.5, -0.15); cabin.castShadow = true;- body.add(cabin);- const glass = new Mesh(new BoxGeometry(w * 0.78, 0.34, l * 0.4), glassMat());- glass.position.set(0, 0.52, -0.12);- body.add(glass);- // A low front splitter for a sporty nose.- const splitter = new Mesh(new BoxGeometry(w * 0.96, 0.12, 0.5), bodyMat(darken(color, 0.5)));- splitter.position.set(0, -0.18, l / 2 - 0.2);- body.add(splitter);- return body;-}--function buildSedan(spec, color) {+// The stand-in silhouette: a car-shaped hull, cabin and glazing sized from the+// type's own dims, so it occupies the same road space the GLB will and the swap+// reads as a detail upgrade rather than a different vehicle appearing.+function buildStandIn(spec, color) {const body = new Group();const { l, w } = spec.dims;const lower = new Mesh(new BoxGeometry(w, 0.62, l), bodyMat(color));@@ -133,55 +112,6 @@ function buildSedan(spec, color) {return body;}-function buildPickup(spec, color) {- const body = new Group();- const { l, w } = spec.dims;- const chassis = new Mesh(new BoxGeometry(w, 0.66, l), bodyMat(color));- chassis.position.y = 0.1; chassis.castShadow = true; chassis.receiveShadow = true;- body.add(chassis);- // Forward cab.- const cab = new Mesh(new BoxGeometry(w * 0.94, 0.82, l * 0.4), bodyMat(lighten(color, 0.03)));- cab.position.set(0, 0.78, l * 0.18); cab.castShadow = true;- body.add(cab);- const glass = new Mesh(new BoxGeometry(w * 0.9, 0.5, l * 0.36), glassMat());- glass.position.set(0, 0.86, l * 0.19);- body.add(glass);- // Open rear bed: floor + three low walls.- const bedMat = bodyMat(darken(color, 0.18));- const bedW = w * 0.96, bedL = l * 0.4, wall = 0.32;- const floor = new Mesh(new BoxGeometry(bedW, 0.16, bedL), bedMat);- floor.position.set(0, 0.5, -l * 0.22); body.add(floor);- const back = new Mesh(new BoxGeometry(bedW, wall, 0.12), bedMat);- back.position.set(0, 0.64, -l * 0.42); body.add(back);- for (const sx of [-1, 1]) {- const side = new Mesh(new BoxGeometry(0.12, wall, bedL), bedMat);- side.position.set(sx * (bedW / 2 - 0.06), 0.64, -l * 0.22); body.add(side);- }- return body;-}--function buildBuggy(spec, color) {- const body = new Group();- const { l, w } = spec.dims;- const tub = new Mesh(new BoxGeometry(w * 0.78, 0.5, l * 0.8), bodyMat(color));- tub.position.y = 0.08; tub.castShadow = true; tub.receiveShadow = true;- body.add(tub);- // Exposed roll cage from thin bars.- const cageMat = new MeshStandardMaterial({ color: darken(color, 0.45), roughness: 0.4, metalness: 0.7 });- const bar = (sx, z) => {- const m = new Mesh(new BoxGeometry(0.1, 0.78, 0.1), cageMat);- m.position.set(sx * w * 0.32, 0.5, z); body.add(m);- };- bar(-1, 0.2); bar(1, 0.2); bar(-1, -0.5); bar(1, -0.5);- const roof = new Mesh(new BoxGeometry(w * 0.7, 0.1, 0.84), cageMat);- roof.position.set(0, 0.88, -0.15); body.add(roof);- const seatback = new Mesh(new BoxGeometry(w * 0.6, 0.42, 0.12), glassMat());- seatback.position.set(0, 0.42, -0.42); body.add(seatback);- return body;-}--const BUILDERS = { coupe: buildCoupe, sedan: buildSedan, pickup: buildPickup, buggy: buildBuggy };-// Free every geometry/material an object owns. Only ever called on the// procedural parts this module built, GLB parts share their buffers with the// model template and are released through the instance's own dispose().@@ -198,8 +128,8 @@ function disposeOwned(root) {/*** Build a complete vehicle mesh for a spec + colour.*- * Returns synchronously, a model-backed type hands back its procedural- * stand-in and upgrades itself in place once the GLB arrives.+ * Returns synchronously with the procedural stand-in mounted, and upgrades+ * itself in place once the type's GLB arrives.** @returns {{ group: Group, wheels: Array<{pivot: Group, spinner: Group}>,* setBrake: (on: boolean) => void, ready: Promise<boolean>, dispose: Function }}@@ -214,8 +144,7 @@ export function buildVehicleMesh(spec, color) {const bodyRoot = new Group();group.add(bodyRoot);- const builder = BUILDERS[spec.id] || buildSedan;- bodyRoot.add(builder(spec, tint));+ bodyRoot.add(buildStandIn(spec, tint));// Lights, placed off the body's front/rear faces.const { l, w } = spec.dims;diff --git a/tests/e2e/play-vehicles.spec.js b/tests/e2e/play-vehicles.spec.jsindex d439f9a2e..82cc17268 100644--- a/tests/e2e/play-vehicles.spec.js+++ b/tests/e2e/play-vehicles.spec.js@@ -119,26 +119,51 @@ test.describe('/play vehicles', () => {expect(errors).toEqual([]);});- test('procedural types still park on their wheels', async ({ page }) => {- // The stand-in silhouettes share the ride-height maths with the model-backed- // car, so they are pinned by the same measurement.- for (const type of ['coupe', 'sedan', 'pickup', 'buggy']) {- const car = await measureCar(page, type);- expect(car.upgraded, `${type} has no model`).toBe(false);- for (const y of car.wheelWorldY) {- expect(y, `${type} wheel height`).toBeCloseTo(car.restHeight - car.restHeight + y, 5);- }- expect(car.lowestPoint, `${type} ground contact`).toBeGreaterThan(-0.05);- expect(car.driverFeetY, `${type} driver feet`).toBeGreaterThan(0);- }+ test('the stand-in parks on its wheels while the model is still downloading', async ({ page }) => {+ // A player can walk up to a car in the frame it spawns, before the GLB has+ // landed. The stand-in shares the ride-height maths with the model, so it is+ // pinned by the same measurement: on the road, not floating or sunk.+ const car = await page.evaluate(async () => {+ const THREE = await window.__imp('/node_modules/three/build/three.module.js');+ const { buildVehicleMesh } = await window.__imp('/src/game/vehicle-mesh.js');+ const { vehicleSpec, vehicleRestHeight } = await window.__imp('/multiplayer/src/vehicles.js');++ const spec = vehicleSpec('trench');+ const rest = vehicleRestHeight(spec.id);+ // Measured WITHOUT awaiting mesh.ready: this is the stand-in, on screen in+ // the same frame the vehicle state arrived.+ const mesh = buildVehicleMesh(spec, spec.color);+ mesh.group.position.y = rest;+ const scene = new THREE.Scene();+ scene.add(mesh.group);+ scene.updateMatrixWorld(true);+ const box = new THREE.Box3().setFromObject(mesh.group);+ const out = {+ restHeight: rest,+ lowestPoint: box.min.y,+ wheels: mesh.wheels.length,+ wheelWorldY: mesh.wheels.map((w) => w.pivot.position.y + rest),+ driverFeetY: rest + spec.seat.y,+ };+ mesh.dispose();+ return out;+ });++ expect(car.wheels).toBe(4);+ // One wheel radius above the road (trench wheel.radius = 0.3), the same+ // contact patch the model-backed car above is held to.+ for (const y of car.wheelWorldY) expect(y).toBeCloseTo(0.3, 2);+ expect(car.lowestPoint).toBeGreaterThan(-0.05);+ expect(car.driverFeetY).toBeGreaterThan(0);});test('ambient traffic drives the same car the fleet does', async ({ page }) => {- // The NPC lane is the other half of "the default car": whatever a player can- // take the wheel of should be what they watch drive past. AmbientLife builds- // its own stand-in first, so this asserts the upgrade actually lands, that- // the cars sit on the road (not sunk into it), and that each one spins its- // own four wheels.+ // The NPC lane is the other half of "the one car in the world": whatever a+ // player can take the wheel of is what they watch drive past, in every town+ // (frontier included, which used to run horse wagons here). AmbientLife+ // builds its own stand-in first, so this asserts the upgrade actually lands,+ // that the cars sit on the road (not sunk into it), and that each one spins+ // its own four wheels.const traffic = await page.evaluate(async () => {const THREE = await window.__imp('/node_modules/three/build/three.module.js');const { NavGraph } = await window.__imp('/src/game/npc/nav-graph.js');@@ -146,7 +171,7 @@ test.describe('/play vehicles', () => {const { hasVehicleModel, TRENCH_CAR_URL } = await window.__imp('/src/game/vehicle-model.js');const scene = new THREE.Scene();- const life = new AmbientLife({ scene, nav: new NavGraph({ seed: 7 }), biome: { town: 'downtown' } });+ const life = new AmbientLife({ scene, nav: new NavGraph({ seed: 7 }) });// Give the shared model time to land, then run a few frames so the cars// take their places on the ring road.const deadline = Date.now() + 30000;diff --git a/tests/play-loss-safety.test.js b/tests/play-loss-safety.test.jsindex 29b17f186..f180ba790 100644--- a/tests/play-loss-safety.test.js+++ b/tests/play-loss-safety.test.js@@ -143,7 +143,7 @@ describe('the vehicle clamp is derived from real elapsed time', () => {// directly off the prototype.const apply = WalkRoom.prototype._applyVehicleTransform;const car = (over = {}) => ({- type: 'coupe', x: 0, y: 0, z: 0, qx: 0, qy: 0, qz: 0, qw: 1, speed: 0,+ type: 'trench', x: 0, y: 0, z: 0, qx: 0, qy: 0, qz: 0, qw: 1, speed: 0,tsServer: Date.now(), ...over,});const move = (dz, speed = 0) => ({ x: 0, y: 0, z: dz, qx: 0, qy: 0, qz: 0, qw: 1, speed });@@ -161,14 +161,14 @@ describe('the vehicle clamp is derived from real elapsed time', () => {it('accepts a step that real elapsed time genuinely allows', () => {const v = car({ tsServer: Date.now() - 300 }); // 0.3s of travel- const reach = vehicleMaxSpeedMps('coupe') * 0.3;+ const reach = vehicleMaxSpeedMps('trench') * 0.3;expect(apply.call({}, v, move(reach * 0.8), 0)).toBe(true);expect(v.z).toBeCloseTo(reach * 0.8, 3);});it('still rejects a self-reported speed above the type ceiling', () => {const v = car({ tsServer: Date.now() - 300 });- const overSpeed = vehicleMaxSpeedMps('coupe') * 2;+ const overSpeed = vehicleMaxSpeedMps('trench') * 2;expect(apply.call({}, v, move(0.5, overSpeed), false)).toBe(false);});diff --git a/tests/vehicles-trench-car.test.js b/tests/vehicles-trench-car.test.jsindex 6a520cde3..8b162c86a 100644--- a/tests/vehicles-trench-car.test.js+++ b/tests/vehicles-trench-car.test.js@@ -134,6 +134,15 @@ describe('vehicle fleet invariants', () => {expect(vehicleSpec(undefined).id).toBe('trench');});+ it('is the only car in the world', () => {+ // Owner directive 2026-08-17: the Trench Car is the whole fleet. A second+ // type creeping back in is exactly how the boxy procedural silhouettes+ // (an amber roll-caged buggy among them) ended up driving around /play, so+ // the table itself is pinned, not just the spawn list.+ expect(Object.keys(VEHICLE_TYPES)).toEqual(['trench']);+ for (const spawn of VEHICLE_SPAWNS) expect(spawn.type).toBe('trench');+ });+it('parks the default car where a new player lands', () => {const plaza = VEHICLE_SPAWNS.filter((s) => s.id.startsWith('veh-plaza-'));expect(plaza.length).toBeGreaterThan(0);@@ -146,7 +155,7 @@ describe('vehicle fleet invariants', () => {// PhysicsWorld.createVehicle offsets the chassis cuboid by -0.3 * (h/2), so// its underside sits 1.3 * (h/2) below the body origin. If that reaches the// ground the hull's own friction pins the car and no engine force moves it,- // the bug the coupe/sedan/pickup suspension comments document.+ // the bug the trench suspension comment documents.for (const [id, spec] of Object.entries(VEHICLE_TYPES)) {const clearance = vehicleRestHeight(id) - 1.3 * (spec.dims.h / 2);expect(clearance, `${id} chassis clearance`).toBeGreaterThan(0.1);