Study a minimal voxel game in C to learn how procedural terrain generation and chunk-based rendering work.
Self-host the Python multiplayer server and play online with friends by passing a hostname at launch.
Use the codebase as a starting point for building your own block-based sandbox game without engine overhead.
Requires a C build toolchain and OpenGL, the original multiplayer server is offline, so self-hosting the Python server is needed for online play.
Craft is a Minecraft-style sandbox game written from scratch in C, kept deliberately small at just a few thousand lines of code. It runs on Windows, Mac, and Linux and uses modern graphics techniques (shaders via OpenGL) rather than older fixed-function approaches. Pre-built binaries were available from the author's website, though the original multiplayer server has since been taken down and players now need to self-host if they want online play. The game includes most features you would expect from a voxel sandbox: procedurally generated terrain using noise functions, more than ten block types, plants like grass and flowers and trees, glass blocks with transparency, simple clouds, and a day and night cycle. Everything a player builds or destroys is saved to a local SQLite database. Only the changes from the default world are stored, so the database stays compact. Multiplayer is supported through a Python-based server. The client and server communicate over plain sockets using a simple text protocol. Players can connect to a server by passing a hostname at launch or by typing a command inside the game. The server sends chunk data on demand and broadcasts block changes and player positions to all connected clients in real time. Controls follow familiar conventions: WASD to move, spacebar to jump, left click to break blocks, right click to place them. Players can toggle between walking and flying with Tab, zoom with left shift, and write text on blocks to create signs. Chat commands let players teleport to other users, switch usernames, or move to specific coordinates. The implementation splits the world into 32-by-32 block columns called chunks. Only faces that are actually exposed to air are sent to the graphics card, and only chunks currently visible to the camera are drawn, which keeps performance reasonable. The terrain is deterministic: the same position always generates the same landscape. Text on screen is drawn using a bitmap atlas, and player models are built from simple rectangular primitives defined in code.
← fogleman on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.