
Wave Function Collapse
Watch procedural worlds generate tile by tile using the Wave Function Collapse algorithm. Mesmerizing constraint-based generation.
Created by CodingTrain
Create a free account to get instant access
How to Use
• Watch the algorithm automatically generate patterns by placing tiles on a grid according to adjacency rules • The system starts with all possibilities available for each cell, then gradually "collapses" cells by choosing specific tiles • Cells with fewer possible options (lower entropy) are prioritized for collapse first • When a cell collapses, it propagates constraints to neighboring cells, eliminating incompatible tile options • Click anywhere on the canvas to restart the generation process with a new random pattern • The algorithm may occasionally get stuck in impossible situations - simply click to restart if generation stops • Two modes available: Tiled Model uses predefined tile sets with explicit adjacency rules, while Overlapping Model analyzes sample images to learn valid patterns • No other controls needed - the algorithm runs automatically once started, demonstrating procedural generation techniques inspired by quantum mechanics