Building a Game with AI for $3: A Practical Experiment Report

    How far can generative AI go in game development? This article walks through a hands-on experiment: building a complete, playable single-file HTML5 game using large language models on a budget of about $3 (20 RMB), covering prompt design, procedural graphics and audio, iteration with logging, cost breakdown, and an honest assessment of what AI does—and doesn't—change for solo developers.

    Why I Ran This Experiment

    A case recently circulating in the community claimed that a developer generated a complete game entirely with large language models — models, sound, and textures all created from scratch — for a total cost of about $550. It raised two common questions:

    1. Can AI actually produce a playable game on its own?
    2. Will game producers be replaced, and can ordinary people ship their ideas at almost no cost?

    Rather than argue, I decided to test it myself: build a small game of my own with an extremely low budget (targeting roughly $3 in inference costs), and document the entire process and conclusions.

    Experiment Design: Defining What AI Can Do

    Before starting, I mapped out the capability boundaries. In current game development, generative AI can reasonably handle:

    • Code generation: scripts, state machines, and level logic from natural-language requirements;
    • Art assets: textures, sprites, UI icons, and concept art;
    • Audio: sound effects and background music;
    • Writing and game balance: story, dialogue, item descriptions, and first-draft tuning values.

    One thing to be clear about: AI cannot decide for you why a game is fun. The core loop, pacing, and game feel still require human judgment.

    Constraints

    To simulate the “ordinary person validating an idea” scenario, I set hard constraints:

    • Use only general-purpose LLM services and free or near-free tooling;
    • Do not hand-write core gameplay code; only allow minor manual tweaks;
    • Total spending must not exceed the price of a cup of coffee;
    • The output must be a runnable, shareable build.

    The Low-Cost Development Workflow

    Step 1: Compress the Idea into Structured Prompts

    Simply telling a model “make me a fun game” almost guarantees a mediocre result. The effective approach is to have the AI produce a design document first, then generate code step by step. My prompt skeleton looked like this:

    1. Role: You are a senior indie game designer and programmer.
    2. Goal: Design a single-file HTML5 mini game themed "Deep-Sea Neon Submarine."
    3. Requirements:
    4. 1. Core loop: control a submarine to dodge obstacles, collect energy cores, and gradually speed up;
    5. 2. Technical constraints: vanilla Canvas, no external dependencies, 60 FPS;
    6. 3. Output: first give a design summary (gameplay / tuning values / failure conditions); after confirmation, deliver the full code;
    7. 4. All assets rendered with code (geometric shapes + gradients); no external images.

    Key technique: ask for the design first, then the code. Having the model restate its understanding and list the tuning values up front dramatically reduces rework later. After code is generated, feed error messages back verbatim — usually two or three rounds is enough to fix everything.

    Step 2: Minimal-Cost Art and Audio

    • Visuals: Have the code draw everything directly in a vector style — nearly free and visually consistent;
    • Audio: Synthesize simple sound effects at runtime with the Web Audio API (oscillators + envelopes), which saves money and avoids licensing issues;
    • Fonts/UI: Use system fonts and CSS gradients.

    The lesson here: low cost doesn’t mean low quality. Stylized visuals fit AI-assisted small projects far better than realism.

    Step 3: Testing and Iteration

    Change only one variable per iteration: first get the core loop running, then add obstacles, then a difficulty curve, and finally polish the game feel. Have the AI generate instrumentation for debugging, for example:

    1. function logDeath(cause) {
    2. console.log(JSON.stringify({
    3. event: 'death', cause,
    4. score: state.score, t: state.time
    5. }));
    6. }

    By analyzing the log to see how players die, you can have the AI adjust the tuning values with precision — far more effective than tweaking by feel.

    Step 4: Cost Breakdown

    • Code and design document generation: ~$1.7
    • Sound effects and writing assistance: ~$0.7
    • Iteration and error fixes: ~$0.4
    • Total: about $3, in roughly one evening.

    Of course, this excludes my own time and the engineering experience I already had. AI compresses the financial barrier, not the skill barrier.

    Conclusions: What AI Changed and What It Didn’t

    What AI genuinely changed

    1. Prototyping speed: Time from “idea” to “playable prototype” shrank from weeks to hours;
    2. Solo capability radius: People with no art or music skills can produce a complete experience;
    3. Cost of failure: Validating a bad idea is now essentially free, encouraging bolder exploration.

    What AI did not change

    1. Taste and judgment: AI generates plenty of mediocre options; filtering them is still human work;
    2. Systems engineering: Save systems, performance optimization, and cross-platform adaptation still require real engineering ability;
    3. Long-term content production: A commercial-scale game needs hundreds of hours of content. AI can boost efficiency but cannot magically supply design depth.

    So the claim that “game producers are all about to lose their jobs” doesn’t hold. A more accurate framing: the producer’s role shifts from executor to director — defining the vision, breaking down tasks, reviewing AI output, and controlling quality.

    Advice for People Who Want to Try

    1. Start with a single-file mini game rather than a big project;
    2. Write constraints clearly (tech stack, performance targets, forbidden dependencies) — output quality improves substantially;
    3. Accept work in stages, solving one problem per round;
    4. Keep version snapshots — AI occasionally fixes one thing while breaking another;
    5. Treat AI output as a draft; final quality depends on your willingness to polish.

    Closing Thoughts

    This $3 experiment proved one thing: turning an idea in your head into a playable game is entirely achievable today. But what’s scarce has never been tools — it’s clear vision, strict filtering, and patient polish. AI has flattened the barrier; the competition now is among the people standing on top of it.