WaveFunctionCollapseSwift

Swift Implementation of Wave Function Collapse using the tiling method. The project is structured in a way where it is pretty easy to plug in new tiles and rules.

RPReplay_Final1661549427.2.MOV

RPReplay_Final1661549427.3.MOV

Helpful sources: https://github.com/mxgmn/WaveFunctionCollapse https://github.com/CodingTrain/Wave-Function-Collapse https://www.youtube.com/watch?v=rI_y2GAlQFM

Next steps: Implement some kind of backtracking. The algorithm fails to find possible tiles for some spaces in the grid. Adding more tiles helps remedy this, but a good backtracking method could result in a completely tiled grid each run. Recalculating the entropy (possible tiles & rotations) for the neighbors of neighbors may also help make more forward looking selections that result in less failures down the line.

GitHub

View Github