Re:Building a Procedural Hex Map with Wave Function Collapse
by shoo on Monday March 09, 2026 @04:59PM
(#47315437)
there's also a bunch of dedicated constraint programming solvers / high level modelling languages for these kinds of constraint-y combinatorial optimisation problems
e.g. https://www.minizinc.org/ offers a high level modelling language that can target a few different solver backends
might be pretty good results to completely ignore writing a custom algorithm and drop in an existing industrial-grade constraint programming solver, model your procgen problem using a high level language, and use the existing solver to find you random solutions (or exhaustively enumerate them). then more time to iterate on changing the problem definition to produce more interesting maps rather than getting bogged down writing a solver.
Re:Building a Procedural Hex Map with Wave Function Collapse
by porphyra on Monday March 09, 2026 @05:06PM
(#47315522)
Yeah, you can also use Clingo [0] which is pretty popular and people have tried it specifically with WFC content generation [1]. You can even run it in the browser easily [2].
[0] https://potassco.org/clingo/
Re:Building a Procedural Hex Map with Wave Function Collapse
by felixturner on Monday March 09, 2026 @10:39PM
(#47318503)
Thanks for the feedback. Feel free to drop a PR :)
Re:Building a Procedural Hex Map with Wave Function Collapse
by mzl on Tuesday March 10, 2026 @03:07AM
(#47319960)
I have a (very slight) beef with the name Algorithm X, as it is more of a data-structure to manage undo-information for the backtracking than an algorithm. It is a very fun, useful, and interesting data-structure, but it doesn't really change what steps are performed in the backtracking search.
Furthermore, various heuristics can speed up the backtracking a lot compared to a brute force approach. As anyone who has implemented a Sudoku solver can attest, a brute force backtracking is easy to implement but will immediately get bogged down with slowness.
[1] https://en.wikipedia.org/wiki/Knuth%27s_Algorithm_X