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.

Keyboard controls are faster if you are on a desktop, but if you click and drag anywhere in the game, you get a radial menu with all the same commands listed below.

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.

More


Credits for External Resources

Mechanical Plastic Click 09 by SmallConfusion -- https://freesound.org/s/751087/ -- License: Attribution 4.0

Menu Selection.wav by morganpurkis -- https://freesound.org/s/376614/ -- License: Creative Commons 0

wind draft loop 3 by nsstudios -- https://freesound.org/s/651545/ -- License: Attribution 4.0

Download

Download NowName your own price

Click download now to get access to the following files:

wfc_exp_win_yadu_1.0.0.8.zip 3.1 MB

Leave a comment

Log in with itch.io to leave a comment.