Posts

Showing posts from April, 2021

Adventures in Wave-Function Collapse 1: Super-Tiles

Image
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 the other.
  Last Month's Projects Following my emerging pattern, it is well into April but here's my attempt at a round-up.   Physical make: Tiny OpenWRT -based server.  Nothing material has happened on this one.  I have done some research into the different packages available for OpenWRT (there are loads ).  I'll probably want to switch from mercurial to git if I want to have an internet-visible source-control server without compiling my own package.  The tiny machine might even have enough grunt for a Nextcloud instance, so long as it's a really small number of users. Coding make: I never even started coding for the Dungeon Crawler Jam .  I decided to try and implement Wave Function Collapse in the latest Gotm.io jam so I could get to grips with it.  Turns out WFC is far from trivial if you want a guaranteed solution in a reasonable time.  I spent so much time working on it that I failed to enter for either jam. However, I do have a working solution in Godot's GDScr