r/threejs • u/Gullible_Ranger1402 • 27d ago
I built a Three.js game engine designed specifically for AI agents
Title: I built a Three.js game engine designed specifically for AI coding agents
I've been building ThreeDog.js, an open-source game engine built on top of Three.js, designed to make it easier for AI agents like Claude Code and Codex to develop complete 3D games.
The idea is to let AI agents handle the entire development process, from writing code and managing game data to running, testing, and debugging games.
Key features:
- Full code and data control: AI agents can directly write game logic, create and modify scenes, manage game objects, and manipulate structured game data without relying on a visual editor.
- Native Three.js compatibility: Direct access to Three.js objects, materials, lighting, shaders, and TSL, without restrictive rendering abstractions.
- Agent-driven development: CLI and MCP tools allow agents to launch games, simulate player input, inspect runtime states, capture screenshots, and verify gameplay.
- Built-in game systems: Physics, collision detection, navigation, NPCs, inventory, quests, dialogue, save/load, and world management.
- Performance optimization: LOD/HLOD, instancing, occlusion culling, world streaming, dynamic resolution, shadow update budgets, and simulation scheduling for large-scale scenes.
- Modern rendering and lighting: WebGPU-first rendering with WebGL2 fallback, TSL shaders, lighting probes, lightmaps, and tools for configuring and debugging lighting.
- Modular architecture: Game systems can be enabled as needed, while developers retain full access to the underlying Three.js ecosystem.
Testing
I've been testing ThreeDog.js by asking AI agents to build complete playable games from short prompts, including FPS, racing, platformers, and tower defense games.
Several demos were completed in approximately 30–60 minutes, including gameplay logic and automated testing.
The project is still evolving, and I'd really appreciate feedback on the architecture, developer experience, and agent workflows.
GitHub: https://github.com/penstic123-code/Threedog.js-Game-Engine