Some semi-random thoughts on terrain generation
And now I've got beaches:
[Image: grown_biomes_02.png]
Reply
Thanks given by: NiLSPACE , Seadragon91 , sphinxc0re
Cool!
Reply
Thanks given by:
Is it possible to not always have beaches since vanilla Minecraft doesn't have beaches everywhere either.
Reply
Thanks given by:
It is possible to define which biome gets a beach when next to ocean, and which does not. It should be possible to add some randomness to it, too.
Reply
Thanks given by:
Progress report. Mainly concentrated on beaches and rivers. Note that the screenshot is now at 25% resolution.
[Image: grown_biomes_03.png]
Reply
Thanks given by: NiLSPACE , Seadragon91 , sphinxc0re
That's awesomeBig Grin I can't wait to try this Smile
Reply
Thanks given by:
Go ahead, it's in the repo.
I'm only trying this with QtBiomeVisualiser, and I have a feeling that the rivers will be too narrow again.
Reply
Thanks given by: NiLSPACE
Trust me, you don't want to read the code, it's a mixture of templates that is both awesome and awful at the same time.
Reply
Thanks given by:
One thing I noticed is that the biomes are quite big. Is it possible to reduce the size of them a little?

The rivers are a little to narrow as you said, but not by much:
[Image: 506c894f2c.jpg]
Reply
Thanks given by:
I've added a second implementation of the generator, GrownProt, which is exactly the same, but the code is probably easier to understand and it's really easy to play with it, chain the generators in a different way and see what that creates. The downside is that this easier code is less performant (I measured some 15 % loss, with a crude timer), so once I find a good chain for the int generators, I'll rewrite it back into the original version. I might keep the prototyping code in, if there's an interest.

For those of you who'd like to poke around: Probably the biggest surprise is how the generator achieves such random yet compact shapes. This comes mostly from one single thing - the Zoom class. It zooms the generated array by a factor of 2, but instead of using nearest-neighbor, or some form of bilinear interpolation, it uses a simple "random neighbor" decision. So in order to generate an N * N square of values, it first lets the underlying generator generate (N / 2 + 2) * (N / 2 + 2) square of values, and then for each square of 3 * 3 neighbors, sets the corners to the original values, the 4 values along the edges to a random one of the adjacent corner values, and the center value to a random one of the four corner values. That's it, that's the complete magic.
The rest of the methods just provide some smart biome selection, first deciding about where to put groups such as oceans, hot biomes, temperate biomes, cold biomes and mountainous biomes, zooming a few times to randomize the shapes, then choosing random biomes for each of the biome groups, again zooming a few times. By now the biomes are mostly formed, so the final steps are to do an edge-detection on the ocean-side, this creates beaches; zooming for the final time makes the beaches somewhat larger.
Reply
Thanks given by:




Users browsing this thread: 2 Guest(s)