playable in browser C# Godot Procedural Gen Algorithms
Loads ~60 MB WebAssembly, click to start

Wave Function Collapse

WFC treats map generation as a constraint propagation problem. Each cell starts in a superposition of all possible tile states. The algorithm picks the cell with the lowest entropy, collapses it to a single tile, then propagates the constraints to adjacent cells, ruling out incompatible neighbours. Repeat until the whole grid is resolved, or backtrack on contradiction.

This implementation is built from first principles in Godot C#, no external WFC library. The adjacency rules are derived automatically from a sample tileset.