Welcome to my implementation of the WFC-algorithm in the Qt Framwork.
An explanation (and cooler implementations) of the algorithm can be found on following sources:
Superpositions, Sudoku, the Wave Function Collapse algorithm. by Martin Donald
Coding Challenge 171: Wave Function Collapse by @CodingTrain
I thought this is a fun algorithm to implement.
There's still some work to do and I have some ideas in mind that I will implement at some point.
Features until now:
- Customizable dimensions (but only square for now)
- Customizable weights
- Customizable sockets
- Customizable amount of sockets if you choose to make your own tiles
- If you dont want to make your own Tiles in qml you may use "Tile.qml" to add e.g. Tiles in .png. (This is not tested with the new QML-Implementation)
- Clicking changes the colors to "nightmode" and back easily, even while running. Qml can be very cool.
In this example a weightlist is active that discourages Tiles that connect diagonals to horizontals, resulting in clusters:
Here, all times are equally as likely. Also the colors get switched.
The limit where you actually see someting is around 100x100. Here is a Video of that being solved:
For better Quality Click on GIF or here
The old QML implementation was so slow that this took over an hour. Click here for a timelapse of that