WaveFunctionCollapse

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

What is WaveFunctionCollapse?

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

Overview of WaveFunctionCollapse

What it is

WaveFunctionCollapse is a program that generates bitmaps locally similar to an input bitmap. It uses an observation-propagation cycle inspired by quantum mechanics to collapse a superposition of patterns into a definite output. The algorithm ensures that all NxN patterns in the output appear in the input (condition C1) and that the distribution of patterns approximates that of the input (weak condition C2).

Key features

  • Generates bitmaps and tilemaps from a single example image - Uses entropy-based observation and constraint propagation - Supports overlapping and simple tiled models - Can incorporate constraints for manual or algorithmic combination - Implemented in C++, Python, Rust, Java, JavaScript, and many other languages - Adapted to Unity, Unreal Engine 5, Godot 4, and Houdini

Use cases

WaveFunctionCollapse is used for procedural level generation in games such as Bad North, Caves of Qud, Dead Static Drive, Townscaper, and Matrix Awakens. It is also applied in texture synthesis, constrained synthesis (e.g., autocompleting human-started levels), and academic research. The algorithm works in higher dimensions for voxel model generation.

Getting started

See the repository README for installation and usage instructions.

License and pricing

The license is not stated in the repository metadata. The project is listed as open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/mxgmnwavefunctioncollapse.svg)](https://yunodb.com/tools/mxgmnwavefunctioncollapse?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/mxgmnwavefunctioncollapse?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/mxgmnwavefunctioncollapse.svg" alt="Featured on YunoDB" height="20"></a>