In our previous experiment we found out that just walking around and picking tiles and invalidating neighbours weren't enough and the Daniel Shiffman video and the Oskar Stålberg wave demo does allude to what we should have been doing, which was to invalidate and collapse neighbours and their neighbours and so on (or so I think) - like solving a sudoku puzzle - the more stable information there is about a cell - in case our starting cell, the more clarity we have about what our neighbours are and their neighbours et al.  (Aside: maybe I should try making a sudoku solver 🫠) 

So this experiment is a result of that revelation which in a way did happen half way through the last project and I didn't want to jump on to this before finishing that. 

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]  or [LMB]  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 
 [R] In case things slow to a crawl in a weird way, use this to restart the game!

So what did we learn?

  • One of the tiles we added later to the project had almost no choices to the left of it that it caused so much resetting for something valid to come out. So we removed it. 
  • You will notice now that the colourful tiles even if they are the same number (20 tile types), is much faster when compared to the grey and white path/pipe like tiles. This is because the more choices you have for a tile type, the more recursions it needs to resolve each tile type. Comparatively, each tile in the colourful set has less matches with other tiles, making the choices fewer once a tile is picked.
  • I remember watching this talk by Oskar Stålberg, titled Beyond Townscapers  at Sweden Game Arena where he talks about his experiments with WFC based proc-gen, limitations of a tile based approach. He goes on to demonstrate a dual grid based system which requires less tiles, which is great.
  • I also had seen jess::codes on YouTubetalk about an alternate approach to creating auto tiling tile-sets with fewer tiles! Which also quotes Oskar's talk above as well as another one (which I'm yet to check out). 
  • Less tiles are great, so we'll see how we can get around to doing that!
  • As for other next steps, there is another GDC 2025 video on Tile-Based Map Generation using Wave Function Collapse in 'Caves of Qud' that I want to check out. Aside from that, add a slightly modified version of this project that lets you pick and choose tiles you want to set in a cell. Beyond that, see how we can practically implement this in a usable way in some sort of a game like situation 🙈

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_2.zip 3.1 MB

Leave a comment

Log in with itch.io to leave a comment.