GitHub - mshumer/Claude-of-Duty: A Call of Duty-quality FPS in Three.js, built from a single prompt. · GitHub
/" data-turbo-transient="true" />
Skip to content
Search or jump to...
Search code, repositories, users, issues, pull requests...
-->
Search
Clear
Search syntax tips
Provide feedback
--><br>We read every piece of feedback, and take your input very seriously.
Include my email address so I can be contacted
Cancel
Submit feedback
Saved searches
Use saved searches to filter your results more quickly
-->
Name
Query
To see all available qualifiers, see our documentation.
Cancel
Create saved search
Sign in
/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up
Appearance settings
Resetting focus
You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.
Dismiss alert
{{ message }}
mshumer
Claude-of-Duty
Public
Notifications<br>You must be signed in to change notification settings
Fork<br>122
Star<br>618
main
BranchesTags
Go to file
CodeOpen more actions menu
Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit
History<br>2 Commits<br>2 Commits
src
src
tools
tools
.gitignore
.gitignore
ARCHITECTURE.md
ARCHITECTURE.md
LICENSE
LICENSE
README.md
README.md
index.html
index.html
package-lock.json
package-lock.json
package.json
package.json
prompt.md
prompt.md
vite.config.js
vite.config.js
View all files
Repository files navigation
Claude of Duty
Get updates here.
A first-person shooter built in the browser with Three.js r180 and WebGL2. Roughly<br>55k lines across 11 subsystems, written by a fleet of AI agents under orchestration.
There are no art assets. Every texture, mesh, animation and sound is generated<br>procedurally at load time from code. No models, no HDRIs, no image files, no audio<br>files. The only runtime dependency is three.
npm install<br>npm run dev # http://127.0.0.1:5173
Click the canvas to lock the cursor. WASD move, mouse aim, LMB fire, RMB ADS,<br>R reload, Shift sprint, Ctrl crouch, Space jump, Q/E lean, Esc release.
What's in it
subsystem<br>what it does
render<br>HDR pipeline, cascaded shadow maps in a sampler2DArray with texel snapping and PCSS contact hardening, MRT depth/normal/velocity prepass, GTAO, TAA with YCoCg variance clipping, tile-dilated motion blur, Karis bloom pyramid, GPU EV100 metering, procedural 33³ grade LUT, AgX composite
materials<br>GPU texture forge: 19 procedural surfaces (concrete, brick, plaster, asphalt, sand, rusted/painted/brushed metal, wood, fabric, burlap, glass…), periodic noise so everything tiles seamlessly, Sobel height→normal, parallax occlusion mapping, triplanar projection, curvature-driven edge wear
sky<br>Atmospheric scattering, time of day, PMREM environment generation, volumetric fog and light shafts
world<br>~120×120 m market street: modular building kit with real wall thickness, enterable interiors, several hundred instanced props
physics<br>Written from scratch, no library. Binned-SAH BVH (29k tris → 14k nodes in 22 ms, 0.25 µs/raycast), swept-capsule character controller with a 5-plane crease stack, impulse rigid bodies with CCD, PBD ragdolls, multi-layer bullet penetration
player<br>Movement state machine, slide/mantle/lean, camera feel
weapons<br>Procedural weapon geometry, viewmodel rig, ADS, spring recoil, procedural reloads, ballistics with travel time and drop
fx<br>GPU particles, decals, tracers, muzzle flash, explosions
ai<br>Skinned soldiers, navmesh pathing, perception, cover behaviour, ragdoll death
ui<br>DOM/CSS HUD: crosshair, hitmarkers, minimap, compass, killfeed
audio<br>Web Audio synthesis — no sound files. Layered weapon fire, convolution reverb, HRTF spatialisation, occlusion
ARCHITECTURE.md is the contract the agents worked against: subsystem interface,<br>directory ownership, the cross-subsystem event vocabulary, and shared surface types.
Tooling
The interesting part of this repo is arguably the harness, not the game.
tool<br>purpose
tools/capture.mjs<br>Screenshot one named shot via GPU-backed headless Chromium
tools/shotset.mjs<br>All 11 shots in one session — fast review set
tools/baseline.mjs<br>Reproducible capture: each shot in an isolated page, fixed frame budget. Bit-identical across runs
tools/imagediff.mjs<br>Per-pixel gate. Exits non-zero if any pixel moved
tools/profile.mjs<br>Gameplay profiler at real device pixel ratio. Frame-time distribution and hitch attribution via per-frame WebGL program counts
tools/playtest.mjs<br>Scripted movement/fire smoke test
Two findings worth recording, because both invalidated earlier measurements:
Median frame time hides the actual problem. A static-camera benchmark reported<br>94 fps while the game was unplayable. Real gameplay at Retina DPR (internal 3.34 MP,<br>not 2.07) ran 12–17 fps with 728–1236 ms stalls caused by 34+ WebGL programs<br>compiling lazily mid-frame. profile.mjs reports...