I Prompted Meta Muse Spark 1.3 to Build a 3D Open-World Survival Game — 793 Lines of Three.js in One Shot


I gave Meta's newly released frontier model Muse Spark 1.3 our standard hands-on game development benchmark: build a complete, first-person 3D open-world survival game in Three.js inside a single self-contained HTML file, with zero frameworks, custom procedural terrain, a 6-slot hotbar, crafting with ghost placement previews, resource harvesting, and a dynamic day/night cycle.
Muse Spark 1.3 generated 793 lines of clean, production-grade JavaScript and WebGL code (41.4 KB) on its very first attempt. When double-clicking the file in Chrome, the player spawns on a deliberately flattened bare clearing at (0, 0) before stepping forward into rolling hills, deep forests, and distant snow peaks. It met every single functional requirement in the prompt with zero syntax errors, maintained a locked 60 FPS via instanced meshes, and even caught and patched its own modal handler bug inline mid-generation.
What I asked for
To ensure an exact, apples-to-apples comparison against prior tests of Gemini 3.8 Flash, GLM-5.2, and DeepSeek V4 Pro, I pasted our standardized Test 1 prompt verbatim into Muse Spark 1.3:
You are an expert Three.js game developer.
Create a complete first-person open-world survival game in ONE SINGLE HTML FILE.
IMPORTANT:
- Output ONLY one file: index.html
- Put all HTML, CSS, and JavaScript inside this single file.
- Do not create any other files.
- Do not use external assets.
- Do not use React, TypeScript, or any frameworks.
- Use only Three.js from CDN.
- The final file must run by double-clicking index.html.
- This must be a real 3D open world with procedurally generated terrain the player can freely walk across in any direction — NOT a fixed arena, NOT a flat plane with no elevation, NOT a bounded room.
WORLD GENERATION:
- Procedurally generate terrain using Perlin/Simplex-style noise (implement a simple noise function yourself if no external library is allowed) to create rolling hills and varied elevation across a large playable area (at least several hundred units in each direction).
- Generate at least 2-3 distinct biome zones based on noise/position (e.g. grassland, forest, rocky/mountain, desert, or snow) with different ground colors and vegetation density.
- Scatter 3D vegetation/props appropriate to each biome: trees (trunk + foliage from primitives), rocks, bushes using InstancedMesh where appropriate for high 60 FPS performance.
- Simple horizon fog to mask pop-in.
CAMERA & PLAYER:
- First-person camera at eye height with pointer-lock mouse look (look up/down and turn left/right).
- Terrain height collision: player Y smoothly follows the terrain surface; player cannot clip through trees or rocks.
- Controls:
- WASD: move (camera-relative)
- Space: jump
- Shift: sprint (drains stamina)
- Left click: harvest resource node or interact
- E: toggle inventory/crafting overlay
- Mouse: look
SURVIVAL STATS:
- Health (0-100): drains if hunger reaches 0 or from fall damage.
- Hunger (0-100): drains steadily over time; restored by eating food/berries.
- Stamina (0-100): drains while sprinting/jumping; regenerates when idle/walking.
- Survival HUD overlay showing health, hunger, and stamina bars in the top-left corner.
RESOURCES & CRAFTING:
- 6-slot hotbar at the bottom of the screen.
- Harvestable resource nodes:
- Trees -> Wood (hit-flash visual feedback; node depletes and respawns on cooldown)
- Rocks -> Stone
- Bushes -> Food (berries)
- Crafting system (toggle with E):
- At least 3-4 craftable recipes (e.g. Axe, Campfire, Torch, Shelter Wall).
- Placeable items show a semi-transparent ghost preview mesh projected on the terrain before placement.
DAY/NIGHT CYCLE:
- Real-time day/night lighting cycle (~2–3 minutes per full cycle) with orbiting directional light (sun/moon) and ambient/sky color shifts.
- Placed campfires or equipped torches cast functional point light in the dark.
UI & GAME LOOP:
- Reticle crosshair in the center.
- Inventory & crafting overlay.
- Death screen with a "Respawn / New Game" button that cleanly resets or regenerates state without page reload.
CODE: Output ONLY the complete index.html file with all CSS in <style> and JS in <script>. No explanations, no markdown wrap outside the code block, no separate files.
Interactive Demo
W A S D / Arrow Keys to drive
This is Meta Muse Spark 1.3's exact one-shot output. Click inside the canvas to lock the mouse pointer and explore the procedural world.
Procedural Value Noise and 5 Biomes
Rather than importing Simplex or Perlin libraries, Muse Spark 1.3 rolled its own seeded 32-bit PRNG (mulberry32) alongside a custom 2D smoothstep value noise algorithm (vnoise) layered into fractal Brownian motion (fbm).
The terrain spans a massive 1,000×1,000 unit plane (WORLD = 1000). To guarantee the player didn't spawn trapped inside a rock or clipped halfway into a vertical cliff, the model implemented an intelligent spawn flattening dampener: any vertex within a 25-unit radius of (0, 0) is flattened to elevation 6. As you walk forward past the initial clearing, the full terrain unfolds into rolling hills, deep valley water planes, and towering mountain ridges that exceed 110 units in elevation.
The world procedurally distributes five distinct biomes based on altitude and moisture noise maps:
- Grassland (
b = 0): Lush light green ground with moderate tree and berry bush density. - Dense Forest (
b = 1): Deep emerald ground packed with pine trees and harvestable bushes. - Desert (
b = 2): Warm sandy dunes with sparse shrubbery. - Rocky Mountains (
b = 3): Jagged grey crags rich in stone boulders. - Snow Peaks (
b = 4): Frosted white summits with pale pine trees and freezing horizon fog.
Sunset Landscape, Biome HUD, and Procedural Lake in Meta Muse Spark 1.3 Survival
Instanced Prop Performance and Collision
Many one-shot LLM game prototypes fail on performance by instantiating hundreds of independent THREE.Mesh objects with unique draw calls. Muse Spark 1.3 avoided this pitfall entirely by using THREE.InstancedMesh for all world flora:
trunkIM&leafIM: 380 trees with randomized scales and cone foliage.rockIM: 220 dodecahedron boulders.bushIM&berryIM: 170 spherical berry bushes with pink berry accent spheres.
Every prop registers an AABB radial push cylinder in the collide() routine. When the player walks toward a tree or rock, the physics loop repels the player outward without jitter, preventing wall-clipping.
Harvesting uses camera raycast targeting (findTarget()) with a 5-unit interaction reach. Left-clicking a tree or rock triggers an instant white hit-flash on that specific instance via instanceColor.setColorAt() and spawns animated yellow crosshair recoil. When a node depletes, the instance scale collapses to (0.001, 0.001, 0.001) and moves underground, setting a 60-second respawn timer before restoring its geometry.
Placed Campfire Illuminating Terrain at Dusk in Meta Muse Spark 1.3
Day/Night Lighting, Torches & Flickering Campfires
The celestial loop runs on a 160-second timer (DAY_LEN = 160). An orbital sun light casts dynamic directional shadows (THREE.PCFShadowMap), while an opposing soft blue moon light takes over at night.
As the sun sets below the horizon, the scene fog and background sky interpolate through three distinct color targets: midday sky blue (#87ceeb), fiery dusk orange (#ff7e47), and deep midnight navy (#070d24). Simultaneously, a procedural spherical starfield containing 600 points fades into view as night sets in.
Night is pitch black without a light source. To survive, players can press Q to ignite a hand-held torch (casting a 18-unit point light that follows the camera) or place a crafted Campfire. Campfires combine a circular ring of stones, crossed wood logs, two animated flame cones that oscillate in scale, and an omnidirectional orange point light with multi-frequency sinusoidal flicker (Math.sin(time * 0.012) + Math.sin(time * 0.03)).
Inventory and Crafting Modal Overlay with Recipes
Inventory, Crafting & Ghost Preview Placement
Pressing E unlocks the mouse pointer and displays a dark glassmorphic modal containing an inventory tracker and interactive recipe cards:
- Stone Axe (3 Wood + 2 Stone): Equippable in slot 4. Accelerates harvesting speed and doubles resource yield (+5 Wood/Stone per node).
- Torch (2 Wood + 1 Stone): Unlocks togglable mobile lighting (
Q). - Campfire (5 Wood + 3 Stone): Adds placeable campfires to slot 6.
- Shelter Wall (4 Wood + 2 Stone): Activates freeform wall construction.
When selecting the campfire or crafting a wall, Muse Spark 1.3 projects a semi-transparent green ghost preview mesh (opacity: 0.4) four units in front of the player. The ghost calculates the exact terrain elevation below its projected coordinates (getHeight(px, pz)) in real time, allowing players to rotate the wall using R before confirming placement with left click.
Dynamic Semi-Transparent Ghost Placement Preview for Shelter Wall at Night
What Impressed Me
- Mid-Generation Self-Correction: The most fascinating detail in Muse Spark 1.3's code is at lines 424–434. After writing an initial
toggleCraftfunction that had an ambiguous parameter check, the model recognized its own flaw and wrote:
Seeing a model autonomously detect a state-handling bug during code streaming and patch it without failing the run demonstrates remarkable agentic awareness.// fix toggleCraft logic wrapper (above has bug, redefine cleanly) var _origToggle = toggleCraft; toggleCraft = function(f) { ... }; - Compact Efficiency (793 Lines): Where Gemini 3.8 Flash took 1,708 lines and GLM-5.2 took 1,014 lines, Muse Spark 1.3 packed five biomes, instanced meshes, ghost placement, and dynamic lighting into just 793 lines. There is zero bloat or redundant boilerplate.
- Clean Permadeath Reset: Dying from starvation or fall damage opens a death screen with a working "Respawn / New Game" button. Clicking respawn revives all depleted instanced nodes, strips placed entities from the scene graph, resets day count to Day 1, and repositions the player at
(0, 0)with pointer lock re-engaged without requiring a page reload.
What Needs Work
- Initial Spawn Impression: Because the elevation formula intentionally flattens a 25-unit circle around
(0, 0)to prevent spawn clipping, the player begins on an empty patch of bare terrain. Moving 10–20 steps forward reveals the dense forests and hills, but an initial glance makes the world look deceptively empty. - No Sound FX: Unlike Gemini 3.8 Flash's unprompted Web Audio synthesis engine, Muse Spark 1.3 did not include procedural audio feedback.
- Hostile Entities: The survival pressure relies entirely on hunger decay and fall damage from mountain scaling; no wild animals or monsters roam the wilderness.
Honest Assessment
Try It Yourself
You are an expert Three.js game developer.
Create a complete first-person open-world survival game in ONE SINGLE HTML FILE.
IMPORTANT:
- Output ONLY one file: index.html
- Put all HTML, CSS, and JavaScript inside this single file.
- Do not use external assets or frameworks.
- Use Three.js from CDN (https://cdnjs.cloudflare.com/ajax/libs/three.js/0.149.0/three.min.js).
- Must run by double-clicking index.html.
WORLD & TERRAIN:
- Procedurally generate rolling 3D terrain heightmap using a custom noise function (value noise or simplex noise).
- Include distinct biomes (Grassland, Dense Forest, Desert, Rocky Mountains, Snow Peaks).
- Scatter harvestable 3D vegetation and props using InstancedMesh for locked 60 FPS performance.
CONTROLS & SURVIVAL:
- First-person camera with WASD movement, Space to jump, Shift to sprint, and pointer-lock mouse look.
- Survival HUD: Health, Hunger (drains over time), Stamina.
- 6-slot hotbar with equippable items (fist, axe, torch, berries, campfire, wall).
- Crafting system (toggle with E): Axe, Campfire, Torch, Shelter Wall with green ghost mesh placement preview.
- Day/night cycle with orbiting celestial lights and point lights for torches and campfires.


