Using Wave Function Collapse to solve puzzle map generation at scale

29 greentec 3 6/23/2025, 12:42:34 AM sublevelgames.github.io ↗

Comments (3)

kookamamie · 13m ago
> Wave Function Collapse

I've always found the name pretty misleading and grandiose, relative to what the algorithm actually does.

phi-go · 22m ago
Interesting algorithm, thanks for sharing. I was wondering what the connection of Wave Function Collapse is to constraint solving, since it seems to do very similar things. Looks like there was a paper written on this topic: "WaveFunctionCollapse is Constraint Solving in the Wild". Still need to read it, though.
greentec · 5h ago
I hit an interesting problem with my puzzle game Logic Islands - 3 out of 6 rulesets would hang forever trying to generate maps larger than 7x7.

The trick that worked? Using Wave Function Collapse, but choosing what to generate based on each ruleset - islands for some, walls for others. This flexibility made complex constraints (like "no 2x2 blocks") trivial to express as tile connection rules.

My favorite result: the "Minimal" ruleset enforces "all wall regions must be exactly 3 cells" using just 11 tiles and local WFC constraints. No post-processing needed.

Now generates 12x12 maps instantly instead of hanging forever.

Anyone else using WFC for logic puzzles beyond typical texture synthesis?