Discussion about this post

User's avatar
Sir Whinesalot's avatar

I absolutely hate the name Wave Function Collapse, though I do get the logic behind the naming choice. But indeed, this is really just constraint solving with a different name, a domain-specific heuristic, and the neat "learn from an example image" capability.

The latter isn't even required, one can define the adjacency rules manually, which can be really useful to implement an editor for example (and is something machine learning-based solutions can't match).

The nice thing about WFC being just constraint solving, is that all the techniques from constraint solving apply: You can make the "flood fill" part really efficient with a proper arc-consistency algorithm like AC3. Backtracking a bottleneck? Go the SAT-route and add conflict-driven clause learning. Want to add an optimization goal (e.g., maximize the number of snow tiles) and solve that efficiently? Go the MIP-route and add in linear relaxations and Simplex. Need to generate absolutely massive tilemaps/images? Can use portfolio solving, cube-and-conquer, or mix in local search techniques like large neighborhood search, etc.

People sleep on constraint solving and just how powerful it can get.

Expand full comment
2 more comments...

No posts