r/truegamedev • u/DV-Gen • Apr 13 '22
Using Wavefunction Collapse for Procedural Terrain
https://www.youtube.com/watch?v=20KHNA9jTsE
57
Upvotes
r/truegamedev • u/DV-Gen • Apr 13 '22
3
u/DV-Gen Apr 13 '22
Hi everyone. I've done all the voxel terrain methods. They are really great, but I wanted to try something different. This video is on using wave function collapse for 3D tile-based terrain, and how I got there from voxel terrain. It is a fun approach. I'm happy to chat about it here or on YouTube.
2
u/ralusek Apr 13 '22
One of the benefits of the smooth noise functions for generating terrain (Perlin/Simplex etc) is that it's infinitely parallelizable. You can give a place in space (x, y, z) and get a value back. This lets terrain be generated by the GPU or at least multiple cores. It also lets you spawn anywhere out in space and instantly be able to start the terrain generation from wherever you are, while knowing that it will correctly meet up with anywhere else you choose to go to/have come from.
Correct me if I'm wrong, but it seems as though this solution relies on generating terrain contingent on a starting position, and is generated outward from there. Unless I'm misunderstanding that, it seems as though all of the benefits of the standard noise functions would be lost.
2
u/GeorgeMcCrate Apr 13 '22
This looks very interesting. I'm still not sure how to generate the map in my game. I am currently using Perlin noise but I don't like how it doesn't really allow me to set up rules for different types of terrain. For example, it's great for mountains and lakes but not for rivers. I am considering trying to find a way to somehow add additional things like rivers on top of the Perlin noise but your method looks promising, too. I might give that a try.
2
u/1stmatequackquack Apr 22 '22
This is really cool, especially the application to 3D! Earlier this week, I watched a talk on Wave Function Collapse (WFC) from GDC 2019, and I'm pleasantly surprised to see more WFC content. I'm looking forward to your follow-up video!
P.S. In case anyone is interested, here's the video I'm talking about:
Tile-Based Map Generation using Wave Function Collapse in 'Caves of Qud'
https://youtu.be/AdCgi9E90jw
1
u/log_2 Apr 13 '22
At https://www.youtube.com/watch?v=20KHNA9jTsE&t=575s you say "You can't do this in marching cubes", which is a strange comment. Marching cubes (MC) and wavefunction collapse (WFC) solve different problems. WFC builds a map by randomly sampling a layout, and MC determines how a mesh is to be generated from some fixed map layout.
1
u/Shin-DigginSheist Jun 26 '22
Could you theoretically use this method to generate something like, say, an interactive cloud/weather system?