Hands-On: Building a Game With AI for About 20 RMB
This article walks through a hands-on experiment in building a browser game with AI coding tools, reducing total spending on model calls and asset generation to roughly 20 RMB. It breaks down how AI reshapes the cost structure of art assets, code scaffolding, and testing; explains the workflow from a one-sentence idea to a playable prototype using structured scene descriptions, a minimal game loop, consistent asset prompts, and rapid playtesting; and outlines how to move a validated prototype to cloud infrastructure such as object storage with CDN, container platforms, message queues, and logging and monitoring on Baidu AI Cloud. It also covers common pitfalls—copyright, performance, game feel, asset drift, and maintainability—and concludes that the real value lies in low-cost trial and error.
1. Where It Started: A Low-Cost Game Development Experiment
In game development, “making a game” usually brings to mind professional engines, large teams, and long timelines. Browser games offer a lighter path: small in size, no installation required, and playable from a single link once generated. Their real value is not replacing large projects, but driving the cost of validating an idea extremely low—whether a gameplay concept works can often be answered within minutes.
A widely discussed recent example is a browser game generated by an overseas engineer using an AI coding tool. Its lighting and materials initially made some people mistake it for a large cloud-streamed title, but in fact every model, sound effect, and texture was generated from scratch by AI, driven by short prompts and produced in a single continuous run of about eight hours, at a total cost of roughly 550 USD. The figure is striking because it turns art assets—traditionally a major cost—into measurable compute and API usage.
Inspired by this, I built a prototype closer to the memory of Chinese players: a top-down browser shooter based on a container-yard scene in the style of the classic “Transport Ship” map. The total cost of model calls and asset generation came to about 20 RMB. Below, I abstract the process into a reusable engineering method.
2. Restructuring the Cost Model: Where the Money Actually Goes
Traditional browser game development costs usually concentrate in three areas: art assets, implementation, and testing and compatibility. Once AI is involved, the cost structure is divided differently:
- Art assets: shifts from “human labor hours” to “number of generation calls,” sharply lowering marginal cost, but requiring extra budget for screening and rework.
- Implementation: boilerplate code such as scaffolding, state machines, collision, and input is completed by AI coding tools, freeing human effort for gameplay design and tuning.
- Testing and compatibility: does not disappear, and becomes more critical. There is still a clear gap between generated code that “runs” and a game that is “fun and stable.”
So the 20 RMB roughly covers a few high-resolution textures and sound effects, several rounds of code completion and refactoring, and one round of prototype validation. The truly scarce resource is not money, but design judgment.
3. Breaking Down the Workflow: From One Sentence to a Playable Prototype
3.1 Narrowing the Idea to a Testable Goal
First, narrow “I want to make a shooter” into a testable proposition: top-down view, dual-stick controls, container cover, and a tense 30-second-per-round pace. The goal is not a complete game, but validating whether “cover plus movement” is fun.
3.2 Describing the Scene and Gameplay as Data
Use structured text to describe the map and rules so the tools can generate reliably:
{"scene": "Container yard, top-down view","grid": "20x12, tile size 32px","entities": ["player", "enemy", "cover", "ammo box"],"rules": {"win": "survive 60 seconds","lose": "health reaches zero","spawn": "2 enemies every 5 seconds"}}
3.3 Code Skeleton and Key Modules
Have the AI coding tool first produce a runnable skeleton, then replace it module by module. Keep the core loop minimal:
function loop(dt) {input = readInput(); // unified abstraction for keyboard/touchplayer.update(dt, input);enemies.forEach(e => e.update(dt, player));resolveCollisions(); // circle collision is enough for a prototyperender();requestAnimationFrame(loop);}
3.4 Asset Generation and Style Consistency
Generate textures and sound effects using a “unified prompt template plus fixed random seed” approach to keep containers, ground, and characters within the same style system. Build a “usable / needs regeneration” checklist for generated results to avoid endless rework.
3.5 Quick Playtesting and Iteration
Publish the prototype as a static page and distribute it via a link to collect feedback. Track three metrics: time to first-time play, average round duration, and distribution of death causes. These three matter more than visuals in deciding whether the gameplay works.
4. Engineering and Cloud Deployment: From Prototype to Something Operable
Once the prototype is validated, you can bring in general cloud capabilities to let more people play reliably:
- Object storage plus content delivery network (CDN): host static assets and versioned releases, reducing first-screen load time.
- Container platform: deploy match services and room management, scaling elastically with load.
- Message queue: smooth out traffic spikes and handle asynchronous events such as spectating and leaderboards.
- Logging and monitoring with alerts: pinpoint frame-rate jitter, abnormal exits, and API error rates.
On Baidu AI Cloud, these capabilities are offered as general categories that can be combined as needed, avoiding a large upfront investment.
5. Common Pitfalls and How to Avoid Them
- Copyright risk: do not replicate specific protected maps or characters; abstract them into a generic mechanic of “container cover plus top-down shooting.”
- Performance traps: a common issue in generated code is allocating objects repeatedly every frame. This is acceptable in the prototype stage, but before launch you need object pooling and batched rendering.
- Missing game feel: AI is good at implementing features, not at tuning. Movement acceleration, recoil, and hit feedback must be calibrated through repeated manual playtesting.
- Asset drift: multiple rounds of generation easily lead to inconsistent styles, so always fix the template and seed, and manage assets with an inventory list.
- Maintainability: require the tool to output comments and module boundaries, and avoid a single large file, so humans can take over later.
6. Conclusion: What Becomes More Valuable Once Costs Drop
When the marginal cost of art and boilerplate code approaches zero, a developer’s core competitiveness returns to three things: the ability to define what makes a game fun, the ability to playtest quickly and read the data, and the ability to engineer a prototype into an operable product. What 20 RMB buys is not a game, but a low-cost chance to try and fail. Turn this workflow into a team standard, and combined with general cloud infrastructure, the distance from idea to operable product will keep shrinking.
