Skip to content
Claude CodegreenfieldGames10 files · +2466 −115

Build a Tarkov-style single-file Three.js FPS with raid loop

Session from tarkov-customs-trajectory on Hugging Face by INONONO · MIT · condensed by Coders Talk

1h 12msession
0interventions
GOAL

Create a fully playable, bug-free single-HTML Three.js FPS clone of Escape from Tarkov's Customs map, with procedural assets only, gun customization, and a full spawn/loot/fight/extract raid loop.

  1. Prompt · +0
    Build a full Tarkov Customs-style 3D FPS as a single HTML file: Three.js from CDN only, no asset files, procedural geometry/audio, gun customization, and full raid loop (spawn, loot, scav AI, extract).
  2. Agent did · +11m
    Built the game from scratch as modular JS/HTML source files (head, core utils/audio, weapons/mods, world builder, Customs map geometry, player controller, scav AI, game/FX, menu/profile) then concatenated them into one customs.html.
  3. Agent did · +40m
    Wrote a Playwright-based headless test harness (test.mjs) to load the game in a real browser, drive the player, and check for runtime errors and mod stats.
  4. Fail · +44m
    Headless run threw a pointer-lock error ('root document not valid for pointer lock') that broke deterministic driving of player movement, especially on stairs.
  5. Agent did · +45m
    Debugged extensively with custom dbg.mjs scripts and pixel sampling: fixed pointer-lock stub, switched test to fixed-step manual updates, then chased a black-screen rendering bug through camera/scene/material/texture checks until FOV/scope logic was fixed.
  6. Fail · +59m
    Test suite reported FAIL on loot interaction: pressing F on a wooden crate didn't open it or add the expected items to inventory.
  7. Agent did · +1h 0m
    Repositioned a parked scav in the test script so it stopped blocking the loot interaction, then reran the full suite to ALL PASS including a 180s AI soak test.
  8. Fail · +1h 9m
    Later runs turned up more test failures: a door-walkthrough check failed on position, and the extraction test found weapons/stash counts didn't match after extracting.
  9. Agent did · +1h 9m
    Adjusted the test assertions and scav-removal logic to match actual game behavior (killing scavs properly, correct expected weapon/stash counts), then reran until every check passed with no console errors.
  10. Outcome · +1h 12m
    Shipped customs.html, a 193 KB single-file build (Three.js r160 + procedural everything) with a full raid loop, ~175 loot containers, 15+ scav AI, weapon modding, and a passing headless Playwright test suite.
VERDICT

I'd start the same way — one big spec prompt covering geometry, audio, customization and the full raid loop — since the agent could carry that end-to-end without hand-holding. What actually moved things forward wasn't me correcting it (I never had to step in), it was making the agent build its own Playwright test harness and debug scripts, which caught the pointer-lock bug, the black-screen rendering issue, and the broken loot/door/extract checks that a purely visual pass would have missed. Next time I'd ask for the headless test harness up front instead of after the first build pass, to catch these earlier.

I tried this · 0

Discussion · 0

How Builds work