
Open world game
Prompt
You are a senior graphics/game programmer specializing in real-time 3D web games built with Three.js. TASK Build a single-page, browser-playable, open-world 3D action-adventure game in the spirit of The Legend of Zelda: Breath of the Wild — explorable terrain, a controllable character, combat, and NPCs — delivered as one self-contained HTML file. Note on "realistic": this means believable lighting/shadows, naturalistic proportions and movement, and a physically coherent world — not photoreal rendering, which isn't achievable through procedural code alone with no external art assets. WORLD & ENVIRONMENT - An open playable area of at least 500x500 units with varied elevation (hills, a valley, at least one mountain) - At least 3 visually distinct biomes/zones (e.g. grassy plains, forest, rocky highlands), each with different ground color/texture and vegetation density - A dynamic day-night cycle: moving sun/moon, shifting sky color, real-time directional lighting changes - One water body (lake or river) with an animated surface - Scattered detail — trees, rocks, grass — instanced for performance, plus one village or ruin the player can walk into - Third-person camera that follows the player and doesn't clip through terrain or obstacles CHARACTER & CONTROLS - Player rendered as an articulated humanoid (built from primitives or a simple rigged mesh) — not a bare capsule - WASD movement, mouse-look, Shift to run, Space to jump, with gravity, ground collision, and slope handling - Swimming in water, climbing on steep-but-climbable surfaces - A stamina meter that drains on running/climbing/swimming and regenerates when idle NPCs, ENEMIES & COMBAT - At least 2 friendly NPCs in the village with idle animation and a dialogue box on interact (E key) - At least 1 enemy type with basic AI (patrol, notice the player, chase, attack in range) - Left-click sword attack with a swing animation, hit detection, enemy health/death, and a player health bar that takes damage on enemy contact UI - Health bar, stamina bar, and a minimap or compass, rendered as an HTML/CSS overlay (not in the 3D scene) - Context prompt for interactables ("Press E to talk") TECHNICAL CONSTRAINTS - One self-contained .html file; Three.js loaded from a CDN; no build step - No external model/texture/audio files — generate everything procedurally (geometry, canvas-based or shader textures, noise-based terrain) - Target 60fps on a mid-range laptop; use instancing for repeated geometry and culling where it matters - Comment each major system (terrain, player controller, camera, combat, NPC AI, UI) so the code is auditable PROCESS 1. Before writing code, sketch the architecture in a short comment block: scene setup, game loop, state management, and how the systems interact. 2. Build terrain and lighting first, then the player controller and camera, then NPCs/enemies/combat, then UI — each layer should work before you add the next. 3. Once complete, check the result against "Definition of done" below and fix any gaps before delivering. DEFINITION OF DONE - Opens in a browser with no console errors and no missing-asset errors - Player can traverse the whole terrain without falling through it or getting stuck - The day-night cycle visibly progresses during a normal play session - One full NPC conversation and one full enemy fight work start to finish - All UI elements update correctly in real time Deliver the complete code in a single code block — no truncation, no "rest follows the same pattern," no placeholders.
A system prompt was added to support web rendering