AI Coding Test: Building a 3A-Quality Browser Game for About 20 RMB
This article reports on a hands-on test of using AI coding tools to build a browser-based third-person shooter, examining why the web is a natural fit for AI-generated games, what current models do well and where they fall short, and a reusable four-stage workflow covering gameplay specs, layered generation, performance governance, and deployment. It also breaks down the real cost structure behind the viral "20 RMB game" claim, clarifies that the figure reflects inference usage rather than total development cost, and lists key capability limits and risks around intellectual property, code security, and maintainability.
1. Starting From a Low-Cost Game-Building Test
An overseas engineer recently used an AI coding tool to generate a third-person shooter that runs directly in the browser. According to the engineer’s public description, all assets—models, audio, and textures—were generated from scratch by AI, produced over roughly eight hours of continuous runtime, at a total cost of about $550. Converted to a typical pay-as-you-go metered scenario, the same order of Token consumption corresponds to a few tens of RMB—which is where the “build a game for 20 RMB” claim comes from.
One clarification is needed: this number is not the “total cost of game development,” but the “inference call cost.” It excludes art rework, gameplay tuning, deployment and operations, and compliance review. Treating it as a full budget will misjudge project risk; treating it as a “prototype validation cost” is the meaningful takeaway: the marginal cost of validating an idea has been pushed down to a range where casual trial and error is possible.
An even more notable detail is the “hard to tell real from fake” experience: realistic lighting, high-fidelity materials, and interactive scenes led many players to mistake it in the first few minutes for a commercial title streamed from the cloud. This shows that generative models’ progress in “visual credibility” has already crossed the threshold of casual prototypes.
2. Why the Web Is the Landing Form for AI-Generated Games
The default association with traditional game development is heavyweight engines, professional teams, and long timelines. The web form has long been seen as niche, but its engineering properties happen to align closely with AI generation.
- Zero install, distribution by link: the output is static resources, so sharing a URL is enough to collect feedback.
- Converged tech stack: HTML, CSS, JavaScript, and WebGL are common standards with ample training data, so generation accuracy is significantly higher than for obscure engine scripts.
- Short feedback loop: change one prompt line and you can replay within tens of seconds, forming a high-frequency “generate—playtest—fix” iteration.
- Clear performance boundaries: constrained by the browser sandbox and the main thread, scene scale is naturally bounded, which actually reduces the chance of AI “writing code that won’t run.”
For developers, the biggest value is not saving on engine licensing, but not being tripped up by complex technical knowledge first, so you can focus your energy on gameplay and creativity. Whether an idea holds up gets an answer the same day.
3. Test Observations: Current Strengths and Weaknesses of AI Web Games
I playtested a batch of AI-generated web mini-games along the dimension of “gameplay completeness,” including a battle demo modeled on a classic multiplayer shooter map. The common patterns are as follows:
What it does well
- Scenes and lighting: the combination of directional light, shadow maps, fog, and post-processing chains is already quite mature.
- Material rendering: physically based rendering (PBR) parameter configuration is basically reasonable, with roughness and metalness not obviously distorted.
- Basic interaction: standard paradigms like WASD movement, mouse-look, and raycast hit detection are almost never written wrong.
Clear weaknesses
- Gameplay depth: mostly surface-level replication of “reference the original visuals and rules,” lacking pacing curves and objective design.
- Performance: uncontrolled Draw Calls, uncompressed textures, and new objects created every frame cause frame rate to collapse linearly as entity count grows.
- Network sync: multiplayer forms usually stay at local simulation, lacking an authoritative server and state correction.
- Asset consistency: AI-generated textures and models drift in style, requiring people to establish style anchors.
The conclusion is direct: AI is good at “implementation,” not “design.” It drives implementation cost close to zero, so the bottleneck shifts forward to gameplay planning and engineering constraints.
4. A Reusable Four-Stage Production Workflow
Stage 1: Spec the Gameplay (Write the Idea as Executable Constraints)
Don’t let the model “freely improvise.” First lock the boundaries with a structured spec:
Genre: first-person shooter / 3-minute roundsMap: 40x40 meters, 5 covers, 2 elevation-difference pathsCore loop: spawn enemies -> kill to heal -> pick up ammo -> wave escalationPerformance budget: Draw Call < 150, total textures < 40MB, target 60fpsOutput: a single HTML file, no external dependencies
The spec must include a performance budget—this is the key constraint for AI to generate deployable code.
Stage 2: Layered Generation (Avoid Generating a Giant File at Once)
Split the system into a rendering layer, input layer, entity layer, and UI layer, generating and validating layer by layer. Asking for a complete project in one shot most commonly fails because the context gets too long and the later code references interfaces that don’t exist.
Stage 3: Performance and Asset Governance
- Use object pools instead of
newevery frame to avoid GC stutter:
class BulletPool {constructor(size) {this.items = Array.from({length: size}, () => ({active: false, x:0, y:0}));}spawn(x, y) {const b = this.items.find(i => !i.active);if (b) Object.assign(b, {active: true, x, y});}}
- Compress textures uniformly and generate mipmaps to control VRAM and bandwidth.
- Merge static geometry to reduce Draw Calls.
- Drive the main loop with
requestAnimationFrame, decouple logic updates from rendering, and update physics at a fixed timestep.
Stage 4: Validation and Launch
Set up a minimal acceptance checklist: first-screen load time, frame rate on target devices, hit-detection consistency, and memory growth curve. On the asset side, use object storage to host static output, paired with a content delivery network to reduce first-screen latency; wire error and performance data into logging services and monitoring alerts to form a closed, observable loop in production.
5. Cost Structure: Where the Money Actually Goes
Breaking down the $550, inference calls are only one item. A real project’s cost distribution looks closer to:
| Cost item | Share characteristics | Optimization |
|---|---|---|
| Inference calls | Low, billed by Token | Trim prompts, reuse cache, use a small model for the first draft |
| Manual rework | Highest | Spec up front, layered generation |
| Asset consistency | Medium | Establish style anchors and an asset list |
| Distribution and ops | Low–medium | Static hosting + content delivery network |
With the platform-style resource organization of providers like Baidu AI Cloud, the capabilities above typically map to general product categories: object storage, content delivery network, container platform, logging service, and monitoring alerts. Developers pay by actual usage, so fixed investment during the prototype stage can be pushed extremely low.
6. Capability Limits and Risk Checklist
- Don’t expect “a commercial game from one sentence.” Current generation quality sits in the “playable prototype” range; gameplay innovation still needs people to define it.
- Intellectual property risk is the highest. Replicating existing commercial maps, characters, or UI as prototypes can still constitute infringement in visuals and rules even if the code is entirely new, so you must replace them with original settings.
- Code security needs auditing. Generated code may introduce unsafe input handling or third-party dependencies, so do dependency review and static scanning before launch.
- Maintainability is weak. AI-generated code often lacks comments and layering, so it’s advisable to mandate modularization and comment conventions in the prompt.
7. Actionable Advice for Developers
Spend one weekend doing three things: write a gameplay spec with a performance budget; use an AI coding tool to generate a single-file prototype in layers; deploy the prototype to static hosting and collect feedback from five players. The real output of this workflow is not a game, but a validation pipeline that pushes creative cost down to the tens-of-RMB level.
When implementation is no longer the bottleneck, a team’s competitiveness shifts entirely to gameplay design and aesthetic judgment—this is both the biggest dividend AI brings and the only part that cannot be automatically generated.
