Crafty

Preface

Crafty: Building a Voxel Sandbox Game

Brendan Duncan#

A companion to Taos Engine: Building a Modern WebGPU Game Engine.

Crafty
Crafty

Status#

This book is a work in progress. Chapters are added as the game evolves.

What this book is about#

Writing a game engine is only useful if it can be used to build an actual game. Crafty is the first full game built on Taos Engine: a Minecraft-style voxel sandbox with an infinite procedurally generated world, creatures with their own AI, dynamic weather, and multiplayer. It is a style of game many people already know, which makes it a good yardstick for how well the engine holds up under a real workload.

Where the core book builds the reusable engine, this book builds the game on top of it — the systems that only make sense for this game.

ChapterWhat we build
Game ArchitectureSource layout, boot sequence, render setup, the frame loop, and how the chapters fit together
Block Voxel TerrainChunks, world generation, greedy meshing, block lighting, water, villages
Player PhysicsA kinematic character controller swept against the voxel grid
NPC AIState-machine creatures, spawning, skeletal animation
Game UIStart screen, HUD, hotbar, inventory, menus, settings, minimap
Weather SystemBiome-driven weather states, cloud coverage, precipitation
AudioSurface sound groups, footsteps, ambient music
Multiplayer GameplayPlayer sync, snapshot interpolation, block-edit replication, chat
World PersistenceSeed + edit-log saves, schema versioning

Before you start#

This book assumes the core book as background. The chapters that matter most are:

The game's source lives in crafty/, with the voxel world itself in src/block/. Run it with npm run dev and open http://localhost:5173/crafty/.