7 comments

[ 3.5 ms ] story [ 28.8 ms ] thread
I always found "wave function collapse" to be a terribly overcomplicated name for a pretty intuitive concept. The first paragraph does a good job explaining the term, but still I wonder how many people stray away from such things when the name alone is overwhelming.
This is based off of Paul Merrell's Model Synthesis work [0]. Boris The Brave had a good writeup of the core of the algorithm [1].

Max Gumin focused on just the constraint solver and added a "minimum entropy heuristic", popularized the work and coined the term "wave function collapse", as the way the solver worked was evocative of (a naive view) of how quantum mechanics solves systems [2]. Gumin's repo also has many other resources of implementations and descriptions [3].

I've published a paper on an extension that adds in a type of backtracking to both the "WFC" portion of the solver and the modify in blocks portion of the solver, which can be found in [4], for those interested.

[0] https://paulmerrell.org/model-synthesis/

[1] https://www.boristhebrave.com/2021/10/26/model-synthesis-and...

[2] https://github.com/mxgmn/WaveFunctionCollapse

[3] https://github.com/mxgmn/WaveFunctionCollapse?tab=readme-ov-...

[4] https://zzyzek.github.io/PunchOutModelSynthesisPaper/

There's a neat demo of this in action here: https://jaxry.github.io/wave-function-collapse/

Another, where you can set cells and then have it solve: https://oskarstalberg.com/game/wave/wave.html

And an itch.io game where you are the wave function selector: https://bolddunkley.itch.io/wfc-mixed

I thought this concept would have found more traction in the world of procgen (in games), because it's pretty neat. But I found it difficult to work with, so perhaps others also did!

I think one of the neat things with this algorithm is that it's completely local, but still creates global structures that fit together.

This is in contrast to LLMs, and I assume it comes from that it discards improbable things instead of choosing probable things.