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
Audit 4: /play multiplayer, networking, and presence
The event means many strangers in one world at once. Connection handling has to be boring and invisible: join fast, never silently desync, recover from every drop.
Where the code lives
- Net layer and server URL:
src/game/community-net.js(defaultServerUrl is documented inpages/play.html) - World boot:
src/game/coincommunities.js - Voice:
src/game/voice-chat.js - Ambient population (client-side, non-networked):
src/game/ambient-crowd.js - Friends/presence:
src/game/friends-panel.js - Persistence:
src/game/world-persist.js
What to audit
- Join path. Time from page load to seeing other players. Any handshake failure must surface a designed, actionable error (what happened + retry button), never an empty world that looks single-player when it silently failed.
- Reconnect. Kill the socket mid-session (devtools offline toggle, 10s, then online). The client must reconnect automatically, resync player positions, and show a subtle "reconnecting" indicator while it does. State after resync must match the server (no ghost players, no duplicated self). Note
community-net.jsalready reconnects with backoff: the attempt counter resets on every successful join, soMAX_RECONNECT_ATTEMPTS(14, about 11 minutes with the once-a-minute tail) bounds one outage and rides out a server redeploy before parking onofflinewith the manualretry(); a holder-gate refusal fromonAuthis terminal and routes back to the gate instead of looping. A failed connect logs at info through the gated logger, not as a console warning. The boot watchdog inpages/play.htmldeliberately ignores a WebSocket-shaped rejection, so a flaky reconnect never trips the "could not load the world" card. - Backgrounding. Switch tabs for 2 minutes and come back. Mobile Safari will have frozen the socket: same reconnect path must handle it.
- Two-client consistency. Open two browser contexts in the same coin world. Movement, chat, and emotes must appear on the other client within a human-imperceptible delay. Check name labels, avatar appearance, and cosmetics sync both ways.
- Chat hygiene. Long messages wrap, links do not inject HTML (verify escaping), spam has some throttle, and the log does not grow unbounded in memory.
- Voice.
voice-chat.jsis surfaced (lazy-imported bycoincommunities.jsbehind the HUD voice button), so test the full path: permission prompt, mute state visible to others, teardown on leave. Two hardening points to keep intact: a denied mic closes theAudioContextit just opened (browsers cap concurrent contexts, so leaking one per refusal made voice permanently unopenable), and an already-connected peer holds two ranks of hysteresis pastMAX_VOICE_PEERSbefore it is dropped, so a crowd cannot churn WebRTC handshakes frame to frame. If it is broken and unfixable today, hide the entry point rather than shipping a dead button. - Scale behavior. Simulate a crowded room (multiple headless Playwright contexts, or whatever the net layer allows). Watch for O(n^2) update patterns and per-player DOM label churn.
- Mobile memory. A phone that runs out of memory does not throw a JS error: the browser kills the tab, the socket dies mid-session, and the page reloads. In the server log that reads as a join followed by a leave a few seconds later, over and over, which looks like a networking bug and is not one. Watch the bytes, not the console.
scripts/play-mobile-repro.mjsdrives a phone-emulated /play session and prints every download attributed to the code that asked for it (ENGINE=chromium node scripts/play-mobile-repro.mjs https://three.ws/play 120000). Anything that loads community-uploaded models must work to a budget: the gallery is uncapped and single avatars there reach 24 MB.src/game/ambient-crowd.jsholds the reference implementation (per-model cap, per-visit download cap, load-once-and-clone, release on leave).
Verify
- Scripted two-context Playwright run joins the canonical $THREE world (URL in
docs/event-readiness/README.md), exchanges chat, survives a forced disconnect, and asserts resync. Keep the script inscripts/. - Zero console errors across the run.
npm teststays green.
Report format
Each failure mode tested and its result (pass / fixed / cannot-fix-with-reason). State the server-side capacity assumption you tested against so the event-day runbook (prompt 10) can pre-scale it.