Making Games With AI: Getting Development Costs Down to 20 RMB
This article examines what actually changed when a single engineer used AI to produce a browser-playable, 3A-looking shooter in a few hours: the cost of a playable prototype dropped from several person-months to the price of a team dinner. It covers why the web is the best substrate for AI-generated games, how to decompose the headline cost into code generation, asset generation, iteration, hosting, and human time, and why the real lever is raising the first-pass success rate rather than cutting per-call prices. You'll get a reusable skeleton (a fixed-timestep loop, a layered architecture with explicit contracts, and externalized game-feel parameters), an honest account of where AI still falls short, a validation loop for shipping and measuring cheaply, and a practical checklist for before, during, and after generation. The core takeaway: AI compressed implementation cost, not judgment cost.
1. A Fact Already in Progress: Capacity Is No Longer the Bottleneck, Judgment Is
A realistic browser-playable shooter, generated by a single engineer with AI over the course of a few hours, recently drew a lot of attention. The lighting, materials, and completeness of the interaction led many practitioners to assume it was cloud streaming running some existing AAA title behind the scenes. It was not. The models, textures, and sound effects were all generated from scratch by AI, and the total cost works out to roughly what a team dinner costs.
What makes this case worth attention is not “AI can build a web game that looks AAA.” It’s the structural change it exposes: the economic cost of producing a playable prototype has fallen from “several person-months” to “one bill.” We used to say that validating whether a mechanic is worth building was primarily a cost in engineer time. Now the cost is primarily model invocation fees plus the author’s judgment.
So “are game producers all about to be laid off” is a false question. What AI replaces is repetitive implementation labor, not the decision of what is fun. The genuinely scarce resource has shifted from capacity to taste and prioritization.
The goal of this article is to take something that looks like magic and reduce it to a reproducible, measurable, regression-testable engineering practice.
2. Why the Web Is the Best Substrate for AI-Made Games
Setting aside personal preference, the browser became the default form factor for AI-generated games for three hard technical reasons:
- Single-file delivery, context-friendly. One HTML file carrying Canvas rendering, the game loop, and inlined assets (Base64 or procedurally generated) lands right inside the model’s high-quality output range. The smaller the file and the fewer the dependencies, the less likely the model is to hallucinate APIs that don’t exist.
- Zero build, zero install. No editor project configuration, no scene file formats, no asset pipeline. Edit, refresh, done. The feedback loop shrinks from minutes to seconds. For AI collaboration, feedback loop speed directly determines the number of iteration rounds, and the number of rounds directly determines cost.
- A link is distribution. The output is published to static hosting as a URL, and anyone can open it and play. That drives the cost of finding playtesters and collecting feedback toward zero as well.
Compare that with a traditional engine workflow. Engines win on mature physics, animation, asset management, and cross-platform packaging. They lose because AI struggles to operate directly on serialized scene and prefab files, and tends to produce projects that “look right but won’t open.” In a web environment with no build step and no editor metadata, the conversion cost between AI output and a runnable artifact is essentially zero.
3. Breaking Down the “20 RMB”: What the Cost Model Actually Looks Like
The “20 RMB” in the headline is a boundary condition, not a universal promise. Understanding it starts with understanding what the cost is made of:
total cost ≈ code generation + asset generation + iteration and debugging + hosting and traffic + human time
Item by item:
- Code generation: proportional to number of interaction rounds × context length per round. This is the only item that looks tiny under the ideal case of getting it right in one pass.
- Asset generation: the number of generation calls for textures, sound effects, and models. Procedural generation (noise textures, Web Audio synthesis for SFX) can push this close to zero.
- Iteration and debugging: the real cost driver. The large majority of spending goes not into producing the first version but into fixing the parts of that first version that “run but aren’t right” — collision tunneling, deadlocked state machines, frame rate collapse.
- Hosting and traffic: static asset hosting plus CDN distribution, usually the most negligible item of all.
- Human time: convert it at market rates and “20 RMB” immediately becomes at least an order of magnitude larger. The low cost, in essence, comes from trading expensive engineer time for cheap model calls.
This leads to one key conclusion: the core of cost reduction is not pushing down the per-call price, but raising the first-pass success rate of each round. Below is a script you can use for up-front estimation, so you can judge whether an idea is expensive before you start:
def estimate_cost(rounds, ctx_tokens, out_tokens,price_in, price_out, asset_calls, asset_price):"""Estimate code and asset generation cost by number of interaction rounds.For pricing, use your service provider's current rates; this is only forcomparing orders of magnitude."""code = rounds * (ctx_tokens * price_in + out_tokens * price_out)assets = asset_calls * asset_pricereturn {"code": code, "assets": assets, "total": code + assets}# A web mini-game of roughly 2,000 lines typically needs 15-40 rounds to convergeprint(estimate_cost(rounds=30, ctx_tokens=18000, out_tokens=2500,price_in=1.0, price_out=3.0,asset_calls=40, asset_price=0.2))
Put this estimate in the same table as “two days of one engineer’s time,” and you can see “20 RMB” for what it is — and realize that cost optimization should be aimed at reducing the number of rounds, not at spending less per call.
4. A Reusable Skeleton: Keeping AI Output in the “Structurally Correct” Zone
When AI fails at writing a game, it’s usually not because it can’t produce the features. It’s because once the architecture is a mess, every subsequent round of changes manufactures regressions. So the first step should not be “make a shooter.” It should be to establish a fixed skeleton and attach gameplay to it as pluggable modules.
4.1 Fixed-Timestep Loop: The Prerequisite for Determinism
Browser rendering runs at the screen refresh rate, but physics and game logic must advance in fixed steps, or the feel and the results will drift across devices. Worse, AI frequently writes logic directly inside the render callback, so frame rate fluctuation contaminates gameplay.
const STEP = 1000 / 60; // fixed logic step: 16.67mslet acc = 0, last = performance.now();function frame(now) {acc += Math.min(now - last, 250); // clamp, to avoid a "catch-up avalanche"// when returning from a backgrounded tablast = now;while (acc >= STEP) {update(STEP / 1000); // input sampling, physics integration,acc -= STEP; // collision, state machine}render(acc / STEP); // draw with an interpolation factor;// rendering decoupled from logicrequestAnimationFrame(frame);}requestAnimationFrame(frame);
This twenty-line loop is the foundation for everything that follows. Once it’s locked down, the logic layer’s output becomes deterministic and can be covered by automated tests — the single most effective way to drive down iteration and debugging cost.
4.2 Layering and Contracts
Enforce layering in your prompt, and require the model to output interface contracts (type definitions or data schemas) before implementation:
- Input layer: keyboard, mouse, and touch are abstracted into a unified set of action enums; the gameplay layer doesn’t care about the device.
- Logic layer: entity state machines + collision (AABB or bounding circles) + game rules, written as pure functions, never touching the DOM.
- Presentation layer: rendering, particles, screen shake, audio triggers; reads only snapshots from the logic layer.
- Persistence layer: saves written to browser local storage, so progress and high scores don’t depend on a backend.
- Asset layer: procedural textures and synthesized audio, generated on demand and cached.
The “logic layer never touches the DOM” rule matters especially. It lets the logic layer be driven directly by headless tests, so you can run regression checks across thousands of frames in seconds.
4.3 Make “Game Feel” a Configuration, Not Magic Numbers in Code
AI can write a feature-complete implementation, but it struggles to write good feel by intuition. The reason is that feel is a set of mutually coupled continuous parameters, and without feedback the model only produces textbook conservative values (for example, a gravity-to-jump-velocity ratio that makes the character “jump like it’s on the moon”). The engineering answer is externalized parameters plus visual tuning:
{"player": {"moveAccel": 2400, "maxSpeed": 320, "friction": 2800,"jumpVelocity": -640, "gravity": 1800,"coyoteTime": 0.10, // grace window to still jump after leaving the ground"jumpBuffer": 0.12 // pressing jump slightly before landing still registers},"feedback": { "hitStop": 0.06, "shakeIntensity": 6, "shakeDecay": 12 }}
Expose this config as a runtime panel (or even URL parameters), and the human gets final control over the “juice”: AI implements the mechanics, the human tunes the pacing. That is the engineering realization of the judgment that a good game isn’t about complexity but about being fun — fun is largely the combination of input responsiveness, layers of feedback (hit-stop, screen shake, audio, particles), and the pacing curve.
5. The Quality Ceiling: AI Can Match the Look, Not the “Why It’s Fun”
Given a clear reference target and a well-defined mechanic, AI can do a fairly good job with scene assembly, basic interaction, rule implementation, and visual reproduction. But it has three consistent weaknesses:
- No hypothesis about fun. Models are good at completing known patterns and bad at judging “does this mechanic still hold up at minute five.”
- Weak performance-budget awareness. Typical output allocates new objects every frame, iterates over all entities every frame, and loads textures at full resolution, then drops frames quickly on mobile. The countermeasure is to state constraints explicitly: object pooling, offscreen canvas caching for static layers, spatial partitioning for culling, a cap on first-load payload, and limits on per-frame allocation.
- Invisible regressions. Fix one thing, break three others. The countermeasure is to commit every round’s output to version control immediately and pair it with a headless regression script, so problems can be bisected.
To be candid: getting AI to produce a prototype that is “technically complete and mechanically correct” is quite reliable today. Getting it to produce a game “someone wants to play a second round of” still depends heavily on human design judgment and repeated playtesting.
6. From Prototype to Live: The Low-Cost Validation Loop
Distribution and observation after generation are the half of the engineering that many practitioners skip.
- Hosting and distribution: the artifact is purely static. Enable static website hosting on object storage and put a CDN in front of it, with a sensible caching strategy to control first-load size (keep the first screen under 2 MB and load large textures on demand).
- Backend-optional by default: for single-player games, local storage is enough for saves. If you truly need a leaderboard, let serverless functions handle the lightweight endpoint instead of maintaining an always-on server for one mini-game.
- Observability: add instrumentation (entry, first input, first death, completion, exit point) and frontend error monitoring, then use log search plus alerting to locate stalls and crashes. This turns “I think it’s fun” into comparable data.
- Fast playtesting: one shared link is one canary release. The full meaning of low-cost trial and error is idea → prototype → real human playtest → data feedback, with the whole loop measured in hours.
7. Practical Checklist
Before you start:
- Write the gameplay loop and win/loss conditions on a single page before generating any code. Vague requirements are the number one cause of exploding round counts.
- Generate and lock down the fixed-timestep skeleton and the layering contracts first, then add gameplay module by module.
- Run the cost estimation script up front to judge the order of magnitude, and reserve most of the budget for iteration.
While generating:
- Change one thing at a time per module, and commit to version control immediately after.
- Require testable pure logic functions from the model; forbid direct UI manipulation in the logic layer.
- State performance and payload constraints explicitly rather than optimizing after the fact.
Before launch:
- Extract game-feel parameters into config, tune them by hand, and keep a record of the tuning.
- Run headless regression: fix the random seed and verify that identical input produces an identical state sequence.
- Wire up error monitoring and instrumentation, and use real playtest data to decide whether to keep investing.
Conclusion: AI has pushed the marginal cost of game development down to a level that was hard to imagine before. But what it compressed is implementation cost, not judgment cost. The real barrier is shifting from “can it be built” to “do you know what makes it fun” — the first has been solved by tooling, and the second still belongs to the producer.
