r/truegamedev • u/DV-Gen • Apr 13 '22
Using Wavefunction Collapse for Procedural Terrain
https://www.youtube.com/watch?v=20KHNA9jTsE
61
Upvotes
r/truegamedev • u/DV-Gen • Apr 13 '22
View all comments
Show parent comment
2
u/NotADamsel Apr 13 '22
You are correct about the benefits of noise-based gen, but I think that you’re misunderstanding the WFC algo and what it’s suited for. It’s true that it is a slower algo then noise-based gen, but the trade off is in flexibility. With noise-based gen, for each kind of thing you want to generate you need to write the code that takes the raw numeric inputs and converts them to whatever feature you’re looking for. This can be fast for the reasons you mention, but for an indie dev it creates a hard limit on what they can have in the world. Conversely, because WFC basically just picks tiles to place on the map based on what’s next to them and what examples are given in the input, all you need for a new kind of feature is a new input example. This means that a clever dev can cut development time drastically with the algo, and/or can hand generation off to a level designer who just needs to edit the example tilemap. You’ll still run into a limit when it comes to how big your generated stuff can be, but you can combine noise gen and WFC by using noise for a few big things like overall map layout, and then fill in the world with towns, buildings, roads, dungeons, etc etc etc created using WFC.
(I made a js version of the WFC algo for text. It’s not optimized, but it works and my examples demonstrate what I’m talking about. https://zaphodious.com/wfctext/)