Building Games with AI: How Development Costs Drop to About 20 Yuan
This article explains how generative AI changes the cost structure of building browser-based games, bringing a playable prototype down to roughly 20 yuan. It breaks down where the savings come from, then walks through a four-stage workflow: defining the core loop and constraints, generating and manually correcting a code skeleton, running a small industrialized pipeline for assets, and deploying with observability. It also covers the metrics to judge whether a prototype is actually fun, common pitfalls to avoid, and why judgment matters more than implementation.
1. The Problem: Redefining the Barrier to Making a Game
Conventionally, making a game means three things: a professional team, a mature engine, and a timeline measured in months or even years. That assumption does not hold for the browser mini-game niche. The web format has three natural traits: no installation, a small footprint, and distribution by link. It brings the cost of validating a gameplay idea down from “a project review” to “an afternoon.”
Over the past couple of years, a batch of browser-based shooters and action games have been produced directly by generative AI. They share a common pattern: a clear reference, well-defined gameplay boundaries, and assets generated entirely by models. This points to a key conclusion — when the reference and the rules are clear, AI can already achieve a close visual and structural match. For the foundational layer, including scene assets, interaction logic, character behavior, and core mechanics, it can deliver a fairly complete result.
But looking the part is not the same as being fun. Players who lived through the early era of web animation games and indie games know that the core of a good game has never been complexity, but whether the feedback holds up: a story can move people through text and dialogue alone, and combat can feel satisfying through visual effects and scene feedback. So the stance of this article is to treat AI as a lever for turning an idea into a playable prototype quickly, not as a black box that replaces design judgment.
2. Why the Cost Can Drop to 20 Yuan: Breaking Down the Spending
The biggest costs of a traditional mini-game are labor hours and asset procurement. Once AI is involved, both are heavily compressed, leaving mainly very small inference-call and hosting-traffic expenses. A typical minimal cost table looks like this (the values are illustrative, meant to show structure rather than to quote a price):
| Expense | Traditional Approach | AI-Assisted Approach |
|---|---|---|
| Gameplay prototype code | Several person-days | Prompt-driven code generation, near-zero marginal cost |
| Art assets | Outsourced or purchased | Generative images/textures, billed per image, tiny in scale |
| Audio assets | Recording or licensed libraries | Generative audio, billed per second |
| Servers and bandwidth | Always-on instances | Static hosting plus on-demand functions, almost no monthly fee |
| Trial-and-error cost | High (long cycles) | Very low (hour-level iteration) |
What is really compressed is not the “unit price” but the fact that “trial and error becomes cheap.” That is the fundamental reason a 20-yuan-level budget works: you can spend the price of a coffee to validate ten gameplay ideas and keep one.
3. Implementation Path: A Four-Stage Loop
Stage 1: Define the Gameplay and Converge Constraints
First, write the core loop in one sentence, and pin down three boundaries: what the player does, what the failure condition is, and how long a round lasts. The harder the constraints, the higher the generation quality. It is better to write requirements as a structured description rather than prose:
Genre: top-down shooterCore loop: enter area -> collect resources -> engage patrol units -> extract and settleFailure condition: health reaches zero, resources for the round are lostRound length: 90–180 secondsControls: WASD to move, mouse to aim, left click to shoot, Shift to dodge
Stage 2: Generate the Code Skeleton and Correct It Manually
Have the AI coding tool first produce a “runnable minimal skeleton,” then add systems step by step. The recommended order is: main loop and input mapping → entities and collision → combat and numbers → UI and settlement. The sample code below shows the key point, which is to decouple the time step from input so you avoid rebuilding everything when adding features later:
// Fixed time-step main loop keeps the feel consistent across frame ratesconst STEP = 1000 / 60;let acc = 0, last = performance.now();function frame(now) {acc += now - last; last = now;while (acc >= STEP) { update(STEP / 1000); acc -= STEP; }render();requestAnimationFrame(frame);}
The focus of manual correction is on three areas: whether collision detection is stable, whether the numeric curves are monotonic, and whether the state machine has deadlocks. AI-generated code is most prone to “looks like it runs, feels awkward to play” problems in exactly these three places.
Stage 3: A Small Industrialized Pipeline for Asset Generation
Assets must follow a unified spec, otherwise the style will scatter. It is recommended to fix three things: a unified color-tone description, a unified perspective and lighting description, and a unified output size and naming convention. After textures and sound effects are generated in batches, manage the reference relationships with a single checklist table to avoid missing changes when replacing them later.
Stage 4: Deployment, Distribution, and Observation
The biggest advantage of the web format is zero-friction distribution. On the engineering side, a combination of static asset hosting plus on-demand functions is enough: static files go through object storage and a content delivery network, while lightweight logic such as leaderboards and saves runs on function compute and a managed database. After launch, three types of observability must be wired in: a logging service to record exception stacks, monitoring and alerting to watch error rates and first-screen load time, and performance profiling to locate frame-drop hotspots.
4. Judging Quality: Use Metrics Instead of Feelings
Low cost does not mean low standards. Instrument the prototype from the start and use data to answer the subjective question of “is it fun”:
- First-round completion rate: below sixty percent suggests a problem with the opening guidance or the difficulty curve;
- Median round length: deviating too far from the design target suggests unbalanced pacing;
- Death location distribution: clustering in one spot usually indicates a level or numeric design flaw;
- Return rate: the key metric for whether the core loop holds up.
5. Common Pitfalls Checklist
- Vague requirement descriptions: AI will fill in the rules on its own, and the result will not match what you had in mind;
- Generating the entire project at once: hard to locate problems, so be sure to move in small, fast steps;
- Inconsistent asset specs: a fragmented style, and rework costs far more than generation costs;
- Ignoring mobile touch controls: a large share of web traffic comes from phones, so reserve a virtual joystick approach;
- Launching without observability: when problems arise you can only rely on user feedback, which is the most costly option.
6. Conclusion
AI has rewritten the cost structure of game development: what is expensive is no longer implementation, but judgment. When implementation becomes cheap, the developer’s core competitiveness returns to gameplay taste, pacing control, and feedback design. Building a playable prototype on a 20-yuan-level budget is already a reproducible engineering practice today; the real dividing line is whether you can recognize, among many runnable prototypes, the one worth scaling up.
