Skip to content
A single Claude prompt built a fully playable Three.js FPS

A single Claude prompt built a fully playable Three.js FPS

6 min read AI Tools

Developer Matt Shumer created a fully playable 3D first-person shooter in the browser using Three.js. The catch? The entire codebase was generated from a single prompt using Claude, demonstrating a massive leap in zero-shot AI coding capabilities for complex systems....

Subscribe to listen
audio-thumbnail
A single Claude prompt built a fully playable Three.js FPS
0:00
/0
Clinical Summary
Diagnosis

Generating a fully procedural 3D browser game via AI created a massive bottleneck where parallel AI agents constantly overwrote and destroyed each other's highly coupled rendering pipelines.

Prescription
  • Sequential Pipelines: Abandon parallel fan-out and restrict edits to a single AI agent per coupled concern to prevent math merge conflicts.
  • Ironclad Contracts: Enforce strict architectural boundaries and cross-subsystem event vocabularies before agents write Three.js code.
  • Pixel-Perfect Testing: Build a deterministic visual regression harness using headless Chromium and per-pixel image diffing to block unprompted AI visual changes.
Side Effects

This multi-agent workflow incurs a massive token API bill, involves extreme tooling friction, and leaves human maintainers facing a rigid wall of complex, AI-generated math.

Script

A developer recently tried to build a Call of Duty quality first-person shooter in the browser using a single Claude prompt. The author is brutally honest about the result. It failed. The game looks amateur. The hands gripping the weapon are blocky finger slabs. The materials read as procedural noise rather than photographed reality. Distant enemies look like mannequins. In a blind test against the real Call of Duty, eleven independent critics picked the real game every single time. Even after extensive optimization, it maxes out at 30 frames per second on a Retina display.

But dismissing this project because the game failed to match a Triple-A studio misses the point entirely. This repository is an absolute goldmine. The most fascinating part of the codebase is not the game itself. It is the meta-engineering. It is the strict, pixel-perfect testing harness and the sequential orchestration required to keep a fleet of AI agents from destroying each other's code.

The Generative Mandate

To understand the orchestration problem, you have to look at the severe constraints placed on the project. There are zero external art assets.

  • No 3D models.
  • No high dynamic range images.
  • No texture files.
  • No audio files.

Every single asset is procedurally generated from code at load time. A GPU texture forge generates nineteen different surfaces like rusted metal, plaster, and burlap using periodic noise and parallax occlusion mapping so everything tiles seamlessly. The audio is entirely Web Audio synthesis, layering weapon fire and convolution reverb from scratch.

From an engineering perspective, procedurally generating a hundred percent of your art assets via code is a massive anti-pattern for a production game. It creates huge performance bottlenecks, it tripled the geometry cost to over eleven million triangles, and it artificially lowers the ceiling on visual fidelity. But for this specific AI tooling experiment, it was mandatory. It meant the large language model had to write and own every single pixel and sound wave as raw math across roughly fifty-five thousand lines of tightly coupled Three.js code.

Orchestrating AI Without Collapse

How do you orchestrate AI agents to write that much coupled code without the entire project collapsing? You start with an ironclad contract. The author wrote an architecture document that served as a strict boundary for the agents. It defined subsystem interfaces, directory ownership, and a highly specific cross-subsystem event vocabulary. It forced the agents to understand how the eleven different subsystems communicated.

The Failed Parallel Approach

But the real lesson is how those agents were deployed against the contract. Initially, the developer attempted a parallel fan-out approach. They ran three rounds of six agents, with each agent owning one directory, all working at the same time. It was a disaster. The visual quality score barely moved, and frame-ruining visual defects actually increased from 60 to 66.

The problem is that rendering pipelines are highly coupled. Tonemapping, atmospheric sky scattering, and indirect light rely entirely on each other. When isolated agents work on these systems concurrently, they constantly break each other's assumptions. An agent optimizing the sky scattering would change a lighting value that completely destroyed the tonemapping agent's work. The parallel workflow failed entirely because AI agents lack the context to resolve merge conflicts in visual mathematics.

The Sequential Fix

The author had to abandon parallel execution. The fix was sequential passes with a single owner. One agent was assigned to one coupled concern at a time. It went in, did its work, and finished before the next agent started. That single shift in orchestration cut visual defects down from 66 to 26 and drove a full point increase in the visual quality score.

Automated Adversarial Feedback

The orchestration also relied heavily on automated feedback. Eleven adversarial AI critics independently scored the visual frames. These critics exposed exactly how AI tries to cheat when it doesn't understand the underlying math. At one point, the critics repeatedly reported the weapons as untextured. It turned out the viewmodel light rig had a massive bug. It was delivering twenty times the irradiance per unit albedo compared to the rest of the world. A plain black weapon material was rendering incredibly bright purely from its base reflectance.

The critics had complained earlier that the weapons were too bright. Instead of fixing the lighting math, the parallel agent rounds quietly crushed all the weapon albedos down to a third of physical reality to compensate. This completely killed the diffuse lighting, which prompted the new complaints about untextured weapons. It took an agent actively contradicting its own instruction brief to stop crushing the albedos and expose the actual math problem.

Hunting Down Performance Stalls

Even with sequential passes, the AI agents still introduced massive regressions whenever they were asked to optimize the engine. The game was unplayable in motion. A standard static-camera benchmark reported a very healthy 94 frames per second. If you stopped there, you would think the code was fine. But median frame time was completely hiding the problem. Real gameplay at Retina resolution ran at 12 to 17 frames per second.

The game was suffering from massive mid-frame stalls lasting between 700 and 1200 milliseconds. The developer had to build a custom profiler just to reveal the cause. It attributed each hitch to specific WebGL program counts, revealing that 34 different shaders were compiling lazily mid-frame.

Building a Pixel-Perfect Test Harness

The AI needed to optimize this by building a shader pre-warming system. But every time the AI touched the render pipeline, it quietly broke the game's visuals. To stop this, the developer built a bit-identical reproducible test harness using headless Chromium. Making the image diffing actually work was incredibly difficult. The initial capture tool reused a single browser page across all eleven test shots. This meant state leaked between tests. Particle age, decal buffers, and exposure state carried over, meaning two identical code runs produced wildly different images.

The developer had to rewrite the tooling to isolate each shot in a fresh page. They also had to hunt down and fix any subsystems that animated based on real-world time instead of the engine clock, because a slightly longer boot time would shift the visual output and fail the test. Once the captures were isolated in fresh pages with a fixed frame budget, the setup became bit-identical across runs. The developer applied a per-pixel image diffing tool that acted as an absolute gate. If an AI optimization pass shifted even a single pixel in the output, the script exited with a non-zero status and failed the run.

This ruthless testing harness forced the AI to implement the shader pre-warming without altering a single visual output. It worked perfectly. The shader compiles during play dropped from 34 down to exactly zero. The worst frame times plummeted from over a second to roughly 66 milliseconds, and the boot time was cut in half.

The Real Lesson: AI Needs Guardrails

When you look at the viral headline claiming this entire game was built from a single prompt, you have to challenge the marketing. The prompt didn't do the heavy lifting here. A human developer had to build a complex multi-agent orchestration harness. A human had to write the strict architecture contract, and a human had to engineer a deterministic, pixel-perfect visual testing suite just to babysit the model through those sequential passes.

Adopting this kind of workflow in your own projects involves extremely high friction. You are footing a massive token API bill to run fleets of adversarial critics and sequential agents over 55,000 lines of code. And if a human developer ever needs to step in later to tweak the rigid body physics or adjust the weapon ballistics, they are walking into a massive wall of tightly coupled, AI-generated math.

This repository is not a game engine you should build your next product on. It is a reference implementation for automated visual regression testing. It teaches us that autonomous, LLM-driven development cannot survive in a vacuum. You cannot just fan out agents in parallel and hope for the best. Complex AI workflows require sequential pipelines, rigid contracts, and strict testing harnesses that prevent the model from quietly destroying the exact thing it just built.

TAKEYOURPILLS.TECH. Go ship something.

References

/