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 3: /play performance (load weight, frame rate, memory)
The world must load fast on event wifi and hold 60fps on a mid-range laptop. Measure first, then fix the biggest numbers, then measure again.
Where the weight lives
- Main world:
src/game/coincommunities.js(5k+ lines; check what it imports eagerly vs lazily) - Population and props:
src/game/ambient-crowd.js,src/game/world-objects.js,src/game/terrain.js,src/game/build-voxels.js,src/game/static-batch.js - Shaders and environment:
src/game/water-shader.js,src/game/day-night.js,src/game/world-env.js - Avatar pipeline:
src/game/boot-avatar.js,src/glb-canonicalize.js,src/animation-retarget.js
What to measure (before touching anything)
- Network. With devtools on the canonical $THREE URL (see
docs/event-readiness/README.md): total transferred bytes to interactive, largest individual assets, any asset fetched more than once.scripts/play-mobile-repro.mjs(chromium engine) prints transfer totals and attributes duplicate GLB/clip fetches to their call stacks. - Frame rate. Performance panel recording of 30s of walking through the busiest area. Note long tasks, GC spikes, and the main-loop cost breakdown.
- Memory. Heap snapshot after 5 minutes idle in the world. Growth means a leak (event listeners, geometries/materials not disposed on despawn, chat log unbounded).
Fix priorities (biggest wins first)
- Duplicate fetches. Same GLB or animation clip loaded twice is pure waste; cache at the loader.
- Eager imports that should be lazy. Wheel UI, cosmetics shop, voice chat, intel kiosk: anything not needed for first paint should be a dynamic
import()triggered on approach or click. - Draw calls. Instance repeated props (trees, rocks, crowd members). Merge static geometry per zone.
- Texture budget. Downsize anything over 1024px that never fills the screen; KTX2/basis if the pipeline supports it, otherwise plain resizing is fine.
- Per-frame allocation. No
new Vector3()in the render loop; reuse scratch objects. - Disposal. Everything despawned (crowd, projectiles, dropped items) must dispose geometry, material, and textures.
Verify
- Re-run the same three measurements; the report includes before/after numbers for transfer size, worst frame time, and 5-minute heap growth.
- No visual regressions: walk the full map once after changes.
npm teststays green.
Report format
Numbers table (before/after), each fix in one line, anything intentionally skipped with the measured cost that made it not worth it.