AI-Generated Web Games: Validating a Prototype for About 20 Yuan

    This article explains how developers can use AI to test a web game idea at low cost. It covers which game types suit this approach, how the cost structure changes, the limits of a roughly 20-yuan budget, a spec-driven workflow for generating assets and code, and the quality, compliance, and performance controls to apply. Its main point is that AI lowers the cost of building a prototype, but producers still decide whether the game is fun.

    The Key Question Is Whether to Build, Not Whether AI Can Build It

    Public practice shows that fully AI-generated small web games can bring direct cash costs down to several hundred US dollars. If the goal is only to test whether a gameplay idea works, the cost can go lower still. For developers, the real value is not asking AI to produce a complete game in one pass. It is shortening prototype validation from a long chain (forming a team, setting up an engine, making assets, writing logic) into a short one: define the spec, generate and select assets, build a code skeleton, deploy quickly, and run a manual acceptance review.

    This approach suits validation-stage web games. These games have a single scene, a short flow, clear rules, a small number of assets, no real-time multiplayer, no persistent accounts, and no complex physics or animation. It does not promise commercial-grade quality. AI is good at quickly producing the look and basic interactions, including scene art, input response, collision detection, scoring, enemy waves, and simple state machines. Complex actions, game feel, level pacing, and long-term maintainability still require human judgment.

    Cost Structure and Limits of a 20-Yuan Budget

    Traditional development costs mainly go to staff, engine toolchains, outsourced art, and testing. The cost of an AI-generated web game shifts to model calls, asset regeneration, build hosting, and light monitoring. To keep the direct cash cost of one validation near 20 yuan, several constraints must hold at the same time:

    • Very small scope: a single-page app, one scene, 2 to 3 enemy types, one short looping music track, and a few sound effects.
    • Asset reuse: the player, enemies, and bullets use colored blocks or low-poly geometry in one consistent style, avoiding high-resolution textures.
    • Controlled generation count: each asset type produces a small set of candidates, a person picks one, and the choice is then fixed. No unlimited retries.
    • No backend or a minimal backend: cut non-essential features such as leaderboards and save data first. Where needed, use read-only static data.
    • Light deployment: store build output in object storage and distribute it through a CDN. For dynamic features, use pay-as-you-go functions and sample logs.
    • Clear acceptance goals: players understand the controls within 30 seconds, complete one core loop, can play with touch on mobile, and see an acceptable first-screen load.

    The 20-yuan figure is a validation budget, not a commercial project budget. Once the gameplay works, costs rise for art consistency, performance optimization, compatibility testing, copyright review, and maintainability work. A 20-yuan prototype is a decision tool, not a delivery commitment.

    A Reusable Technical Architecture

    Use a spec-driven architecture instead of letting the model improvise:

    1. Formalize requirements: define the genre, core loop, controls, win and loss conditions, asset list, and acceptance criteria.
    2. List assets: create an asset table first, then generate and select each item so the process stays under control.
    3. Generate a code skeleton: have a general-purpose LLM produce a modular code skeleton, then let a person tune the key feel parameters.
    4. Build a game loop state machine: fixed update, input, collision, scoring, and end states, which makes testing easier.
    5. Build and deploy: build static output locally, upload it to object storage, distribute it through a CDN, and enable logging and monitoring alerts as needed.
    6. Run manual acceptance: play through the acceptance checklist, record problems, and then decide whether to iterate or stop.

    For deployment, you can use general cloud service categories such as object storage, CDN, serverless functions, log services, and monitoring and alerting. If you use Baidu AI Cloud, choose services based on these same general capabilities. Set quotas, budget alerts, and access control so the prototype does not create unnecessary long-term resources.

    Spec Prompts and Asset List Example

    Turning “make a shooter” into an executable spec makes generation quality much more stable. An illustrative spec is shown below:

    1. {
    2. "genre": "top-down shooter",
    3. "core_loop": ["move", "aim", "shoot", "enemy waves", "scoring"],
    4. "scene": {"type": "single scene", "size": "one screen"},
    5. "assets": {
    6. "player": 1,
    7. "enemy": 2,
    8. "bullet": 1,
    9. "bgm": 1,
    10. "sfx": 3
    11. },
    12. "acceptance": [
    13. "Players understand the controls within 30 seconds",
    14. "Defeat 10 enemies",
    15. "Touch controls work on mobile",
    16. "First-screen load time is acceptable",
    17. "No blocking errors"
    18. ]
    19. }

    The asset list should define style, size, format, and reuse rules. For example, use a unified color palette, consistent outlines, a texture size cap, and an audio duration cap. This reduces style drift and keeps the package size small. After generating candidates, a person selects one, locks its version number, and later makes only small replacements.

    Code Generation and State Machine Skeleton

    Code generation should prioritize readable, testable, modular code over a large block of complete logic produced in one pass. The core loop can be expressed as a state machine:

    1. on update(dt):
    2. input = read_input()
    3. player.update(input, dt)
    4. for enemy in enemies:
    5. enemy.update(player, dt)
    6. collisions = detect_collisions(player, enemies, bullets)
    7. resolve_collisions(collisions)
    8. if player.hp <= 0:
    9. state = GAME_OVER
    10. if wave_cleared():
    11. spawn_next_wave()

    Review these modules first: input mapping, collision boundaries, scoring rules, wave generation, and end conditions. Write lightweight unit tests for collision and scoring. Test mobile touch controls separately, and set fallbacks for asset loading failures. Generated code must have locked dependencies, unused code removed, and type checks and build scripts kept. Otherwise the prototype quickly becomes a one-off artifact that is hard to maintain.

    Quality, Compliance, and Performance Controls

    Low cost does not mean low risk. Apply at least four kinds of control:

    • Copyright compliance: use owned, licensed, or reviewed content, both generated and sourced. Keep asset sources and generation records. Avoid copying protected characters, maps, and logos.
    • Consistency control: fix the style guide, color palette, and size standards. Keep asset names traceable, and make version changes reversible.
    • Performance budget: limit first-package size, texture size, audio length, and the number of active objects at once. Load assets on demand and sample logs.
    • Security and privacy: do not collect personal data at the prototype stage. If you keep a minimal backend, add input validation, access control, and dependency locking.

    Conclusion: AI Lowers Implementation Cost but Does Not Replace Production Judgment

    AI-generated web games lower the barrier to making something playable. Validating an idea for about 20 yuan is feasible within clear limits. But the most important quality of a good game is not complexity. It is fun. Fun comes from the core loop, feedback pacing, a sense of goal, and storytelling. Producers still need to define acceptance criteria, judge playtests, and make trade-offs in each iteration.

    Producers will not disappear as a group. Their role shifts toward spec design, asset selection, gameplay acceptance, and polish. Developers can use a very low-cost prototype to answer a basic question: is this idea worth further investment? If the answer is yes, move to formal engineering. If the answer is no, stop early. That is the most direct engineering value AI brings to game development.