AI-Assisted Browser Game Development: How a Hands-On Prototype Cut Direct Costs to ~20 RMB
This article shares a hands-on experiment using generative AI to build a browser-based first-person shooter prototype. It explains why small web games are a practical AI testbed, defines the cost scope behind the ~20 RMB figure, and walks through a reusable six-step workflow covering prompt design, asset specs, core logic boundaries, playable acceptance testing, and deployment. It also clarifies what AI can and cannot do, and why human judgment still decides whether a prototype is actually fun.
Web mini-games have always been a low-cost way to validate gameplay ideas: no install required, a link is enough to play, and the feedback loop is short. In the past, they were often treated as a small supporting format, but generative AI has expanded their value. Developers can spend more time on gameplay design, pacing tuning, and experience validation, while delegating asset drafts, basic UI, repetitive scripts, and documentation to models. This article uses a browser-based first-person shooter prototype experiment to show how one prototype’s direct generation cost can be kept to about 20 RMB, and to lay out a reusable engineering workflow plus the boundary of what AI can handle.
Before going further, the cost scope should be made clear. The 20 RMB mentioned here refers only to direct costs such as model calls and generation compute. It does not include human time, asset refinement, long-term bandwidth, or operations and maintenance. It is not the total cost of a commercial project; it is the trial-and-error cost for a creative validation stage. Making that distinction explicit avoids the misleading idea that “AI makes game development free.”
Why Browser Mini-Games Are a Good AI Testbed
First, the technical boundary of a browser mini-game is relatively clear. A playable prototype usually needs a core loop, input handling, collision detection and state management, simple rendering, and scoring plus win/loss determination. Compared with a large project, it is easier to split into “asset generation” and “logic implementation,” and both types of tasks are well suited to generative AI.
Second, the browser environment makes distribution and validation fast. After generation, the page can be published through static hosting, and a tester can open the link and play immediately. This short path significantly reduces friction from idea to feedback, which is especially useful for lightweight genres such as shooters, dodging games, clickers, and puzzles.
Third, browser mini-games tolerate visual and audio plausibility well. AI can quickly generate low-saturation realistic textures, simple sound effects, UI buttons, and scene decorations, making a prototype feel complete enough visually and audibly. But “looks plausible” is not the same as “plays well.” The real experience still depends on human tuning of feel, pacing, feedback, and difficulty.
Experiment Goal and Cost Control
The goal of this experiment was not to replicate a commercial shooting game. It was to create a runnable, playable, and evaluable browser-based first-person shooter prototype. Core requirements included keyboard and mouse movement and shooting, enemy spawning, hit feedback, scoring, round end and restart, and basic scene and audio. The more explicit the constraints, the more controllable the generated output.
There are three key cost-control levers:
- Reduce asset scope. Generate only the necessary textures, sound effects, and UI elements. Avoid one-off generation of large amounts of unusable assets.
- Reduce generation rounds. Decide style and specifications first, then batch-generate. Avoid repeated “rerolling” through random attempts.
- Keep deterministic logic hand-written or strictly reviewed. Do not let the model repeatedly experiment on the core state machine.
Following this approach, direct generation cost can be compressed to roughly the 20 RMB level.
| Cost Item | Counted in the ~20 RMB Direct Cost? | Notes |
|---|---|---|
| Model calls and generation compute | Yes | Textures, sound effects, UI copy, and some first-pass script generation |
| Human design and tuning | No | Gameplay design, feel tuning, code review |
| Storage and static hosting | No, or negligible | Small prototype; generic pay-as-you-go cloud services are enough |
| Long-term operations and bandwidth | No | Prototype validation usually does not face large-scale traffic |
A Six-Step Workflow from Idea to Playable Demo
1. Constrain the gameplay in one sentence
Compress the concept into one sentence: “The player moves and shoots in a limited scene, enemies appear in batches, hits score points, and the run ends when health reaches zero.” This sentence defines the scope of every subsequent generation task. Do not put “open world,” “complex story,” or “multi-weapon system” into this sentence, or the prototype will be pulled into uncontrollable complexity.
2. Build a layered prompt template
Do not write a prompt as a block of prose. Separate it into role, constraints, outputs, interface contract, and acceptance criteria. For example:
{"role": "Web mini-game prototype generation assistant","constraints": ["A single run ends within 3 minutes","Keyboard and mouse input only","Total assets under 5 MB","No external services"],"outputs": {"assets": [{ "type": "texture", "size": "512x512", "style": "low-saturation realistic" }],"code_contract": ["playerState", "enemySpawn", "score", "gameOver"],"acceptance": ["First screen interactive", "No console errors", "Restart works"]}}
This kind of template is reusable. By changing the gameplay description and asset specifications, you can generate a new task list without describing everything from zero each time.
3. Generate assets with unified specifications
Textures, sound effects, icons, and UI elements need a consistent naming convention, size, format, and style description. It is best to create an asset manifest first, then generate according to it. Put generated files into a unified directory and record their origin, dimensions, purpose, and replacement relationship. For a prototype stage, assets do not need high precision, but they must be style-consistent and not visually jarring.
4. Write core logic by hand and use AI for peripheral logic
The player state machine, collision detection, enemy spawn pacing, scoring rules, and win/loss determination are core logic. These should be hand-written or at least human-refactored. AI can help with UI binding, configuration tables, debug panels, and documentation. A simplified state machine can look like this:
update(dt):readInput()updatePlayer(dt)updateEnemies(dt)checkCollision()updateScore()if playerHealth <= 0: gameOver()
Keeping core logic deterministic significantly reduces debugging cost. Generated code must be reviewed, with special attention to boundary conditions, null handling, event listener cleanup, and loop performance.
5. Run integration tests based on “playable,” not “perfect”
Prototype acceptance should focus on whether it opens, whether it can be operated, whether the core loop is closed, whether there are blocking errors, and whether it runs in a normal browser. A simple smoke test should cover movement, shooting, hit detection, scoring, death, and restart. Set performance budgets as well, such as texture size limits, sound count, and maximum on-screen objects, to avoid lag in the prototype stage.
6. Deploy and observe
A small prototype can be published with static hosting. If the team needs collaboration, generated assets can be stored in object storage, pages can be served through a container platform or static host, and logging plus monitoring can be used to observe runtime behavior. The point is the general engineering combination, not a specific API or custom capability.
What AI Can and Cannot Do
AI is good at making things look plausible: basic scene assets, UI elements, first-pass sound effects, simple interaction scripts, configuration files, and documentation. It can also quickly assemble a runnable skeleton when the gameplay reference is clear.
AI is not good at making things feel good. Feel requires repeated parameter tuning, pacing requires human judgment, feedback needs design, and narrative requires trade-offs. Complex action mechanics, deep performance optimization, maintainable architecture, and long-term content production still depend on developers.
So the more accurate conclusion is not that human game creators are obsolete. It is that the barrier to creating a prototype has dropped. AI shortens the distance from idea to playable demo and lowers the cost of repetitive work, but the quality of a game still comes from design judgment and experience tuning.
Engineering Recommendations
- Keep module boundaries clear: assets, configuration, logic, UI, and deployment should be managed separately.
- Define interface contracts first. Specify states and events before asking a model to fill in the implementation.
- Version generated assets. Keep metadata for each generation so assets can be rolled back or replaced.
- Do not skip code review. Focus on security, performance, and maintainability.
- Handle compliance and copyright. Confirm the permitted use of generated assets, and avoid directly imitating protected works.
- Add monitoring and gradual rollout. Even a small game should record errors and key events so problems can be located quickly.
Conclusion
This experiment shows that a browser mini-game can be an ideal proving ground for generative AI-assisted development. By tightening constraint definition, layering prompt templates, standardizing asset specs, hand-writing core logic, and running playable acceptance tests, the direct generation cost of one prototype can indeed be kept to about 20 RMB. But low cost only solves “build it,” not “make it fun.” For developers, AI is more like an efficient prototype assistant: it lowers trial-and-error cost and speeds up creative validation, while the final value of a product still depends on continuous polishing of gameplay, pacing, and user experience.
