Model or dataset
mshumer/Claude-of-Duty avatar
mshumer/Claude-of-Duty

Claude of Duty: A Browser FPS Assembled by AI Agents

A Call of Duty-quality FPS in Three.js, built from a single prompt.

3,447 stars521 forksJavaScriptMIT

At a glance

What is it?
Claude of Duty is a first-person shooter that runs in the browser, built from a single AI prompt using Three.js and WebGL2, with no art assets whatsoever. The project is as much an experiment in multi-agent software orchestration as it is a playable game.
Who is it for?
Engineers studying multi-agent code generation should clone this repository and read ARCHITECTURE.md first; it is the contract that made 11-agent coordination possible at all. Game developers who want a production-quality browser FPS should not use it as a base: the unresolved viewmodel light-rig bug in render/index.js and the 28-to-30-fps ceiling at Retina resolution are costs that have not been fixed and cap the experience well short of the stated goal.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 68 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 1, 2026, and from our analysis. They are not legal advice.

Editorial analysis

A Browser FPS Written Without Any Art Files

Claude of Duty is a full first-person shooter that runs in the browser, written in Three.js r180 using WebGL2. It spans roughly 55,000 lines across 11 subsystems, and its repository contains no art assets of any kind. Every texture, mesh, animation, and sound is generated procedurally at load time from code. The only runtime dependency is the Three.js library itself.

The project is for engineers who want to observe what a fleet of AI agents can produce when given a complex, cross-disciplinary software task and a strict architectural contract. It is not a finished game. The README states plainly that a blind A/B comparison against a real Call of Duty frame was run in each round, and every critic picked the real game every time.

The Eleven-Subsystem Architecture and Its Contracts

The repository is organized into 11 named subsystems: render, materials, sky, world, physics, player, weapons, fx, ai, ui, and audio. The file ARCHITECTURE.md defines the contract the AI agents worked against, specifying each subsystem's interface, its directory ownership, the cross-subsystem event vocabulary, and shared surface types.

The physics subsystem is written from scratch with no external library. It includes a binned-SAH BVH that compresses 29,000 triangles to 14,000 nodes in 22 ms, yielding a 0.25-microsecond per-raycast figure. The character controller uses a swept-capsule with a five-plane crease stack. The system also handles impulse rigid bodies with continuous collision detection, position-based dynamics ragdolls, and multi-layer bullet penetration.

The render subsystem applies an HDR pipeline with cascaded shadow maps stored in a sampler2DArray with texel snapping and PCSS contact hardening, a multi-render-target depth/normal/velocity prepass, GTAO, TAA with YCoCg variance clipping, tile-dilated motion blur, a Karis bloom pyramid, GPU EV100 metering, a procedural 33-cubed grade LUT, and AgX composite.

The audio subsystem uses Web Audio synthesis throughout. No sound files ship with the project. It produces layered weapon fire, convolution reverb, HRTF spatialisation, and occlusion from code alone.

The world subsystem generates a market street roughly 120 by 120 meters in size. It uses a modular building kit with real wall thickness, enterable interiors, and several hundred instanced props. The materials subsystem runs a GPU texture forge producing 19 procedural surfaces including concrete, brick, plaster, asphalt, sand, rusted metal, painted metal, brushed metal, wood, fabric, burlap, and glass. Surfaces use periodic noise for seamless tiling, Sobel height-to-normal conversion, parallax occlusion mapping, triplanar projection, and curvature-driven edge wear.

Installing and Running Locally

Installation requires Node.js and npm. Clone the repository and install dependencies, then start the development server:

bash
npm install
npm run dev          # http://127.0.0.1:5173

Once the server is running, open the URL in a browser, click the canvas to lock the cursor, and use WASD to move, mouse to aim, LMB to fire, RMB to activate aim-down-sights, R to reload, Shift to sprint, Ctrl to crouch, Space to jump, Q or E to lean, and Esc to release the cursor.

The package.json also provides a `shot` script that runs a single named screenshot capture via headless Chromium using `tools/capture.mjs`. A `preview` script serves a production build on port 4173.

Shader Compilation Stalls and the Performance Recovery

The single most significant performance problem was lazy shader compilation happening mid-frame during active gameplay. A static-camera benchmark reported 94 fps while the game was unplayable at real Retina resolution (an internal resolution of 3.34 megapixels, not 2.07 megapixels). Real gameplay ran at 12 to 17 fps with worst-frame stalls of 728 to 1,236 milliseconds caused by 34 to 35 WebGL programs compiling in the hot path.

The fix is the shader pre-warm module at `src/core/prewarm.js`, which compiles all shaders at startup. After applying it, p50 frame time rose from the 12-to-17-fps range to 28 to 30 fps, the worst frame fell from 728 to 1,236 ms to 66 to 82 ms, and boot time dropped from 9 to 12 seconds to 3.7 to 4.6 seconds. All shader compiles during gameplay went from 34 to 35 to zero.

The profiling tool `tools/profile.mjs` reports p50, p95, and p99 frame time and attributes each hitch by per-frame WebGL program count at real device pixel ratio. The standard median benchmark hid the problem entirely, which is why the tool was necessary.

Capture reproducibility was also a problem: `tools/shotset.mjs` reuses one browser page across all 11 shots, so particle age, decal buffers, and exposure state leak forward. Two identical runs differed on 10 of 11 shots. `tools/baseline.mjs` isolates each shot in a fresh page, making results bit-identical, which lets `tools/imagediff.mjs` exit non-zero on any pixel change and serve as a regression gate.

Where the Game Falls Short, and a Known Unfixed Bug

The README includes a scored assessment: eleven adversarial critics rated frames against a modern Call of Duty, and scores moved from 3.59 through 4.14, 4.05, and up to 5.05 out of 10. Two shots reached the label 'CLOSE'; the rest were rated 'AMATEUR'. Every critic in every round picked the real game in the blind comparison.

Specific failures include blocky hand geometry that does not convincingly grip the weapon, surfaces that read as procedural noise rather than photographed reality at close range, enemy characters that look like mannequins at distance, and indirect lighting that is approximate rather than computed.

A root cause that remains unfixed is in the viewmodel light rig inside `render/index.js`. The rig delivers roughly 20 times the irradiance per unit albedo that the world scene receives. A plain black material in the view scene renders at a luminance of 110 against a world background of 91, purely from the specular term at F0=0.04. To compensate, every weapon albedo is set to one-third of its physical value, which caps material separation on the most-viewed object in the game. The fix requires coordinating the lighting model across at least the render, materials, and weapons subsystems simultaneously, which has not been done.

What the Orchestration Rounds Showed About Agent Parallelism

Three rounds of six agents each owning a single directory moved the quality score by +0.46 in total and left defect counts higher than they started (60 to 47 to 66). The reason is that the render, sky, and indirect lighting subsystems form a tightly coupled system. Isolated agents kept breaking each other's assumptions because they could not coordinate on the shared model.

One sequential pass with a single owner per coupled concern moved the score by +1.00 and cut defects from 66 to 26. Sequential single-owner passes outperformed parallel fan-out decisively on the parts of the codebase where subsystems share state.

The most valuable individual result came from an agent contradicting its own brief. After three rounds in which every critic reported the weapon as untextured, an agent measured the diffuse term at luminance 26 against a shipped luminance of 67. The weapon was specular-dominated, not untextured. Prior rounds had been reducing albedos to address bright-part complaints, which destroyed the diffuse contribution and made the problem worse.

Maintenance Status and Licence

The last push to the repository was on 2026-07-25. The project has no GitHub releases; version tracking is by commit hash. The licence is MIT. The package.json sets `private: true`, signalling the repository is not intended for npm publication.

Runtime dependencies are minimal: only `three` at version 0.180.0. Development dependencies are Playwright, pngjs, and Vite. The test harness is entirely the custom tooling in the `tools/` directory.

An alternative benchmark for this kind of project is Google's GameSnacks or any hosted Three.js demo, both of which require prebuilt art. Claude of Duty differs by generating all assets at runtime from code, which eliminates download overhead but places a hard ceiling on visual fidelity, because generated procedural noise does not match the richness of photographed textures regardless of how many layers it has.

Editorial conclusion

Engineers studying multi-agent code generation should clone this repository and read ARCHITECTURE.md first; it is the contract that made 11-agent coordination possible at all. Game developers who want a production-quality browser FPS should not use it as a base: the unresolved viewmodel light-rig bug in render/index.js and the 28-to-30-fps ceiling at Retina resolution are costs that have not been fixed and cap the experience well short of the stated goal.

Frequently asked questions

Does Claude of Duty require any art files to run?

No. Every texture, mesh, animation, and sound is generated procedurally at load time from code. The repository contains no image files, no audio files, and no 3D model files. The only runtime dependency is Three.js.

What does the ARCHITECTURE.md file define in Claude of Duty?

ARCHITECTURE.md is the contract the AI agents worked against. It specifies each subsystem's interface, its directory ownership, the cross-subsystem event vocabulary, and the shared surface types that components may pass to one another.

What caused the frame-rate stalls before optimization, and how were they fixed?

Lazy shader compilation triggered 34 to 35 WebGL programs compiling mid-frame during active gameplay, causing stalls of up to 1,236 milliseconds. The fix is the pre-warm module at src/core/prewarm.js, which compiles all shaders at startup and reduced active-gameplay shader compiles to zero.

Official sources

  1. Issues
  2. License: MIT
  3. mshumer/Claude-of-Duty on GitHub
  4. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/mshumer-claude-of-duty.svg)](https://hysenlabs.com/projects/mshumer-claude-of-duty)