I have a terrain generation system where there are currently two biomes: mountain biome and flat biome
Changing from the mountain biome to the flat biome can look unnatural because the flat biome cuts through the middle of a mountain in the mountain biome.
The code I use to generate a tile:
function getTile(x,y,chunk)
local xNoise = chunk.x * noiseFactor + (x/divFactor)
local yNoise = chunk.y * noiseFactor + (y/divFactor)
local xNoiseBiome = biomeSeedOffset + xNoise/divFactorBiome
local yNoiseBiome = biomeSeedOffset + yNoise/divFactorBiome
local noiseValBiome = math.noise(xNoiseBiome, yNoiseBiome, seedValue)+1
local noiseVal = math.noise(xNoise, yNoise, seedValue)+1
--biome change test
if noiseValBiome < 1 then
setBiome("innerHills")
else
setBiome("grassyPlains")
end
local transform = biome.transform(noiseVal, biomeInfo)
--tile object
return {
height = flatten(transform[1]),
color = transform[2],
specialGeneration = transform[3],
}
end