AI-Generated 3D Games from Pure Code: Technical Breakdown and Cost Analysis
This article examines an experiment in which an AI coding agent built a playable, realistic-style 3D shooter as a single local HTML file of about 1.4MB, with all assets computed procedurally at runtime instead of loaded from model or texture files. It breaks down the size of the four core asset categories, explains why pure-code 3D generation now works, analyzes the roughly $550 cost structure, and offers reusable engineering practices for prototyping, validation, audio synthesis, and cost observability.
If you want to build a 3D game with AI today, the first instinct is usually one of two paths: use a mesh generation service to produce models directly, or have an agent drive a 3D modeling application to build assets automatically. After all that effort, you still end up with model files tens of megabytes in size plus a few textures, and then you get stuck on rigging and animation. This article is about a different path: computing every asset in code, where the final deliverable is a single local web page of roughly 1.4MB.
1. An Experiment That Has Been Repeatedly Validated
An engineer posted a screen recording on social media: given a single natural-language requirement for an AI coding tool — a realistic art style, AAA visual quality, single-soldier shooter — with no human intervention whatsoever. The model ran continuously for about 8 hours, consumed roughly $550 in token credits, and finally delivered a playable page called Saltline.
The key feature is not the visuals but the delivery format: no asset pack to download, just a single local HTML file; no offline model files, no bitmap textures — every asset is computed in real time by code at runtime. The size and share of the four core asset categories are roughly as follows:
- Rifle, hands, and animations: about 57KB, 4.1% — part assembly, spring recoil feel, reload and inspect animations;
- Mechanical enemies and skeletons: about 54KB, 3.9% — assembly logic for mechanical gulls and mechanical hounds, four-legged walking gait;
- Sound and music: about 54KB, 3.9% — gunshots, sea wind, and combat score synthesized from mathematical waveforms;
- Combat particles and destruction: about 53KB, 3.8% — muzzle flash, shell ejection, black smoke, bullet-hole decals, explosion debris.
Together the four parts add up to less than 220KB, which shows that the vast majority of the size goes to engine runtime overhead and scene logic, while the assets themselves are compressed to the extreme.
2. Why Pure-Code 3D Generation Holds Up This Time
The common objection is that pure code can only assemble simple geometry and cannot produce fine facial expressions or large scenes. That judgment held true two years ago; it now needs revision, for three reasons.
The first is a shift in representation. Traditional pipelines treat assets as “files”; the procedural approach treats assets as “functions.” A gun is no longer an imported model but the output of buildRifle(seed); as long as the function is deterministic, the same seed always reproduces the same gun, and the size drops from megabytes to kilobytes.
// Example: deterministic pseudo-random generation + part assemblyfunction mulberry32(a){return function(){a|=0;a=a+0x6D2B79F5|0;let t=Math.imul(a^a>>>15,1|a);t=t+Math.imul(t^t>>>7,61|t)^t;return((t^t>>>14)>>>0)/4294967296}}function buildRifle(seed=7){const rnd=mulberry32(seed), parts=[];for(let i=0;i<12;i++) parts.push({len:0.2+rnd()*0.5, r:0.01+rnd()*0.03});return parts; // instantiated on the render side, never written to disk}
The second is a substitution of where detail comes from. Realism does not depend only on polygon count, but more on material response, lighting, and motion curves. The spring feel comes from damping parameters rather than textures; what makes the mechanical hound feel “alive” is the phase offset of the four-legged gait, not skeletal precision.
The third is that constraints actually improved output quality. Zero human intervention means the model has to write its own spec, verify its own work, and fix its own errors. What a long-horizon agent does over 8 hours is essentially split “making a game” into four parallel subtasks — asset layer, animation layer, audio layer, effects layer — each closed-loop on its own before integration.
3. Cost Structure: What $550 Actually Buys
Cost-effectiveness cannot be judged by the total price alone; it has to be broken into three parts.
- Compute and token cost: about $550 over 8 hours, less than $70 per hour on average. This part keeps falling as models iterate and is the only cost that naturally depreciates.
- Labor cost: close to zero, which is the fundamental difference from an outsourcing pipeline. In the traditional path, rigging, animation tuning, audio tuning, and integration often consume more than 70% of the total work hours.
- Hidden cost: maintainability and controllability. Pure-code assets are hard for artists to modify directly — the style is consistent but personalized adjustments are difficult; debugging one “weird jitter” from procedural generation may take longer than editing a model file.
Conclusion: if the goal is to get a playable prototype quickly, the cost-effectiveness is extremely high; if the goal is to enter a formal production pipeline and support multi-person collaborative iteration, a hybrid with the traditional asset pipeline is still needed.
4. Reusable Engineering Recommendations
- Deliver in layers. Have the model first produce a minimal runnable closed loop (movement, shooting, hit detection), then add assets layer by layer, so problems can be localized instead of appearing all at once after a single generation.
- Build validation into the process. Require the model to self-check: frame-rate thresholds, asset size limits, assertions for key interactions, with automatic rollback on failure.
- Go with synthesis rather than sampling for audio. Mathematical waveform synthesis takes up almost no space and is easy to parameterize, which suits the prototype stage.
- Keep human fallback points. For the three subjective items — feel, pacing, and difficulty curve — automation yields the lowest returns.
- Make cost observable. If you use a cloud-based AI coding or inference service, it is advisable to connect general-purpose monitoring, alerting, and logging services, measure usage on both token and duration dimensions, and archive artifact versions in object storage for later review.
5. Conclusion
The real value of this experiment is not that “AI can build a AAA game,” but that it changes the cost curve of 3D assets from “billed by the megabyte” to “billed by inference time.” The former grows linearly with project size; the latter falls as model capability rises. The practical advice for developers is: hand prototyping and validation over to automation boldly, keep the human-machine division of labor in the production pipeline, and design cost observability and version archiving in from the start.
