10-25-2014, 07:08 PM
And now I've got beaches:
Some semi-random thoughts on terrain generation
|
10-25-2014, 07:08 PM
And now I've got beaches:
Thanks given by: NiLSPACE , Seadragon91 , sphinxc0re
10-25-2014, 07:34 PM
Cool!
10-25-2014, 08:04 PM
Is it possible to not always have beaches since vanilla Minecraft doesn't have beaches everywhere either.
10-26-2014, 03:29 AM
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.
10-27-2014, 04:06 AM
Progress report. Mainly concentrated on beaches and rivers. Note that the screenshot is now at 25% resolution.
Thanks given by: NiLSPACE , Seadragon91 , sphinxc0re
10-27-2014, 04:29 AM
That's awesome I can't wait to try this
10-27-2014, 05:02 AM
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. Thanks given by: NiLSPACE
10-27-2014, 05:05 AM
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.
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:
10-31-2014, 01:36 AM
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. |
« Next Oldest | Next Newest »
|