Code as an Asset: A Technical Breakdown of a 1.36MB Real-Time Compiled AAA-Style FPS

    This article examines how generative coding with long-horizon autonomous execution can replace binary assets and offline baking with code assets and runtime compilation. Using a public experiment that produced a 1.36MB browser-playable realistic FPS in about eight hours, it breaks down the size distribution, the four-layer procedural generation pipeline, the real cost trade-offs, and the practical limits and rollout advice for teams.

    If you are planning to build a 3D game with AI, your first instinct is usually one of two paths: call a mesh generation service to produce models directly, or let an AI coding tool drive modeling software automatically. After all that effort, what you get is still a packaged file tens of megabytes in size, a few textures attached, and then you are back to worrying about rigging and animation tuning. A recent public experiment overturned that assumption: from a single natural-language requirement, with no human intervention, a model ran continuously for about eight hours and delivered a realistic single-soldier shooter page that is only 1.36MB, requires no asset pack download, and opens directly in a browser. This article does not judge specific products. Instead, it abstracts the phenomenon into a general technical question: when generative coding gains long-horizon autonomous execution, how can “code assets + runtime compilation” replace “binary assets + offline baking,” and what is the real impact on cost structure and engineering workflow.

    1. Where the Size Savings Come From: A Fundamental Switch in Asset Form

    The size of a traditional 3D project is dominated by binary assets: meshes, textures, animations, and audio. This experiment rewrote all assets as parameters and algorithms, so the size collapsed to the code itself. Based on its published structure, the breakdown is as follows:

    Module Share of Size Actual Responsibility
    Rendering foundation ~50% WebGL2 rendering wrapper and math library
    Scene layout ~10% Harbor scene manifest, cranes, waves, and wet ground
    Parametric prop library ~8% Molded components such as containers, forklifts, and generators
    Main loop and UI ~6.5% Crosshair styles, collision boxes, state machine
    Materials and decals ~5.3% Runtime-drawn nameplates, noise simulating rust, gravel
    Weapons and actions ~4.1% Part assembly, spring feel, reload and inspect
    Lighting and post ~3.9% Baked sky, soft shadows, mirror reflections, color grading
    Mechanical units and rigs ~3.9% Assembly and gaits for quadruped and flying units
    Audio synthesis ~3.9% Mathematical waveform synthesis of gunshots, sea wind, and music
    Particles and destruction ~3.8% Muzzle flash, shell ejection, black smoke, bullet holes, debris

    Two conclusions stand out. First, the rendering foundation is an incompressible fixed cost; its share of more than half shows that engine dependency still sets the size floor. Second, what is truly compressible is the content layer: as long as content can be described parametrically, size stops being a data-volume problem and becomes an algorithm-density problem.

    2. The Procedural Generation Pipeline: Four Layers

    To make code “grow” a world at runtime, four layers typically cooperate:

    1. Geometry layer: assemble props from primitives, extrusions, and boolean combinations, and use instanced rendering to spread draw-call overhead;
    2. Material layer: draw decals and noise on the fly with Canvas or shaders, expressing rust and wear as functions rather than images;
    3. Physics and interaction layer: approximate collision with boxes and capsules, and shape feel with spring-damper models;
    4. Audio layer: synthesize sound effects with oscillators and envelopes, avoiding any sample files.

    The illustrative code below expresses the idea of “a texture is a function”:

    1. // Generate a rust texture at runtime, replacing an external image asset
    2. function rustTexture(size = 256, seed = 7) {
    3. const c = document.createElement('canvas');
    4. c.width = c.height = size;
    5. const ctx = c.getContext('2d');
    6. const img = ctx.createImageData(size, size);
    7. for (let i = 0; i < size * size; i++) {
    8. const n = pseudoNoise(i, seed); // deterministic noise
    9. img.data[i*4] = 90 + n * 80; // R
    10. img.data[i*4 + 1] = 60 + n * 40; // G
    11. img.data[i*4 + 2] = 40 + n * 20; // B
    12. img.data[i*4 + 3] = 255;
    13. }
    14. ctx.putImageData(img, 0, 0);
    15. return c; // used directly as a texture source
    16. }

    3. The Real Cost-Benefit Calculation

    The experiment disclosed about $550 in token consumption. That is not cheap, but it has to be compared against the right denominator: under the traditional path, the labor cost of a realistic-scene artist and a gameplay programmer over several weeks is far higher. What this spend bought is plain-text assets that are iterable and versionable. The real cost-benefit turning point appears in modification cost: adjusting lighting or a prop only requires changing parameters and recompiling, with no need to re-export and re-integrate binary assets.

    To reproduce a similar workflow inside an enterprise, the pragmatic approach is to run long-horizon generation tasks on an elastic container platform, store each build artifact and prompt version in object storage, and use logging and monitoring with alerts to track failed retries and token consumption, forming an auditable, rollback-capable pipeline. The general-purpose container, storage, and monitoring capabilities offered by Baidu AI Cloud are suitable for carrying this kind of “compiled content production” workload.

    4. Limits and Rollout Advice

    Its limitations must be recognized clearly: procedural generation excels at hard surfaces and industrial styles but remains weak on character detail and narrative expression; runtime compilation raises CPU usage and first-frame latency, so mobile devices need a fallback strategy; and poor management of deterministic noise and random seeds causes asset drift that is hard to reproduce. The suggested rollout order is: first build a small-scene vertical slice to validate the pipeline, then introduce a versioned asset manifest, and finally connect automated evaluation and regression. Overall, the real value of this paradigm is not “AI replacing modelers” but migrating 3D content from binary delivery to code delivery, so that worlds are compiled on the spot at runtime.