An AI agent wrote a browser shooter's engine in 2 hours; the whole project is 28,000 lines
A Habr developer went back to the browser shooter Battlecringe and took it to a public server. The AI agent wrote a working game engine in 2 hours, two more evenings went into refinement, and the project grew to about 28,000 lines of code, including documentation. Rules for the agent, a description of each feature, and automated tests made the difference. So with an agent, invest in the backlog and tests first, and only then in prompts.
AI-processed from Habr AI; edited by Hamidun News
Vibe coding is usually demonstrated with toy examples: a landing page, a calculator, a snake game. This case is more serious. A Habr developer rewrote the online shooter Battlecringe with an AI agent doing the work. The agent put together a working game engine in 2 hours, and the author's friend was already able to log in and play at that point. Two more evenings went into a stable version, and the project ended up with about 28,000 lines of code, including documentation. The author published real figures for time, tokens, and server resources, which is rare for stories about agents.
How the project came back from oblivion
Battlecringe is a low-poly browser shooter with a top-down view. It has PvP for up to 10 players, a cooperative Survival mode, operations on procedurally generated maps, friends, clans, a shop, and skins. Earlier, the author had already tried to make this game with Cursor, but ended up with raw networking code, poor ping and FPS, and almost no graphics. He abandoned the project.
What got him back to the idea was the release of a model he calls Fable5.2, along with Saltline, a WebGL and Three.js shooter written from almost a single prompt. The author threw out the old code entirely and started from scratch.
The stack is conventional: a client in TypeScript, React, and Three.js; a server in Go made of two services (the game engine and the API); MongoDB, Docker, Caddy, and GitHub Actions. Hosting is a VPS with 1 GB of RAM and one vCPU.
How the working loop with the agent runs
The secret is not one successful prompt but the discipline around the agent. The author set the rules in advance: don't push to master, when and how to run tests, which release policies to follow. He split the backlog into files in the docs folder, one description per feature.
Then the loop repeated:
- The author states the task in text.
- The agent analyzes the statement and, if needed, asks clarifying questions in the chat.
- The agent creates a feature specification file and writes the code.
- Unit and smoke tests run.
- A full e2e session runs: bot scripts play a match, and the agent takes screenshots as the game goes.
- A pull request is opened, and the author confirms it manually.
The author revised the loop's rules many times in the Claude.md file. The main drawback is that a single e2e run takes about 10 minutes, because the hardest things to verify are sudden death and the end of a match on the timer. So the tests ran once per pull request, and several features ended up in a single PR. As a result, the tests did not always pass on the first try.
What the numbers show
Master received 176 commits, there were 45 pull requests in total (21 of them were looked at in master), and 14 epics. Test coverage is about 91%, but it was measured only for Go, not for TypeScript.
The agent's work took about 20 hours, mostly spent waiting for e2e tests. The agent generated 8.3 million tokens and read about 945 million, mostly from cache. Reading context accounts for most of the volume, and without caching this work would have cost noticeably more.
Performance on modest hardware is decent. The target of 60 frames per second holds: the frame time at the 99th percentile is 16.8 ms, so nearly all frames fit within that limit.
The number of draw calls (commands by which the CPU asks the GPU to render objects) at low, medium, and high settings is 39, 49, and 68. Before the fix in the second version, the peak reached 279–304. The models contain 73 thousand triangles at low settings and 141 thousand at medium and high.
The client bundle weighs 284 KB gzipped. The server takes 0.1 vCPU and about 200 MB of memory when idle, of which roughly 150 MB goes to MongoDB.
The Docker images are small: 23.6 MB for the API and 18.7 MB for the game service.
What to keep in mind
The figures come from the author himself and were not independently verified. He tested load with five simultaneous players at most, and calls the estimate for 50 people a projection. Part of the feature description was generated from the changelog, so each mechanic's behavior should be checked in the game itself.
The practical lesson is simple. The agent does well when it has specifications, working rules, automated tests, and e2e verification. The bottleneck is not how fast code gets written but how fast it can be verified. If you want to repeat this path, invest in fast tests and a careful backlog first, and only then in prompts. The author promises separate articles about the development loop itself and about the engine's architecture.
- Nov 21, 2026Claude Code writes and publishes SEO articles three times a day on a schedule
- Nov 21, 2026Nvidia RTX Spark Mini PCs With 128 GB Memory Can Run 120B-Parameter AI Models, Starting at $4,399
- Nov 21, 2026Google Releases Harness²: AI Agent Tunes Its Own Harness, GLM-5 Score Rises from 64.2 to 75.7
- Nov 21, 2026OpenAI Launches ChatGPT Wallet: Agents Pay Without Access to Card Numbers
Key Questions Answered
How the project came back from oblivion?
Battlecringe is a low-poly browser shooter with a top-down view. It has PvP for up to 10 players, a cooperative Survival mode, operations on procedurally generated maps, friends, clans, a shop, and skins. Earlier, the author had already tried to make this game with Cursor, but ended up with raw networking code, poor ping and FPS, and almost no graphics. He abandoned the project.
How the working loop with the agent runs?
The secret is not one successful prompt but the discipline around the agent. The author set the rules in advance: don't push to master, when and how to run tests, which release policies to follow. He split the backlog into files in the docs folder, one description per feature. Then the loop repeated: The author states the task in text. The agent analyzes the statement and, if needed, asks clarifying questions in the chat. The agent creates a feature specification file and writes the code. Unit and smoke tests run.
What the numbers show?
Master received 176 commits, there were 45 pull requests in total (21 of them were looked at in master), and 14 epics. Test coverage is about 91%, but it was measured only for Go, not for TypeScript. The agent's work took about 20 hours, mostly spent waiting for e2e tests. The agent generated 8.3 million tokens and read about 945 million, mostly from cache. Reading context accounts for most of the volume, and without caching this work would have cost noticeably more. Performance on modest hardware is decent.
Test Frontier LLMs & Autonomous Agents in One Workspace
Run Claude Opus 5.5, GPT-6, Gemini 3.1, and DeepSeek side-by-side in Nomad AI (nomadnet.ai) — unified model routing, deep research, and multimodal workflows under one subscription.
The AI world, distilled — once a week
Seven stories that actually mattered, hand-picked. No noise, no reposts, no press releases.
Done! Check your inbox for a confirmation.