r/aigamedev • • 18d ago

News I built an open-source Three.js game engine that lets Claude Code build, playtest, and debug games on its own

Hi everyone!

I've been working on Threedog.js, a free, open-source game engine built on Three.js and designed for AI coding agents like Claude Code. Version 1.3 is now released!

The idea came from a problem I noticed with AI-generated Three.js games: AI is already very capable of writing frontend code and creating impressive 3D scenes, but once a project grows, it often ends up rebuilding the same systems and struggling to maintain them.

So I built Threedog.js to handle the shared game systems while letting Claude Code focus on creating the actual game.

What can Claude Code do with it?

  • Build games: Use native Three.js objects and shaders without learning an entirely new rendering API.
  • Discover features: Find existing engine capabilities instead of implementing everything from scratch.
  • Playtest automatically: Launch games, simulate player inputs, and inspect the results.
  • Debug problems: Read structured diagnostics explaining why something failed.
  • Maintain larger projects: Work with modular systems for physics, input, saving, world streaming, and gameplay.

The most interesting part: AI can test its own games

Instead of generating code and asking a human to test it, Claude Code can interact with the running game through the engine's CLI and MCP interfaces.

It can inspect the state of the game, capture screenshots, run predefined test scenarios, identify problems, and make changes based on the results.

Rendering and performance

The engine also includes WebGPU/TSL support, optional lighting and post-processing effects, world streaming, HLOD, and other optimization features.

Try it yourself

Threedog.js is completely free and open-source under the MIT license.

GitHub: https://github.com/penstic123-code/Threedog.js-Game-Engine

I'd be interested to hear from other Claude Code users:

Would you find it useful if your coding agent could actually play and test the games it builds?

Feedback, suggestions, and contributions are welcome!

3 Upvotes

13 comments sorted by

3

u/boynet2 18d ago

your claude not testing your games? it does it for me from the start, never needed framework for that

2

u/Gullible_Ranger1402 17d ago

It does! The difference is that I'm trying to make testing more structured and repeatable, with direct access to game state, automated input, diagnostics, and clear pass/fail results. It's not about making AI capable of testing, but making that feedback loop more reliable.

3

u/Nessuno256 18d ago

Sooo, is this any different from regular Three.js when used by someone who knows what they're doing?

1

u/Gullible_Ranger1402 18d ago

Yeah, definitely! Three.js is great for rendering, but once you're building a larger game, you still have to handle things like physics, input, saves, world streaming, and getting all those systems to work together.

That's really what Threedog focuses on. It provides those systems out of the box and coordinates them so they don't interfere with each other.

Of course, an experienced Three.js developer could build all of this themselves, but the idea is to save that time and make larger projects easier to maintain. And you can still use native Three.js directly without being locked into another rendering API.

3

u/Bavariasnaps 18d ago

so is there any disadvantage / anything it does worse than the normal three.js? Do you have a mechanism were you can automatically apply three.js engine updates to your engine?

2

u/Gullible_Ranger1402 17d ago

The main downside is extra complexity. For small projects or custom rendering experiments, plain Three.js can be simpler and give you more direct control.

Threedog uses native Three.js objects, so you still have access to its materials, shaders, scene graph, and renderer. But some engine-level integrations could introduce compatibility issues.

As for updates, it's currently built against Three.js r187. I haven't fully automated upgrades yet.

1

u/Bavariasnaps 17d ago

thanks for the deatailed answer. I think I lack the experience to judge right now whats better. but I could test both engines and see which first game version comes better out with the same prompt. would be an intersting test.

1

u/West_Satisfaction299 18d ago

I like the idea of this but on the playtesting side, I have found that Claude doesn't catch the majority of bugs. Only real players have much to my late nights.

1

u/Gullible_Ranger1402 17d ago

Exactly. I think feedback is one of the biggest missing pieces in AI-assisted game development. AI can write code pretty well, but it often has no idea whether the game actually works or looks right.

That's why I built a set of tools around the development loop:

  • threedog play / press / step — The AI can launch the game, simulate real keyboard inputs, and advance game time. It can actually playtest what it builds instead of just assuming the code works.
  • threedog describe / inspect / explain — These expose the running game state, object details, and reasons behind certain behaviors. For example, the AI can investigate why an interaction failed or which system currently controls an object.
  • threedog shot — Captures screenshots and provides visual diagnostics, including problems like overexposure and potentially problematic lighting.
  • threedog check — Checks code, content, and engine API usage for common mistakes.
  • threedog verify — Runs automated gameplay scenarios and reports PASS/FAIL results.
  • threedog how — Helps the AI discover existing engine features and relevant documentation instead of reinventing systems.

All of these are accessible through CLI and MCP, so agents like Claude Code can use them directly.

For example, if I ask AI to implement an inventory pickup system, it can write the code, launch the game, simulate pressing E near an item, inspect whether the inventory actually changed, and investigate the failure if it didn't. Then it can fix the problem and test again.

The idea is to make the loop code → play → observe → diagnose → fix → repeat as automated as possible.

1

u/barret232hxc 18d ago

so it sounds like you wanted to have better playtesting and debugging, were there any other problems the engine solved for your game dev needs. Do you have a long a project you have been working on that uses your engine, or you haven't got that far

2

u/Gullible_Ranger1402 17d ago

AI is very good at frontend and I want to make most of it.
And I think the bigger problem was all the boilerplate and coordination work that comes with building games directly in Three.js.

So, I wanted something that handles the common systems and makes them work together, then I can focus more on gameplay instead of constantly managing the underlying code.

And I let AI to build over twenty demos to collect feedbacks and frictions from them!
And I just released the stable version!

0

u/HeadClot 18d ago

Hey this is very cool. I am not an AI Dev but I have a few questions.

  1. What does your editor look like?
  2. How many people can the multiplayer side of the engine handle? I know it is experimental but I need to ask
  3. What format does your engine have for the scene system? Json, GLTF/GLB, etc?

2

u/Gullible_Ranger1402 18d ago

Thanks! Glad you're interested!

1. Editor

There's a lightweight in-browser editor you can open with F2. You can select objects, move them around, and save changes directly back to the content files.

It's not a full Unity-style editor, though. Threedog is primarily code-driven, especially since it's designed for AI agents.

2. Multiplayer

It's currently designed for small co-op games, using a host-authoritative model with state synchronization.

There's no client prediction or rollback yet, so it's better suited for co-op building, puzzles, or turn-based games rather than fast-paced multiplayer. I haven't benchmarked the maximum player count yet.

3. Scene formats

Both GLTF/GLB and code-generated Three.js scenes are supported. You can also define objects, templates, and placements through JavaScript content files.

There's no proprietary scene format you have to use.

Hope that answers your questions!