Cuberite Forum
Some semi-random thoughts on terrain generation - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: Some semi-random thoughts on terrain generation (/thread-409.html)



RE: Some semi-random thoughts on terrain generation - xoft - 11-04-2014

I pushed it into the repo anyway, to document my failure and hopefully prevent others from repeating itTongue


RE: Some semi-random thoughts on terrain generation - bearbin - 11-04-2014

I actually quite like it!


RE: Some semi-random thoughts on terrain generation - xoft - 11-04-2014

Have a look at it in the client, you'll soon find it boring. There are no steep hills and no real plains, no variety.


RE: Some semi-random thoughts on terrain generation - tigerw - 11-05-2014

Eh. Why not perfect the current generators?


RE: Some semi-random thoughts on terrain generation - NiLSPACE - 11-05-2014

Because of this Smile


RE: Some semi-random thoughts on terrain generation - xoft - 11-05-2014

And because if I perfected the current generators, I wouldn't have come up with Grown biomes.


RE: Some semi-random thoughts on terrain generation - NiLSPACE - 11-06-2014

About the MinMax generator.

As far as I understand the biomal generator generates a height by creating an average in a 9x9 area around the asked position. How about we give different biomes some kind of priority. I have a feeling this might sound a little vague, so maybe a little code:
const cHeiGenBiomal::sBiomePriorities cHeiGenBiomal::m_BiomePriorities[256] =
{
	/* biOcean             */ { 1 },
	/* biPlains            */ { 1 },
	/* biDesert            */ { 1 },
	/* biExtremeHills      */ { 1 },
	/* biForest            */ { 1 },
	/* biTaiga             */ { 1 },
	/* biSwampland         */ { 1 },
	/* biRiver             */ { 3 },
	/* biNether            */ { 1 },
	/* biEnd               */ { 1 },
	/* biFrozenOcean       */ { 1 },
	/* biFrozenRiver       */ { 3 },
	...
}

int HeightAverage = 0;
int DivideTo      = 0;
for (int x = PosX - 4; x < PosX + 4; x++)
{
	for (int z = PosZ - 4; z < PosZ + 4; z++)
	{
		DivideTo += m_BiomePriorities[GetBiomeAt(x, z)];
		HeightAverage += GenerateHeightAt(x, z) * m_BiomePriorities[GetBiomeAt(x, z)];
	}
}

int FinalHeight = HeightAverage / DivideTo;



RE: Some semi-random thoughts on terrain generation - xoft - 11-06-2014

Or we write a generator that actually doesn't need that special handling. I'm thinking about a minmax-based 3d noise algorithm, it might be able to do the job.


RE: Some semi-random thoughts on terrain generation - xoft - 11-09-2014

[Image: beeea97c622c5614a80371eb0aece7082a3ff1b5...ba5d8f.jpg]

I've rewritten the Noise3D generator and I believe it will be the one Smile

It is now slightly slower, because it uses three 3D and one 2D perlin noises with higher octave count, but I believe it's worth it - it's parametrizable really well:
- One parameter controls the "jaggedness" of the terrain and can range between "plains" and "extreme hills" with quite a fine level of control
- One parameter controls the base height of the terrain. Just enough to make those plateaus high and deserts low.
There are several other tweakable parameters, but those don't need to be touched for the entire range of biomes to be generated.

Now I need your help, guys. The generator is "fixed", in the sense that one set of parameters generates only one "biome style". In order to make the generator adapt to various biomes, I first need to find out what the parameters should be for individual biomes. So I need someone to do the time-consuming job of finding the right parameters for each biome:
0. Set the biome generator to Constant and Height and Composition generators to Noise3D
1. Choose a biome, set it as the ConstantBiome
2. Try guessing a combination of "Noise3DHeightAmplification" and "Noise3DMidPoint" that works well for the biome
3. Generate a terrain using those settings, fly around, have a look if it works
4. If needed, retweak values in 2, delete the world data and go back to 3
5. Post the final values here, preferably with a screenshot

The default parameters of the Noise3D generator are set so that the terrain looks like extreme hills:
[Image: noise3d_hills.jpg]
The values are:
Noise3DHeightAmplification = 0.045
Noise3DMidPoint = 75

I've experimented a bit and found out that the Noise3DHeightAmplification for forest-style biomes should be around 0.2, and for plains-style biomes even a bit higher. So there's your baseline Smile

In the meantime, I'll change the generator to be able to adapt to various biomes.


RE: Some semi-random thoughts on terrain generation - NiLSPACE - 11-10-2014

I guess normal savanna, desert, ice plains and taiga is around the same as plains.