Projects

VoxelForge — A Voxel Sandbox Engine Built Properly

Active
TypeScriptThree.jsVitesimplex-noise
Product demo

Problem

Voxel sandboxes are the demo everyone builds with a coding agent right now, and almost all of them are a throwaway single HTML file that hitches on chunk generation, ships a texture pack, and cannot be read or extended.

Business Impact

This is the reference answer to a question a lot of engineers are asking right now — what the agent-built demo looks like when it is built as real software instead of a one-file toy. Every subsystem is separated, named, and readable.

System Approach

  • 16x64x16 chunks streamed around the camera with a per-frame generation budget
  • Biomes — plains, forest, desert, snowy mountains — from layered simplex temperature and moisture fields
  • 3D noise cave carving plus coal, iron, and gold veins that richen with depth
  • Culled-face meshing with separate opaque and translucent water geometry per chunk
  • Procedural 16x16 texture atlas painted to a canvas at boot — the repo ships zero image assets
  • First-person controller with pointer lock, sprint, fly toggle, and swept AABB collision
  • Amanatides-Woo DDA raycast for exact block targeting, plus an 8-slot hotbar
  • Deterministic cinematic demo mode for unattended capture

Key Decisions & Trade-offs

  • Multi-module TypeScript over a single HTML file — the whole point was to do the structured version
  • Per-frame generation budget so terrain streaming never costs a dropped frame
  • Procedural textures so the repo has no asset pipeline and no licensing question
  • Culled-face meshing over greedy meshing — simpler to read, fast enough at this chunk size
  • Exact DDA raycast rather than sphere-casting, because block targeting has to feel precise

Current Status

Public and open source at github.com/rohitguta2432/voxelforge. Terrain, biomes, caves, ores, meshing, procedural atlas, movement, collision, break and place, hotbar, and day-night cycle all working. Runs with npm install and npm run dev; append ?demo=1 for the cinematic flyover.

Roadmap

  • Greedy meshing for large flat surfaces
  • Web worker chunk generation to free the main thread entirely
  • Persistence so world edits survive a reload

What I'd Improve Next

  • Ambient occlusion on chunk vertices for depth readability
  • Structure generation beyond trees — villages, ruins

Explore More