Building a Game with AI: How I Cut Development Costs to Under 20 CNY

    This article documents a hands-on experiment testing whether AI coding tools can reduce the cost of building a small game to under 20 CNY. It covers why a web-based format was chosen for rapid validation, how to break game development into structured prompts with measurable constraints, and how to build a zero-cost asset pipeline for textures and audio. It also explains script-driven automation, a realistic breakdown of where the cash and time costs actually go, and a pre-launch quality checklist. The key takeaway: AI makes implementation cheap, but design judgment and iteration remain the real bottleneck.

    1. The Starting Point: A Test to Push Costs Down to 20 CNY

    A recent discussion asked whether individual developers can use AI coding tools to compress the development cost of a small game to an extremely low level. The original case mentioned a project whose assets were all generated from scratch, costing several hundred dollars. Our test set a more aggressive target: keep total spending under 20 CNY and produce something anyone can play by clicking a link.

    The conclusion first: it is feasible, but with boundaries. What 20 CNY buys is a “playable prototype plus full closed-loop validation,” not “commercial-scale content volume.” Understanding this boundary matters more than piling on features.

    2. Choosing the Platform: Why Start with the Web

    For ordinary players, game development usually brings to mind professional engines, large teams, and long timelines. But for a cost-sensitive test, the web is a better starting point:

    • Zero installation: once generated, a single link is enough to distribute it, keeping the barrier to trying it as low as possible.
    • Fast iteration: change one line, refresh, and it takes effect, which suits high-frequency trial and error.
    • Lightweight assets: texture and audio sizes stay manageable, making hosting and bandwidth costs predictable.
    • Cross-platform: it runs in both desktop and mobile browsers, giving a more realistic validation sample.

    The tradeoffs are equally clear: performance ceilings, input feel, complex physics, and large-scale scene management all fall short of native solutions. So the positioning should be “validate the idea and gameplay feel,” not “replace a full product line.”

    3. Prompt Engineering: Breaking “Make a Game” into Executable Tasks

    Asking a model to simply “make a game” often produces something unusable. The effective approach is to break the goal into structured tasks and converge layer by layer:

    1. Gameplay definition: a one-sentence core loop (for example, “move-collect-exchange-upgrade”);
    2. Numeric draft: initial attributes, growth curve, failure conditions;
    3. Scenes and state machine: switching among menu, in-game, and results states;
    4. Asset list: concrete specs for characters, tiles, icons, and sound effects;
    5. Acceptance criteria: measurable thresholds for frame rate, input latency, and crash rate.

    An illustrative task description structure (pseudocode):

    1. role: senior game developer
    2. goal: generate a single-file web mini-game
    3. constraints:
    4. - no external dependencies, runs purely on the frontend
    5. - canvas resolution adapts automatically
    6. - target 60 fps, no less than 30 fps on low-end devices
    7. deliverables:
    8. - main loop and state machine
    9. - collision and pickup logic
    10. - placeholder asset generation script
    11. acceptance:
    12. - 10 minutes of continuous running with no sustained memory growth
    13. - both keyboard and touchscreen operable

    The key point: the more measurable the constraints, the less rework. Translating “good-looking” and “smooth” into numbers and pass/fail conditions is the dividing line for prompt quality.

    4. Asset Generation: A Zero-Cost Loop for Models, Audio, and Textures

    Assets are the biggest traditional cost, and also the part generative capabilities compress the most.

    • Textures: use text-to-image capabilities to produce a stylistically consistent atlas, then split it into sprite frames via script; keep a unified palette and lighting direction to avoid style drift.
    • Audio: use audio generation to produce short samples, then use a script to unify sample rate and loudness, adding fades to prevent popping.
    • Models: if 3D is needed, favor low-poly with baked textures; this test used a 2D approach to control costs.

    Engineering-wise, it is worth adding an “asset validation script” layer that checks dimensions, transparency channels, naming conventions, and size limits, so illegal resources do not surface only at runtime.

    5. Wiring It Together and Automating: Let the Toolchain, Not People, Cover the Gaps

    Turning generated output into a playable build relies on scripts rather than manual work:

    1. // Manifest-driven preloading with placeholder fallback
    2. const manifest = await fetch('./assets/manifest.json').then(r => r.json());
    3. for (const item of manifest) {
    4. const img = new Image();
    5. img.onerror = () => console.warn('fallback:', item.id);
    6. img.src = item.url;
    7. }

    Combined with automated checks (syntax validation, asset reference integrity, console error scanning), you can quickly judge after each iteration whether it is playable.

    6. Cost Breakdown: Where the 20 CNY Goes

    • Generative API call fees: the main expense, reduced by shortening prompts, reusing results, and batch generation to spread the cost;
    • Hosting and bandwidth: static assets plus general object-storage capabilities, with caching and compression to control bandwidth;
    • Domain and certificate: further compressed using a general hosting solution;
    • Human time: the real bulk, but not counted as a cash cost here.

    Conclusion: cash cost can be pushed extremely low, but time cost cannot be compressed. This is also the real answer to “can an individual build a game” — the bottleneck shifts from money to judgment and the number of iterations.

    7. Quality Acceptance and Launch Distribution

    Before launch, cover at least four areas: performance (frame rate and memory), compatibility (mainstream browsers and touchscreens), playability (new players grasp the goal within thirty seconds), and stability (abnormal input does not crash). On the distribution side, a gradual rollout is recommended: start with a small sample to collect retention and friction points, then decide whether to invest more. Logging and monitoring alerts can use general-purpose capabilities without tying to a specific vendor.

    8. Boundaries and Recommendations

    AI has made “implementation” cheap, but it has not made “design” cheap. What is truly scarce is gameplay judgment, feel for numbers, and the ability to make tradeoffs. Advice for three types of readers: use the web format to validate quickly during the prototype stage; migrate to a professional engine when you need feel and performance; treat generated output as a first draft and treat acceptance criteria as the real requirements document.