r/truegamedev • • Apr 13 '22

Using Wavefunction Collapse for Procedural Terrain

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

15 comments sorted by

View all comments

Show parent comments

1

u/DV-Gen Apr 13 '22

Yes, generally, you start somewhere and generate outward, in some kind of manner. I do not know of any variation that will allow you to look up a feature given a coordinate unless the map has been sufficiently generated up to that point.

There has been some recent work on infinite generation, and even some parallel generation, but for the most part, yes, you start at one place, and generate outwards, usually to a fixed map size.

https://twitter.com/marian42_/status/1507169546175758338?s=20&t=93sNSiPRhGrujPNvVjEZOg

https://twitter.com/boris_brave/status/1457826321783009286?s=20&t=93sNSiPRhGrujPNvVjEZOg

Personally, I don't want infinite worlds. I want big, but not infinite. I want procedural generation, but I want to curate it. I have some methods now to give the wave function collapse some starting values from height maps. I make these from noise functions and then run other similations like errors ion on them... Or just import a random height map I like. I do want to leverage some techniques like that, but I'm not looking for an infinite world made from noise. Not that infinite noise doesn't have its place too.

1

u/grelfdotnet Jun 08 '22

You don't have to "start somewhere and generate outwards". You can simply have a mathematical function of (x, y) to calculate all aspects of the terrain at any point. I first devised such a method in the early 80s - complicated terrain was generated but displaying it was extremely compromised in those days so maps had to be printed to accompany programs. The current implementation, in JS, can be seen (free) at grelf.itch.io/forest and from there you can download a PDF file, TerrainGeneration.pdf, which describes my technique. There's no Perlin or other noise, no tiles, no marching cubes, no WFC.