How Pure-Code 3D Game Generation Works: A Breakdown of the 1.36MB Build and Its Cost Efficiency

    This article analyzes a public experiment in which an AI coding tool autonomously built a playable 3D first-person shooter called Saltline in about 8 hours for roughly $550 in token costs, packaged into a single 1.36MB local HTML file. It breaks down the file size by module, explains the four core techniques behind runtime procedural generation, outlines what this approach can and cannot do, and offers a practical cost model and engineering checklist for developers evaluating pure-code 3D content production.

    1. What a 1.36MB 3D Page Actually Means

    A recent public experiment drew attention: a developer gave a single-sentence requirement—build a realistic, AAA-looking first-person shooter—and let an AI coding tool run autonomously for about 8 hours with no human intervention. The result was a playable web build named Saltline, produced at a cost of roughly $550 in token consumption.

    The interesting part is not whether it could be built, but how it was delivered: everything is packed into a single local HTML file of about 1.36MB. There is no texture pack to download and no external model file to load—open it and play. This represents a paradigm shift: from “generate assets, then load them” to “synthesize assets at runtime from parameters.”

    In a traditional 3D project, art assets (meshes, textures, animations, audio) usually account for more than 90% of the build size and most of the manual effort. Procedural generation takes a different route: keep only the generation rules and parameters, and compute geometry, material textures, skeletal motion, and sound effects in real time in the browser using math. The size drops from hundreds of megabytes to the 1MB range—essentially trading compute for storage and bandwidth.

    2. Where the Bytes Go

    The publicly shared module breakdown shows a very disciplined structure:

    Module Share of Size Actual Responsibility
    Rendering base (WebGL2 wrapper and math library) ~50% Core rendering, matrix and vector math
    Scene assembly ~10% Harbor layout, cranes, waves, wet ground
    Industrial prop library ~8% Parametric molds for containers, forklifts, generators
    HUD and main loop ~6.5% Crosshair, collision boxes, game loop
    Materials and decals ~5.3% Runtime Canvas nameplates, noise-based rust and gravel
    Weapons and hand motion ~4.1% Part assembly, spring feel, reload inspection
    Lighting and post-processing ~3.9% Baked sky, soft shadows, water reflections, color grading
    Mechanical enemies and skeletons ~3.9% Quadruped gait, assembled mechanical gulls
    Audio synthesis ~3.9% Math-based gunshots, sea wind, and score
    Particles and destruction ~3.8% Muzzle flash, shell ejection, black smoke, bullet holes, debris

    Three conclusions follow. First, the rendering base takes up half the file, which shows that the underlying dependencies cannot be compressed—this is the “fixed cost” of the WebGL2 ecosystem. Second, every content module stays in the single-digit percentages thanks to parametric mold reuse: one container mold produces dozens of variants through size, color, and rust parameters. Third, fully algorithmic audio and textures are the biggest contributors to size reduction.

    3. The Technical Principles: Four Capabilities Working Together

    Getting a model to write a large, runnable project in one pass requires four capabilities in coordination.

    1. Procedural scene and geometry modeling. Combine primitive shapes, perturb them with noise functions, and use instanced rendering (InstancedMesh) to batch-draw repeated objects, avoiding the performance cost and code bloat of creating them one by one.
    2. Runtime material synthesis. Draw nameplates and markings with Canvas 2D, generate rust, gravel, and water stains with hash noise and fractal Brownian motion, then upload the result to the GPU as a texture. Example logic:
    1. function rustTexture(size = 256, seed = 1) {
    2. const c = document.createElement('canvas');
    3. c.width = c.height = size;
    4. const ctx = c.getContext('2d');
    5. const img = ctx.createImageData(size, size);
    6. for (let y = 0; y < size; y++) {
    7. for (let x = 0; x < size; x++) {
    8. const n = fbm(x * 0.05, y * 0.05, seed); // fractal noise
    9. const i = (y * size + x) * 4;
    10. img.data[i] = 90 + n * 120; // R, reddish brown
    11. img.data[i + 1] = 40 + n * 60; // G
    12. img.data[i + 2] = 20 + n * 30; // B
    13. img.data[i + 3] = 255;
    14. }
    15. }
    16. ctx.putImageData(img, 0, 0);
    17. return c; // used directly as a texture source
    18. }
    1. Approximated physics and feel. Use capsule/AABB collision volumes instead of precise mesh collision, and a spring-damper model to simulate recoil and reload feel, trading a little realism for less code and a higher frame rate.
    2. Algorithmic audio synthesis. Layer oscillators with noise and ADSR envelopes to synthesize gunshots and sea wind, and use a step sequencer to generate combat music, eliminating audio files entirely.

    4. Capability Boundaries: What It Does Well and What It Does Not

    To be objective: this kind of output performs best on large scenes, hard-surface objects, and industrial styles, because those objects are themselves parametric assemblies. It still lags clearly on high-precision human faces, cloth simulation, complex organic surfaces, and cinematic-grade materials—runtime synthesis is no substitute for hand sculpting and offline baking.

    The sensible positioning, therefore, is: prototype validation, playable demos, interactive marketing pages, teaching demonstrations, and performance stress testing. If the goal is a commercial AAA title, a traditional art pipeline and offline baking are still needed to fill the gap.

    5. The Real Cost-Efficiency Calculation

    $550 over 8 hours looks expensive, but it needs to be broken down: it replaces the work hours of “a 3D prototype team over several days to weeks,” and the output is runnable code rather than static mockups. Cost-efficiency should be judged with three metrics:

    • Cost per playable feature = total token cost ÷ number of verifiable feature points;
    • Rework rate = number of modules needing manual fixes ÷ total number of modules;
    • Asset reuse rate = number of parametric molds ÷ total number of scene objects.

    When the rework rate is low and the reuse rate is high, the marginal cost of this approach drops quickly. From an engineering standpoint, the recommendation is to split the large task into six independently acceptable milestones—scene, props, weapons, enemies, audio, and post-processing—paired with automated screenshots and frame-rate checks, and to run long tasks with hosting and quality dashboards built on containerized execution, logging, and monitoring/alerting capabilities offered by platforms such as Baidu AI Cloud, avoiding the unpredictability of a single long run.

    6. Practical Advice for Developers

    1. Build a “size budget table” first, setting a KB ceiling for each module and rolling back any overrun.
    2. Keep assets parametric; forbid inline large arrays and long textures.
    3. Use deterministic random seeds so every generation is reproducible and regression-testable.
    4. Fix the rendering base as a team standard component and let the model handle only the content layer—this significantly reduces both size and error surface.
    5. Long autonomous tasks must include checkpoints and staged acceptance, with monitoring and alerting to locate bottlenecks.

    In summary, the value of pure-code 3D generation is not “replacing artists” but pushing the startup cost of 3D content production close to zero, increasing the speed of validating ideas by an order of magnitude. Understanding its size structure, capability boundaries, and cost model is what turns it into real cost-efficiency.