Hi everyone,
I made a small C++ library implementing 2D Wave Function Collapse and made a Godot wrapper around it with GDExtension. You can find the repo here. If this is something you would like to use for your own game please feel free to do so. I added a few usage examples to showcase how the library works. For convenience I’m also adding here a few short snippets.
The first example is a drawing panel where you can partially fill in the image with the building blocks extracted from the input sample provided, and then ask WFC to fill in the rest. Or you can let WFC fill in the whole thing.
The second example is a pseudo level generator. Here I used a simplified input sample in WFC, so that it generates a skeleton of the level, and the map it to a more elaborate tileset. Below the final result:
Please keep in mind I only tested the build in Ubuntu, since it’s the only operating system I have. As far as I know CMake works on any operating system, but if you encounter any issues please let me know ![]()
Cheers!