Solved Problem with smooth biome transition(WorldGenerating)

Discussion in 'Spigot Plugin Development' started by szaros123, Dec 8, 2018.

  1. Hi everyone! I am writing my own custom worldgenerator plugin which is going well.

    But unfortunately i got stuck when it comes to different biomes , i have two biome BiomeA(SANDSTONE) which is more hilly than BiomeB(STONE) which is flat, like plains. They use same noise(simplex) but with different settings. The problem is when they connect there is a rough transition between them , and i want to make it smooth. How can i make the connection more smooth, more natural?

    Here how it looks like.
    And how it should look like.(Just a picture from minecraft).

    Thanks for any advice.
  2. md_5

    Administrator Developer

    I think you should try stacking noise rather than having multiple discrete noise generators.

    e.g. the sand would be simplex 1, then the stone would be simplex 1 + 2.

    Terrain gen is black magic to me anyway
    • Agree Agree x 1
  3. Well a i tried , got the same result, maybe got worse


    If anyone has an idea. here is my code.

    Code (Java):
    for (int x=0; x  < 16;  x++){
                for (int z = 0; z < 16; z++) {
                    double noise =  90;
                    int nx =CHUNKX*16+x;
                    int nz =CHUNKZ*16+z;
                    double worley_biome_noise = BiomeSchemeNoise.GetNoise(nx,nz);
                    double simplexnoise = SimplexNoise_LOW.GetNoise(nx,nz)*8;
                    double simplexnoise_high = SimplexNoise_HIGH.GetNoise(nx,nz)*32;

                    if (worley_biome_noise > 0.3) { //Cellular noise biome selection
                        noise = noise + simplexnoise + simplexnoise_high;
                        for (int y = 0; y < noise; y++) {
                    else {
                        noise = noise + simplexnoise ;
                        for (int y =  0; y < noise; y++) {

  4. I am no expert in noise generation, but it is possible that a simple blending technique can fix the issues you have. It won't be perfect, but it will probably do the job.
  5. I have a solution to this, but it involves having gradual shifts between biomes instead of sharp changes.

    The only real solution without rewriting your generator would be to average the height settings for a given column. Sample the biomes surrounding it, add them together, divide them by the number of samples, for example.
  6. Thanks for the help guys , finally managed to fix the problem , i used linear interpolation(lerp).

    Here is the result.
    #8 szaros123, Dec 13, 2018
    Last edited: Dec 13, 2018
    • Like Like x 1
  7. praise the lerp

    You will likely end up using interpolation for a lot of other things. Trilinear is essential for undersampling 3D noise, otherwise it cripples performance. The vanilla generator undersamples 1:128, one block per 4x4x8 area. A well-made generator could do 4x4x4 or 2x2x4 without issue, or use different sampling for maps of different importance.
  8. looks awesome congrats dude = )

Share This Page