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(walk): power saver in the walkaround world, and a dusk that lingers
nirholasf54e33defb16
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8e5e43426..5ca52e2cc 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -15,7 +15,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr- **Hats and shoes now sit where they belong** — Generated caps could come out with brims jutting past the face, and sneakers could hover away from the feet, because the forge sized those pieces by width alone: a deep-brimmed cap or a photographed pair of shoes standing close together gave the sizing step no useful signal. Caps are now scaled to fit the head on every dimension, and shoes are sized by foot length and placed onto each foot individually. Measured on a walking avatar, the worst-case gap between shoe and foot dropped from 34cm to 3cm, and cap overhang from 21cm to 8cm. Every piece in the catalog is now checked automatically: it must load, match its published fingerprint, and bind correctly onto four different avatar skeletons before it counts as good, with the pieces that failed the new bar replaced. A daily check also watches the live catalog for anything that breaks after the fact. `[improvement, fix]`- **Solana name registration works again, and embeds stop crashing on older phones** — Claiming a .sol domain for an agent, and claiming your own name under threews.sol, both ran against a Solana naming library so old that the functions doing the registering had been renamed out from under us: the calls resolved to nothing and the whole attempt failed. The library is now current, every naming path has been re-checked against the live Solana mainnet, and handing a fresh subdomain to its new owner no longer trips over an account that the same transaction is still creating. Looking up a wallet's primary name also stops reporting a name the wallet no longer owns. Separately, the embeddable 3D avatar used a newer JavaScript feature than some older Android browsers ship, so the avatar page went blank instead of loading; the missing piece is now included in the embed, which matters because the embed is designed to run on other people's sites where we do not get to pick the browser. (`/embed`) `[fix]`- **The 3D forge accepts all six reference photos again** — The photo composer advertised six reference views but only built four slots, so filling the last one threw an error and stopped the upload. All six slots are now real and usable, which is the full set the generator accepts, and more views produce a sharper mesh. Text prompts also retry once when the concept-image step returns an empty result, instead of falling back to a lower-quality image lane. (`/forge`) `[fix, improvement]`-- **The walkaround world now has a real time of day and /play's radar** — Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice. (`/temporary`) `[feature, improvement]`+- **The walkaround world now has a real time of day and /play's radar** — Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice. The walkaround also picked up the shared frame governor: it now renders at 60fps while you are playing, eases to 30 when you click away to another window, and holds 30 with Power saver on, which is a new switch in the controls panel (press H) that carries over from the coin worlds and the club. Fixing that panel turned up an older problem: none of its switches could actually be clicked, because the panel let every click fall through to the world behind it. Haptics, path trail and NPC companions work again too. (`/temporary`) `[feature, improvement]`- **The wardrobe now has a full closet, and a page of its own** — The garment catalog grew to 32 pieces covering every slot: hoodies, flannels, polos, knit sweaters, blazers, field jackets, chinos, joggers, shorts, a midi skirt, hairstyles from pixie to afro, beanies, a fedora, eyeglasses, a backpack and a scarf. There is also a new Wardrobe page where anyone can browse every piece, spin it in 3D, and describe a new garment for the forge to build, rig and publish in about seven minutes. (`/wardrobe`) `[feature]`- **The x402 payment lanes now stop when the treasury runs dry** — When the wallets funding the agent payment economy ran low, the tip seeder kept firing 60 payments a minute that could never settle, turning the public dance-tip endpoint into a wall of errors and burning network calls for nothing. It now reads both wallet balances once before each round and simply sits the round out when a payment cannot succeed, with the reason stated plainly in the response. When the payer holds enough for some but not all of a round, it now sends exactly the number it can afford instead of overshooting. An unreadable balance is treated as unknown rather than empty, so a momentary network hiccup can never stall the economy on its own. `[fix, infra]`- **Trading agents can no longer earn a bigger bet while losing money** — The self-tuning loop judged each strategy on its average percentage return and win rate, which treat a tiny position and a large one as equal. A strategy could post a healthy-looking win rate while its biggest trades bled real SOL, and get rewarded with an even bigger position. The optimizer now shrinks a strategy whose average percentage is positive but whose actual profit is negative, since that pattern only occurs when the larger bets are the losing ones, and it refuses to scale any strategy up while it is down money. (`/blog/autonomous-trading-experiment`) `[improvement]`diff --git a/STRUCTURE.md b/STRUCTURE.mdindex af2adcfe7..842de7982 100644--- a/STRUCTURE.md+++ b/STRUCTURE.md@@ -17,6 +17,7 @@ bottom.| Web renderer / viewer | [avatar-sdk/](avatar-sdk) `→ /viewer` | Published as `@three-ws/avatar` | `<agent-3d>` web component || Agent shell (companion identity + agentic ⌘K + persistent navigation) | [src/agents/guest-agent.js](src/agents/guest-agent.js), [src/shared/agent-names.js](src/shared/agent-names.js), [src/walk-companion-identity.js](src/walk-companion-identity.js), [public/search.js](public/search.js), [src/view-transitions.js](src/view-transitions.js), [src/shell/page-lifecycle.js](src/shell/page-lifecycle.js) | Live | The agent IS the interface: every visitor gets a named ephemeral agent in the first five seconds (auto-summoned corner companion with an identity chip; “Claim →” prefills /create-agent and POST /api/agents makes it real); the ⌘K palette executes real commands in place (forge → free text→3D lane, digest → clustered news, price → live market data, ask → streamed /api/chat) and announces completions so the companion reacts; pages marked data-shell (`/markets`, `/coins`) navigate by swapping only the main element so the agent and shell never unload (page modules re-init via onPageReady). Docs: [docs/agent-shell.md](docs/agent-shell.md). Tests: [tests/search-commands.test.js](tests/search-commands.test.js), [tests/guest-agent.test.js](tests/guest-agent.test.js), [tests/agent-names.test.js](tests/agent-names.test.js) || Walk companion + playground | [walk-sdk/](walk-sdk) `→ /walk-companion.js` | Published as `@three-ws/walk` | Corner mascot + full-page stroll/platformer playground + diverse avatar picker. App entries: [src/walk-companion.js](src/walk-companion.js), [src/walk-playground.js](src/walk-playground.js) |+| The walkaround world (`/walk`) | [pages/temporary.html](pages/temporary.html) `→ /temporary`, app [src/walk.js](src/walk.js), environments [src/walk-environments.js](src/walk-environments.js) + [public/environments/](public/environments), multiplayer [src/walk-net.js](src/walk-net.js) → `walk_world`, day/night [src/walk-day-night.js](src/walk-day-night.js), radar [src/game/hud/minimap.js](src/game/hud/minimap.js), companions [src/walk-npcs.js](src/walk-npcs.js), agent desks [src/walk-agent-desk.js](src/walk-agent-desk.js) | Live | Walk your avatar through six real staged environments (park, cyberpunk street, beach, gallery, void, office) with physics-driven locomotion on a heightfield, four camera modes, gestures, voice chat, trails, capture, and live peers. **Time of day is real and shared:** the same deterministic world clock `/play` runs on ([src/shared/world-clock.js](src/shared/world-clock.js)) drives the sun arc, sky gradient, light levels, and IBL strength, so two people in the same world always agree on whether it is night. The sky crossfades on a wider curve than the light levels, so dawn and dusk linger instead of flipping. Armed for outdoor stages only (indoor/void keep their authored manifest lighting) and paused while AR passthrough owns the rig. **The radar is `/play`'s:** `/walk` mounts the same rotating GTA-style minimap the world HUD uses, with a compass, the walkable-disc boundary ring, and live blips for peers (their nameplate colours), NPC companions, live agent desks, the guide's named landmarks, and scenery. Click or tap it to set a walk-to waypoint (`Minimap.worldFromScreen()` inverts the rotating projection); `M` or the dock button toggles it and the choice persists. **Frame pacing is shared too:** the loop runs through [src/shared/frame-governor.js](src/shared/frame-governor.js) (60fps focused, 30 unfocused, 30 under power saver) and the controls overlay carries the cross-surface Power-saver switch. Tests: [tests/walk-day-night.test.js](tests/walk-day-night.test.js), [tests/minimap-projection.test.js](tests/minimap-projection.test.js) || React avatar creator | [avatar-sdk/](avatar-sdk) `→ /react` `/creator` | Published as `@three-ws/avatar` | Same package, React subpath || Talking page guide | [page-agent-sdk/](page-agent-sdk) | Published as `@three-ws/page-agent` | Drop-in rigged 3D agent that narrates any page + visitor avatar picker. `<page-agent>` web component. Rigged-only catalog. `preset="…"` resolves one of 5 personas (greeting/role/suggested-prompt chips/tool allowlist) — see [page-agent-sdk/README.md#persona-presets](page-agent-sdk/README.md#persona-presets). See [page-agent-sdk/PUBLISHING.md](page-agent-sdk/PUBLISHING.md) || Guided site tour | [tour-sdk/](tour-sdk) | Published as `@three-ws/tour` | 3D guide walks a live site, spotlights sections, narrates each. One-tag CDN build + free roam |@@ -64,7 +65,7 @@ bottom.| `/play` character & avatar customization (avatar creator, selfie→3D, wardrobe boutique) | Lobby creator flow [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js) `_openCreate()`, selfie SDK wrapper [src/avatar-creator.js](src/avatar-creator.js), shop [src/game/cosmetics-shop.js](src/game/cosmetics-shop.js), wardrobe [src/game/cosmetics-wardrobe.js](src/game/cosmetics-wardrobe.js), boutique NPCs [src/game/npc/npc-catalog.js](src/game/npc/npc-catalog.js) (`npc-tailor`, `npc-fitting-room`), boutique spawn points [src/game/world-zones.js](src/game/world-zones.js) (`type: 'boutique'`) | In-repo | W03 of the World Online program ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). Before dropping into `/play`, design an avatar from scratch or a selfie (real Avaturn SDK), upload a `.glb`, or sculpt in the full Avatar Studio — no sign-in required. Once in the world, the cosmetics shop/wardrobe (real x402-settled catalog, server-persisted equip) now has a physical home: walk up to Roux · Tailor to browse/buy, or Nell's Fitting Room to equip anything you own. Doc: [docs/character-studio.md](docs/character-studio.md#character-customization-in-play-world-online). || `/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 ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). 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 ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). 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). |-| Frame governor & power saver (`/play`, `/club`) | [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); 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) |+| 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) || 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. || `/play` Wheel of Fortune (Fortune's Folly — free/paid $THREE spins) | Client: [src/game/wheel-station.js](src/game/wheel-station.js) (the plaza landmark, proximity prompt, `E` to spin — lazy-imports the actual UI on first interact), spin UI [src/game/spin-wheel-ui.js](src/game/spin-wheel-ui.js) (20-segment wheel, free/paid flow, wallet signing). Server: [multiplayer/src/spin-wheel.js](multiplayer/src/spin-wheel.js) (paytable, RNG, level/cooldown/pack gates, handlers), split-payment settlement [multiplayer/src/game-token.js](multiplayer/src/game-token.js) (`buildSpinPayment`/`verifySpinPayment` — the same primitives the $THREE boutique uses), wheel location [multiplayer/src/world-features.js](multiplayer/src/world-features.js) `WHEEL`, persisted cooldown field in [multiplayer/src/economy.js](multiplayer/src/economy.js), handlers wired in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js) | In-repo | W09 of the World Online program ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). Walk up to the wheel in the plaza and press `E`: one free spin every 12h (a real persisted cooldown — survives a disconnect, unlike the ephemeral per-action cooldowns everything else on this row's neighbors use), or pay $3 in `$THREE` — split 50% to the holder-rewards pool / 50% to the treasury, verified on-chain before any prize is granted, mirroring the boutique's proven settlement pattern exactly. Gated behind an average skill level of 3 (a light anti-farm floor, not a grind) and never lets a won prize get lost to a full pack — room for at least one possible item prize is checked before a spin is even offered, paid or free. All 20 wedges are equal-odds by design, matching the client's fixed-angle wheel rendering exactly (see the header note in `spin-wheel.js` on why that must never drift). Tests: [tests/spin-wheel.test.js](tests/spin-wheel.test.js). || `/play` friends & presence (drawer, cross-world DMs) | Client: [src/game/friends-panel.js](src/game/friends-panel.js) (shared with `/walk`), mounted in [src/game/coincommunities.js](src/game/coincommunities.js) `_openFriends()`/`_closeFriends()`, HUD button + unread badge in [src/game/coincommunities-ui.js](src/game/coincommunities-ui.js), account-level state/polling in [src/friends.js](src/friends.js). Server: signed ticket verify + `socialHub` registration in [multiplayer/src/rooms/WalkRoom.js](multiplayer/src/rooms/WalkRoom.js), hub in [multiplayer/src/social-hub.js](multiplayer/src/social-hub.js) | In-repo | W09 of the World Online program ([prompts/agent-briefs/W-world-online/W00-program-overview.md](prompts/agent-briefs/W-world-online/W00-program-overview.md)). Press `J` or the HUD `Friends` button to open a right-docked drawer showing your account's friend graph — live online/offline presence per coin world, requests, and DM threads — the same graph and threads `/walk` and the standalone `/friends` page already share. `community-net.js` now carries a signed presence ticket into every `walk_world` join and forwards the server's `social` push onto its own event bus, which is what actually makes a `/play` player visible to friends and able to receive a live DM — previously `/play` joined anonymously to the social graph even when signed in, so every player showed offline and DMs were dropped. Tests: [tests/play-friends-presence.test.js](tests/play-friends-presence.test.js). |diff --git a/data/changelog.json b/data/changelog.jsonindex 394f59ddc..bdcecd105 100644--- a/data/changelog.json+++ b/data/changelog.json@@ -31,7 +31,7 @@{"date": "2026-07-27","title": "The walkaround world now has a real time of day and /play's radar",- "summary": "Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice.",+ "summary": "Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice. The walkaround also picked up the shared frame governor: it now renders at 60fps while you are playing, eases to 30 when you click away to another window, and holds 30 with Power saver on, which is a new switch in the controls panel (press H) that carries over from the coin worlds and the club. Fixing that panel turned up an older problem: none of its switches could actually be clicked, because the panel let every click fall through to the world behind it. Haptics, path trail and NPC companions work again too.","tags": ["feature","improvement"diff --git a/public/changelog.json b/public/changelog.jsonindex 59d89353e..0aa5574ab 100644--- a/public/changelog.json+++ b/public/changelog.json@@ -1,5 +1,5 @@{- "generated_at": "2026-07-27T17:51:43.305Z",+ "generated_at": "2026-07-27T17:53:26.317Z","generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json","site": {"name": "three.ws",@@ -107,7 +107,7 @@"date": "2026-07-27","type": "update","title": "The walkaround world now has a real time of day and /play's radar",- "summary": "Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice.",+ "summary": "Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice. The walkaround also picked up the shared frame governor: it now renders at 60fps while you are playing, eases to 30 when you click away to another window, and holds 30 with Power saver on, which is a new switch in the controls panel (press H) that carries over from the coin worlds and the club. Fixing that panel turned up an older problem: none of its switches could actually be clicked, because the panel let every click fall through to the world behind it. Haptics, path trail and NPC companions work again too.","link": "/temporary","tags": ["feature",diff --git a/public/changelog.xml b/public/changelog.xmlindex 25c59eaf4..f4e354848 100644--- a/public/changelog.xml+++ b/public/changelog.xml@@ -84,7 +84,7 @@<guid isPermaLink="false">2026-07-27:The walkaround world now has a real time of day and /play's radar</guid><pubDate>Mon, 27 Jul 2026 12:00:00 GMT</pubDate><category>feature</category>- <description>Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice.</description>+ <description>Walk your avatar into the park at dusk and it actually looks like dusk. The sun rises, arcs overhead and sets, the sky graduates from night through dawn to day, and the lights and reflections follow it, all driven by the same shared world clock the coin worlds run on, so everyone standing in the same world sees the same sky at the same moment. Indoor stages keep their authored lighting and the cycle steps aside while the camera passthrough is on. The corner map was also replaced with the rotating radar from the coin worlds: it turns under a fixed player arrow, keeps a compass and the world boundary in view, and now shows other players in their nameplate colours alongside companions, live agent desks, the named landmarks your guide walks to, and the scenery around you. Click or tap the radar to send your avatar walking there. Press M to hide or show it and it remembers your choice. The walkaround also picked up the shared frame governor: it now renders at 60fps while you are playing, eases to 30 when you click away to another window, and holds 30 with Power saver on, which is a new switch in the controls panel (press H) that carries over from the coin worlds and the club. Fixing that panel turned up an older problem: none of its switches could actually be clicked, because the panel let every click fall through to the world behind it. Haptics, path trail and NPC companions work again too.</description></item><item><title>The wardrobe now has a full closet, and a page of its own</title>diff --git a/src/walk-day-night.js b/src/walk-day-night.jsindex 4d58cdca3..b7fba97c4 100644--- a/src/walk-day-night.js+++ b/src/walk-day-night.js@@ -102,6 +102,12 @@ export function createWalkDayNight({ ambientLight, hemi, sun, scene, stageEl })const alt = Math.sin(sunAngle); // sun altitude, -1..1const horiz = Math.cos(sunAngle); // east(+) … west(−)const day = smoothstep(-0.1, 0.18, alt);+ // The sky crossfades over a much wider slice of the sun's arc than the+ // light levels do. Tying both to `day` made dawn and dusk flip in a+ // couple of seconds and left the world flat-lit the rest of the cycle;+ // a wider curve lets the warm dusk palette actually linger on the+ // horizon while the ground lighting still goes dark on schedule.+ const skyMix = smoothstep(-0.45, 0.45, alt);// --- Sun: arc along the environment's authored azimuth ------------------const az = anchors.azimuth;@@ -129,14 +135,14 @@ export function createWalkDayNight({ ambientLight, hemi, sun, scene, stageEl })}// --- Sky gradient (throttled: a CSS write only when it has shifted) ------ if (force || Math.abs(day - _lastSkyP) > 0.01) {- _lastSkyP = day;- if (day < 0.5) {- const k = day / 0.5; // night → dusk+ if (force || Math.abs(skyMix - _lastSkyP) > 0.005) {+ _lastSkyP = skyMix;+ if (skyMix < 0.5) {+ const k = skyMix / 0.5; // night → dusk_top.set(NIGHT_SKY.top).lerp(_mix.set(DUSK_SKY.top), k);_bot.set(NIGHT_SKY.bottom).lerp(_mix.set(DUSK_SKY.bottom), k);} else {- const k = (day - 0.5) / 0.5; // dusk → the authored day sky+ const k = (skyMix - 0.5) / 0.5; // dusk → the authored day sky_top.set(DUSK_SKY.top).lerp(_dayTop, k);_bot.set(DUSK_SKY.bottom).lerp(_dayBot, k);}diff --git a/src/walk.js b/src/walk.jsindex 56e626627..2b04ab18f 100644--- a/src/walk.js+++ b/src/walk.js@@ -76,6 +76,16 @@ import { createWalkCapture } from './walk-capture.js';import { createMarketplaceGallery } from './marketplace-gallery.js';import { createAgentDeskManager, fetchLiveAgentDesks } from './walk-agent-desk.js';import { createWalkDayNight } from './walk-day-night.js';+import {+ createFrameGovernor,+ trackWindowFocus,+ getPowerSaver,+ setPowerSaver,+ onPowerSaverChange,+ FPS_ACTIVE,+ FPS_IDLE,+ FPS_SAVER,+} from './shared/frame-governor.js';import { Minimap } from './game/hud/minimap.js';import './game/hud/world-hud.css';@@ -500,6 +510,12 @@ scene.add(sun.target);// passthrough owns the lighting.const dayNight = createWalkDayNight({ ambientLight, hemi, sun, scene, stageEl: stage });+// Frame pacing, shared with /play and /club. `powerSaver` is one preference+// across every three.ws 3D surface, so turning it on here relieves those too.+const frameGovernor = createFrameGovernor();+const focusState = trackWindowFocus();+let powerSaver = getPowerSaver();+// Ground — opaque disc in non-AR mode, swapped to a shadow-only catcher in AR.const groundOpaque = new Mesh(new CircleGeometry(GROUND_RADIUS, 64),@@ -994,6 +1010,16 @@ const helpOverlay = (() => {// and makes the controls feel dead. Dismissal is handled entirely by the// window-level pointerdown listener below plus H / Esc, so the panel never// needs to capture and the sticks underneath always stay live.+ // Its own switches are the exception: they opt back into pointer events, but+ // only while the panel is open (`.is-open`), so a hidden overlay still can't+ // swallow a joystick touch. Without this the haptics / trail / NPC / power+ // switches rendered but could never be clicked — the canvas got every event.+ {+ const s = document.createElement('style');+ s.id = 'walk-help-overlay-style';+ s.textContent = '#walk-help-overlay.is-open [data-help-keep]{pointer-events:auto}';+ document.head.appendChild(s);+ }el.style.cssText = ['position:fixed','inset:0',@@ -1053,6 +1079,14 @@ const helpOverlay = (() => {${TRAIL_STYLE_LABELS[trailSetting.get()]}</button></div>+ <div style="margin:14px 0 0;padding-top:14px;border-top:1px solid rgba(255,255,255,0.1);display:flex;align-items:center;justify-content:space-between" data-help-keep>+ <span style="font-size:14px">Power saver<br><span style="font-size:11px;color:#888">30fps, lighter rendering</span></span>+ <button type="button" id="walk-power-saver-toggle" role="switch" data-help-keep+ aria-checked="${powerSaver}"+ style="appearance:none;border:1px solid rgba(255,255,255,0.2);background:${powerSaver ? 'var(--accent,#7c5cff)' : 'rgba(255,255,255,0.08)'};color:#fff;border-radius:999px;padding:5px 14px;font:inherit;font-size:13px;cursor:pointer">+ ${powerSaver ? 'On' : 'Off'}+ </button>+ </div><div style="margin:14px 0 0;padding-top:14px;border-top:1px solid rgba(255,255,255,0.1);display:flex;align-items:center;justify-content:space-between" data-help-keep><span style="font-size:14px">NPC companions</span><button type="button" id="walk-npc-toggle" role="switch" data-help-keep@@ -1098,6 +1132,34 @@ if (trailToggle) {});}+// Power saver on/off. The preference is shared across every three.ws 3D surface+// (one localStorage key), so this toggle mirrors changes made in /play or /club+// and pushes its own out to them. Applying it caps the loop at 30fps and drops+// the renderer to 1x pixel ratio with shadows off for a cooler, quieter machine.+const powerSaverToggle = helpOverlay.querySelector('#walk-power-saver-toggle');+function applyPowerSaver(on) {+ powerSaver = on;+ renderer.setPixelRatio(on ? 1 : Math.min(window.devicePixelRatio, 2));+ renderer.shadowMap.enabled = !on;+ sun.castShadow = !on;+ if (powerSaverToggle) {+ powerSaverToggle.setAttribute('aria-checked', String(on));+ powerSaverToggle.textContent = on ? 'On' : 'Off';+ powerSaverToggle.style.background = on ? 'var(--accent,#7c5cff)' : 'rgba(255,255,255,0.08)';+ }+}+if (powerSaver) applyPowerSaver(true);+onPowerSaverChange((on) => applyPowerSaver(on));+if (powerSaverToggle) {+ powerSaverToggle.addEventListener('click', () => {+ // dispatchEvent is synchronous, so onPowerSaverChange has already applied+ // the new value (and updated `powerSaver`) by the time setStatus reads it.+ setPowerSaver(!powerSaver);+ setStatus(`Power saver: ${powerSaver ? 'on' : 'off'}`);+ haptics.buzz(6);+ });+}+// NPC companions on/off. Persisted; applied live — turning them on respawns the// current environment's cast, turning them off despawns and releases every NPC.const npcToggle = helpOverlay.querySelector('#walk-npc-toggle');@@ -1128,6 +1190,7 @@ let helpVisible = false;function toggleHelp() {helpVisible = !helpVisible;helpOverlay.style.opacity = helpVisible ? '1' : '0';+ helpOverlay.classList.toggle('is-open', helpVisible);helpOverlay.setAttribute('aria-hidden', String(!helpVisible));}// Any pointer interaction dismisses the overlay. Capture phase + a@@ -2214,7 +2277,16 @@ function readMoveInput() {return { ix, iy };}-function tick() {+function tick(frameNow) {+ requestAnimationFrame(tick);+ // Frame governor (shared with /play and /club): rAF fires at the panel's+ // refresh rate, so a 144Hz laptop rendered 2.4x the frames of a 60Hz one for+ // pure heat. Cap real work at 60fps, drop to 30 when the window loses focus,+ // and hold 30 under the user's power-saver preference. Skipped frames fold+ // into the next dt, which every system below is already driven by.+ const fpsCap = powerSaver ? FPS_SAVER : focusState.focused ? FPS_ACTIVE : FPS_IDLE;+ if (!frameGovernor.shouldRun(frameNow ?? performance.now(), fpsCap)) return;+clock.update();const dt = Math.min(clock.getDelta(), 0.05); // clamp huge frames after a tab switch@@ -2516,7 +2588,6 @@ function tick() {accumulateWalkMetrics(dt);renderer.render(scene, camera);- requestAnimationFrame(tick);}function lerpAngle(a, b, t) {diff --git a/tests/frame-governor-caps.test.js b/tests/frame-governor-caps.test.jsnew file mode 100644index 000000000..d1d3375f6--- /dev/null+++ b/tests/frame-governor-caps.test.js@@ -0,0 +1,68 @@+// Frame governor pacing (src/shared/frame-governor.js) at the caps the 3D+// surfaces actually use. /walk joined /play and /club on this module, and its+// loop now self-schedules and returns early on a throttled frame, so the cap+// arithmetic is what decides whether the world runs at 60 or 30fps.++import { describe, it, expect } from 'vitest';+import {+ createFrameGovernor, FPS_ACTIVE, FPS_IDLE, FPS_SAVER,+} from '../src/shared/frame-governor.js';++// Drive a governor across `ms` of wall time at a given panel refresh rate and+// count how many frames it lets through.+function run(governor, { ms, hz, fpsCap }) {+ const step = 1000 / hz;+ let ran = 0;+ for (let t = 0; t <= ms; t += step) if (governor.shouldRun(t, fpsCap)) ran++;+ return ran;+}++describe('frame governor caps', () => {+ it('passes every frame on a 60Hz panel at the active cap', () => {+ const g = createFrameGovernor();+ const ran = run(g, { ms: 1000, hz: 60, fpsCap: FPS_ACTIVE });+ // 60Hz into a 60fps cap: no frame should be dropped (the 0.5ms slack+ // exists precisely so timer jitter never eats one).+ expect(ran).toBeGreaterThanOrEqual(60);+ });++ it('halves a 120Hz panel to the active cap instead of rendering twice over', () => {+ const g = createFrameGovernor();+ const ran = run(g, { ms: 1000, hz: 120, fpsCap: FPS_ACTIVE });+ expect(ran).toBeGreaterThanOrEqual(58);+ expect(ran).toBeLessThanOrEqual(63);+ });++ it('holds ~30fps at the idle and saver caps on a 144Hz panel', () => {+ for (const cap of [FPS_IDLE, FPS_SAVER]) {+ const g = createFrameGovernor();+ const ran = run(g, { ms: 1000, hz: 144, fpsCap: cap });+ expect(ran).toBeGreaterThanOrEqual(28);+ expect(ran).toBeLessThanOrEqual(33);+ }+ });++ it('does not quantize a 144Hz panel down to ~48fps at the 60 cap', () => {+ // A naive `last = now` drops to every third 144Hz frame (48fps). The+ // remainder-carry is what keeps the average honest.+ const g = createFrameGovernor();+ const ran = run(g, { ms: 1000, hz: 144, fpsCap: FPS_ACTIVE });+ expect(ran).toBeGreaterThan(52);+ });++ it('never bursts a backlog of instant frames after a long stall', () => {+ const g = createFrameGovernor();+ expect(g.shouldRun(0, FPS_ACTIVE)).toBe(true);+ // Hidden tab / breakpoint: 10 seconds pass between callbacks.+ expect(g.shouldRun(10_000, FPS_ACTIVE)).toBe(true);+ // The very next callback 1ms later must still be throttled.+ expect(g.shouldRun(10_001, FPS_ACTIVE)).toBe(false);+ });++ it('treats a non-positive cap as "run nothing" and survives a bad timestamp', () => {+ const g = createFrameGovernor();+ expect(g.shouldRun(16, 0)).toBe(false);+ expect(g.shouldRun(16, NaN)).toBe(false);+ expect(g.shouldRun(NaN, FPS_ACTIVE)).toBe(true); // no timestamp: don't stall the loop+ });+});diff --git a/tests/walk-day-night.test.js b/tests/walk-day-night.test.jsindex e2f879c42..ccfe57f78 100644--- a/tests/walk-day-night.test.js+++ b/tests/walk-day-night.test.js@@ -97,6 +97,30 @@ describe('walk day/night cycle', () => {expect(riseX).not.toBe(0);});+ it('lingers on a warm dusk instead of flipping day to night', () => {+ // The sky crossfade runs on a wider curve than the light levels, so the+ // stretch either side of sunset is visibly graduated rather than a+ // switch. Sample across dusk and require several distinct skies.+ rig.cycle.setEnvironment(OUTDOOR);+ const skies = new Set();+ for (let p = 0.68; p <= 0.86; p += 0.01) {+ rig.cycle.update(DEFAULT_CYCLE_MS * p);+ skies.add(rig.stageEl.style.background);+ }+ expect(skies.size).toBeGreaterThan(6);+ });++ it('keeps the ground dark at dawn even while the sky is already colouring', () => {+ rig.cycle.setEnvironment(OUTDOOR);+ // Just before sunrise: the horizon has warmed but the sun has not risen,+ // so the scene must still be lit like night, not like day.+ const day = rig.cycle.update(DEFAULT_CYCLE_MS * 0.21);+ expect(day).toBeLessThan(0.1);+ expect(rig.sun.intensity).toBeLessThan(0.3);+ // The sky, on the wider curve, has already left pure night behind.+ expect(rig.stageEl.style.background).not.toContain('#05060f');+ });+it('is deterministic: two independent instances agree exactly', () => {const a = makeRig();const b = makeRig();