Adventures in Wave-Function Collapse 1: Super-Tiles
Recently, I have been spending a lot of time trying to implement the Wave Function Collapse algorithm to generate tilemaps. I think Robert Heaton does a great job of explaining what the algorithm is, but I still needed to figure out a lot when implementing it with tilemaps. This post is the first in a set to document for my future self some of what I learned, so I don't fall into the same traps when I inevitably return to it further down the road. Tiles in bitmap version → super-tiles in tilemap version An individual tilemap tile is equivalent to a pixel, so super-tiles are collections these tilemap tiles The significance of the size of the super-tiles wasn't clear to me until I tried out different sizes. The super-tiles I used were square, but in the discussion here I only consider a single dimension to try and make things clearer. (I also ignore the fact that when the super-tiles are produced, they are usually allowed to wrap from one edge of the template to...