AI Coding in Practice: Building a AAA-Style Browser Game for About 20 RMB

    This article reports on a hands-on test of using generative AI coding tools to build a high-fidelity browser game from scratch for roughly 20 RMB, and explains why that number is the cost of a validation, not the price of a finished game. It covers why the web is the best testbed for rapid playable prototypes, where current AI-generated games meet the bar and where they fall short, and a reusable four-stage pipeline: defining the state machine before coding, enforcing asset style consistency, setting performance budgets up front, and hardening generated code with a fixed timestep loop. It closes with a structured breakdown of cost control and the conclusion that AI changes validation cost, not creative capability.

    1. A Counterintuitive Starting Point: Development Cost Compressed by Two Orders of Magnitude

    The cost structure of traditional game development has long rested on three pillars: labor, time, and trial and error. A project with complete lighting and material fidelity typically requires artists, programmers, and designers working together for months. Once generative models entered code and asset production, all three costs were compressed at the same time. In one case, a developer used a very short prompt to keep an AI coding tool running for hours, producing a high-fidelity game that runs in the browser, with every asset generated from zero, at a total cost of roughly 20 RMB.

    To be clear-eyed about it: 20 RMB is not “the price of making a game,” it is “the price of running one validation.” Its real significance is that it cuts the cost of answering “does this idea hold up?” from weeks to hours.

    2. Why the Web: The Best Vehicle for a Minimum Viable Validation

    Browser games are a niche choice for players, but the efficiency optimum for developers, for three reasons:

    • Zero distribution friction: the output is a link. Anyone can open it and play immediately, with no install, no review process, and no device-specific adaptation.
    • An extremely short feedback loop: highly subjective questions like game feel can only be judged by real players, and the web pushes feedback latency down to minutes.
    • A converged tech stack: rendering, audio, input, and physics already have mature general-purpose solutions in the browser, so model-generated code has plenty of public patterns to reference and a notably lower error rate than in obscure runtimes.

    The conclusion is clear: the web is not a “low-spec version of a game,” it is the most suitable workbench for the ideation stage.

    3. Test Observations: What Generative Games Can and Cannot Do

    After playing several AI-generated browser games on the market, a clear capability boundary emerges.

    Dimensions that already meet the bar: spatial structure reconstruction, basic firefight pacing, the look of textures and lighting, and core action-game input mappings such as “move, dodge, light and heavy attack.” These capabilities share clear rules, simple state machine structures, and a large body of similar samples for the model to generalize from.

    Dimensions that clearly fall short: hit-frame design for complex combos, multi-stage hit feedback, animation blending and root motion, and level pacing. These depend on “feel tuning,” tacit knowledge built up over long experience that is hard to learn directly from static samples.

    A pragmatic judgment: generative tools can already replace “implementation,” but not yet “tuning.”

    4. A Reusable Four-Stage Pipeline

    Stage 1: Gameplay First — Define the State Machine Before Writing Code

    Do not let the model improvise. Write out the core loop and state transitions yourself first, then hand them over for implementation:

    1. Idle → Run → Jump → Fall → Land → Idle
    2. ↘ Attack(Light) → Recover
    3. ↘ Attack(Heavy) → Recover
    4. ↘ Dodge(i-frame) → Recover

    Stating clearly in the prompt the “number of states, transition conditions, and duration of each state” noticeably improves the usability of the generated result.

    Stage 2: Asset Generation and Consistency Constraints

    When models, textures, and sound effects are generated separately, the biggest pitfall is style drift. What works in practice is to establish a fixed style description (color palette, material roughness, light direction, rendering style), reuse it verbatim in every generation request, and then apply a single color and noise normalization pass after generation.

    Stage 3: Put the Performance Budget Up Front

    Browser resources are a hard constraint and must be written into the prompt at the generation stage:

    • Texture size limits and compression format requirements;
    • Caps on draw calls and material count;
    • Target frame rate and a fallback strategy for low-end devices.

    Stage 4: Engineering Hardening

    Generated code is usually “runnable but unmaintainable.” Hardening steps include extracting hardcoded constants into configuration, adding progress and retry-on-failure to asset loading, and decoupling the game loop from rendering. Example:

    1. // Fixed timestep update with render interpolation, to keep feel consistent across refresh rates
    2. const STEP = 1 / 60;
    3. let acc = 0, last = performance.now();
    4. function frame(now) {
    5. acc += Math.min((now - last) / 1000, 0.25);
    6. last = now;
    7. while (acc >= STEP) { update(STEP); acc -= STEP; }
    8. render(acc / STEP);
    9. requestAnimationFrame(frame);
    10. }

    5. A Structured Breakdown of Cost Control

    The key to low cost is not “a cheap model” but avoiding rework. It breaks down into four layers:

    1. Requirements cost: state constraints clearly in the prompt to reduce rounds of trial and error;
    2. Asset cost: prefer small textures and procedural generation, and avoid high-precision assets;
    3. Compute cost: batch generation, result caching, and fast fallback on failure;
    4. Labor cost: people only make judgments and tune feel, they do not do grunt work.

    If multi-person collaboration or output distribution is needed, you can use object storage to host static assets, a content delivery network to reduce latency, and logging and monitoring services to track down live frame rate anomalies. These all fall under general-purpose cloud capability categories, are used on demand, and do not themselves constitute a major expense.

    6. Conclusion: What Changed Is the Validation Method, Not Creative Capability

    What generative tools genuinely rewrite is the “validation cost” line item. They turn game development from “invest first, then judge” into “judge first, then invest.” Complex combos, level pacing, and feel tuning remain human territory; and the 20 RMB experiment proves exactly that idea screening can become extremely cheap. The advice for developers is one sentence: spend the budget and time you saved on the one gameplay idea you have thought through.