Building Games With AI: How I Cut Development Costs to About 20 RMB

    This article documents a real, reproducible experiment in building a browser game with AI coding tools, where the total direct cost came to roughly 20 RMB. It explains why browser games are the best entry point for individual developers, breaks down the workflow from defining the gameplay and generating assets to iterating on code and publishing, and shows the specific strategies used to keep model and asset generation spending minimal. Readers will also find key conclusions about what AI does well, what still requires human design judgment, and why process matters more than tools. (Note: the cost figure covers direct expenses such as model calls and asset generation, not the developer's time.)

    1. Introduction: The Barrier to Game Development Is Being Redefined

    For most people, game development still brings to mind professional engines, large teams, long schedules, and heavy budgets. Even a simple gameplay idea usually has to pass through design, art, programming, and testing before it becomes a runnable product. For individual developers and small teams, the hardest part is rarely the idea itself. It is the technology stack and resource cost required to turn that idea into something playable.

    As intelligent coding tools and generative models have improved quickly, describing a requirement in natural language and getting runnable code and assets back has become practical. This article records a real, reproducible low-cost experiment: using AI to build a small browser game while keeping the total cost at roughly 20 RMB. One clarification up front: “cost” here refers mainly to direct spending such as model calls and asset generation, and does not include the developer’s time.

    2. Why Browser Games Are the Right Starting Point

    Among all game formats, browser games are the best choice for individual developers validating an idea, for three reasons.

    First, distribution cost is minimal. Once development is done, you generate a link and anyone can open a browser to try the game. There is no installation and no need to adapt to multiple client platforms.

    Second, the technology stack is lightweight. Browser games are typically built with HTML5, CSS, and JavaScript, and mature rendering and physics solutions are enough for 2D or lightweight 3D. Developers do not need to master a complex engine first.

    Third, the feedback loop is short. Whether a gameplay idea holds up can often be verified in minutes. This fast trial-and-error cycle fits generative AI development very well.

    3. Walkthrough: From Zero to Playable

    3.1 Narrowing the Idea and Defining the Gameplay

    The first step is not writing code but turning a vague idea into a clear gameplay description. The author observed that most AI-generated browser games only look right when the reference is explicit and the gameplay is well defined. A prompt therefore has to state three things clearly: the core controls, the win and lose conditions, and the visual style.

    A reusable prompt structure looks like this:

    1. You are a senior browser game developer.
    2. Build a 2D top-down shooter with these requirements:
    3. 1. The player moves with the keyboard and aims and shoots with the mouse;
    4. 2. Enemies spawn in waves, and clearing all enemies completes the level;
    5. 3. Track three states: health, ammo, and score;
    6. 4. Use Canvas for rendering and keep it runnable as a single file.

    This kind of structured description reduces ambiguity significantly and brings the generated result closer to expectations.

    3.2 Asset Generation: Models, Textures, and Audio

    The article notes that a realistic AI-generated shooter had its models, sounds, and textures all created from scratch for only a few hundred dollars. That points to a key fact: asset generation is the main cost driver and the main optimization target.

    In practice, a 2D browser game can rely on procedurally generated geometric shapes and color blocks, with CSS gradients and shadows providing lighting effects. Audio can be replaced with simple synthesized waveforms or short samples. If bitmap or audio resources are unavoidable, keep resolution and duration under control to avoid bloating the build.

    3.3 Code Generation and Iteration

    Once runnable code is generated, do not expect it to be finished in one pass. A more realistic approach is small, fast steps: get the core loop working first, then add enemy AI, collision detection, and state management one at a time. Solve a single problem per iteration, and avoid piling on too many requirements at once, which degrades code quality.

    3.4 Testing and Publishing

    The advantage of browser games is that testing is simple. Open the generated file locally to verify it, then deploy to static hosting and share the link. If data persistence is involved, you can connect object storage or a lightweight backend API, though for this kind of small game it is usually unnecessary.

    4. Cost Breakdown: Where the 20 RMB Comes From

    Keeping the cost at around 20 RMB comes down to calling on demand and minimizing generation. The specific tactics:

    • Write the prompt completely in one pass to reduce repeated regeneration;
    • Prefer procedurally generated assets to avoid expensive images and audio;
    • Focus code iteration on the core gameplay instead of aiming for a finished product immediately;
    • Use lightweight rendering to reduce dependence on complex resources and compute.

    The essence of this strategy is treating generation as a resource that needs precise scheduling, not an unlimited free capability.

    5. Key Takeaways and Best Practices

    First, AI is good at surface resemblance, not at the deeper feel. When the gameplay and reference are clear, AI can handle scenes, interaction, and basic mechanics reasonably well. What actually decides whether a game is fun is pacing, feedback, and emotion, and those still need the developer.

    Second, the core of a good game is not complexity but playability. It can tell a story through text and dialogue, or create a satisfying feel through lighting and scene feedback. AI can speed up implementation but cannot replace design judgment.

    Third, low-cost development depends on process rather than tools. Structured prompts, small iterations, and lightweight assets are the three factors that determine the final cost and quality.

    6. Conclusion

    This experiment shows that with intelligent coding tools, individual developers can compress the cost of validating a game idea to a nearly negligible level. As the technical barrier drops, the value of the idea itself is amplified. Going forward, a developer’s core competitiveness will no longer be whether something can be built, but whether they can design something worth building.