Last week, I shared a video with a friend of mine that explained the Wave Function Collapse and that got me  excited about procgen again! So I thought I'd go back into exploring WFC with the help of Daniel Shiffman's video linked above ✨

This is sort of a brute force approach to that; essentially a walker that fills neighbours and backtracks, so it does run into a bunch of dead ends and endless recursions  so there are fail safes to stop that. Apart from that, it is slow as you will soon see. With the colourful tileset, you should keep the grid size small; but the other white and grey tileset should work fine even at 30x30.

Key Action  
 [SPACE]  Start/Re-Start generation.
[ESC]   Opens the help text.
[UP] [DOWN]  Increase grid dimension up or down.
[LEFT] [RIGHT]  Change tile set between two tile sets. 
 [G] Toggle grid. 
 [S] Save a screenshot 

This was done over a weekend and I hope I can go back and look at how others have done and hopefully re-attempt it in a better way. Aside from that, I'm super glad that I did this, and I really love all things proc-gen! I hope I get some time explore the overlapping model and more!! Wish me luck 🌸

I was in the middle of yet-another-weekend project in GMS, and that was why I ended up writing this in GMS and not JS or in Unity.  

Also, the second tile-set (or rather the first one you will see) was inspired by the tiles in Oskar Stalberg's WFC demo.

Leave a comment

Log in with itch.io to leave a comment.