r/truegamedev • • Apr 13 '22

Using Wavefunction Collapse for Procedural Terrain

https://www.youtube.com/watch?v=20KHNA9jTsE
61 Upvotes

15 comments sorted by

View all comments

Show parent comment

1

u/DV-Gen Apr 13 '22

Thanks. If you have some nice terrain noise, what about running a hydraulic erosion simulation over it? It can shape the terrain, and also tell you where water should go. I've really liked that approach.

I've had some good luck and not good luck with flow of rivers with wave function collapse. It can be tricky to balance the tiles just right. Sometimes wave function collapse will come up with a correct solution, but not one that you want. I think Oscar Stålberg did a lot of work in Bad North to discard and regenerate islands that were correct, but not playable in the way he wanted. Long term, I may have some other method, like a height map, telling wave function collapse things like the overall height of terrain, and approximately where to place water. I think layered generation from multiple algorithms can be really powerful.

2

u/GeorgeMcCrate Apr 14 '22

The way I wanted to handle rivers was pretty much the way you described it. But I also want caves and ruins of buildings and that’s where wave function collapse will probably be a lot more useful. I’m also thinking that maybe in the end it will be a combination of multiple algorithms. For example a Perlin for landscape, then erosion simulation for rivers and then WFC for ruins and caves.

1

u/DV-Gen Apr 14 '22

I think WFC would be especially good for ruins and other artificial structures.