Wave Function Collapse Level Generator

This is probably the most challenging project I’ve tackled. I was inspired by Oskar StÃ¥lberg’s work using the techniques from @ExUtumno‘s project (github.com/mxgmn/WaveFunctionCollapse). I wondered, could I do this too? As soon as I started, I was hooked. About 80% of the work was pipeline related. It would be prohibitively tedious to complete this project without things like “auto edge detection” and easy export/import + tile validation scripts. I ended up with about 60 tiles, built in Maya. The Ambient Occlusion is also a clever technique from Oskar StÃ¥lberg. It uses inside/outside data from the tiles to create a 3d texture.

My implementation includes backtracking, so if the algorithm hits a dead end it efficiently backs up to a valid state and continues down a new route. It also has “multi tiles”, which are set pieces that take up multiple tile spaces.

In the future, I want add the ability for the algorithm to solve in large spaces, even infinite spaces. I would do this by breaking the world into chunks, then solve each chunk using it’s neighbors edge data.

Leave a Reply

Your email address will not be published. Required fields are marked *