More image generation, yay

So! I spent some more time working on my image generator algorithm based on/inspired by the Wave Function Collapse algorithm.
Here’s what I ended up with the last version of my first generator:
wfc4
At that point it was really really slow even with very small input pics (you’ll notice that the output image is smaller to help; the gifs don’t represent the actual generation speeds!)
I decided to re-do the whole thing, this time trying to implement as much as possible in lua. In the end I got it working much, much faster:
wfc5
I implemented some more things after taking that gif, but sadly didn’t make any new compilation gifs. I think this next one is done with a later version (tried to make an input that’d generate roguelike-like areas). Fairly sure I kept improving the algorithm after that, too!
wfc6

Finally, I made some simple roguelike-like map generation using the final iteration of the algorithm! First with a more basic “tunnels, walls (and water for some reason)” pattern:
wfc7

…And then with a more complicated pattern:
wfc8

All in all I’m really happy with how this thing turned out, even though it’s not really a match for the WFC algorithm. I think this could be useful when generating levels, although I think it’d have to be comboed with multiple input images to really work. Maybe first an input image that defines various ‘areas’, then separate inputs for all those area types? I’d like to release the source of this but I think I’ll have to ask ExUtumno who made the WFC algorithm first, since my algorithm is very heavily inspired by it.

2 Comments

  1. Micah says:

    This is super cool! Fun to see all the different iterations.

Leave a Reply

Time limit is exhausted. Please reload the CAPTCHA.