#14 · Primary category: AI Design & Prototyping

WaveFunctionCollapse

algorithm csharp gamedev machine-learning procedural-generation wfc

Bitmap & tilemap generation from a single example with the help of ideas from quantum mechanics

Project last updated:03/22/26

GitHub Stars

25.3K

Forks

1.4K

Contributors

21

License

Other

Why we included this project

Wave Function Collapse turns a single small example image into varied, locally consistent bitmaps and tilemaps. There is no training step: each output cell starts as a superposition of possible states, and the algorithm repeatedly collapses the least-certain region and propagates constraints until the whole image resolves. Game developers and level designers use it for tiled floors, walls, dungeons, and terrain that look handcrafted but take seconds to produce, and it has shipped in titles like Townscaper and Caves of Qud. The implementation is compact and has few dependencies, which makes it a solid reference for learning constraint-based generation and for porting the idea to other engines or languages. For believable procedural content without the overhead of a learned model, this is the implementation worth studying.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category