How would I create a perlin noise terrain generator with biomes?

Hello developers. I am currently looking for a way to create perlin noise terrain generators with biomes that can be really flat or tall, I want it similar to minecraft with random shapes. I searched the internet but couldn’t find any way to implement biomes on roblox. If this is too complicated I just would like to know how to add biomes to a perlin noise terrain generation

Henrik Kniberg (previously a developer for Mojang) explains how Minecraft generates the world after they revamped terrain generation in this video: Reinventing Minecraft world generation by Henrik Kniberg

The explanation of how perlin noise is involved starts about 10 minutes into the video. Essentially they use multiple layers of noise to determine biome attributes (temperature, humidity, and weirdness) and map this to specific biome types. The biome type is then applied to a heightmap generated from additional layers of perlin noise.

Hopefully this gives you some ideas!

2 Likes

You may be able to peak into the Roblox terrian tool to see how it generates biomes.

From a high level, what I believe people generally do, is generate a grid of points, with spacing to be as large as you want the biomes to generally be. Then procedurally wiggle the points with some noise and assign a biome to the points. Then, when generating any location of your map, you find the nearest biome point (can be done by sampling the nearest 9 biome points). The nearest point is the biome that this location is. With this approach, you end up with a map that is a voronoi diagram of random biomes. Blending biomes by interpolation is a little tricky, but can be done.

This approach gives you more control over the frequency of biomes, but may not have the subtle natural feel that you get from determining biomes from noise fields of environmental factors.

You could create a separate 2d or 3d noise field for biomes. I was able to do it with my terrain generation (however my world size was limited to 128x128.)

Ex:

1 Like

Sorry for the late reply, but how would I assign the individual go voxels their biome based on the 2d map? Also do you have any good settings for the perlin map so it doesn’t have tiny biomes?

I don’t exactly know how’d you do it since your generation is different from mine. My generation is 3d while yours is 2d. But, I think something like this could work (hopefully):

local biomeResolution = 100
local biomeFrequency = 15

local BiomeDensity
local biome = 'Plains'

for x = 1,xSize,1 do
    for z, 1,zSize,1 do
         local xBiome = math.noise(x/biomeResolution,seed) * biomeFrequency
         local xBiome = math.noise(z/biomeResolution,seed) * biomeFrequency

         BiomeDensity = xBiome + zBiome

         if BiomeDensity > 0 then
            biome = 'Plains'

        --- You could add the biome properties here.
         elseif BiomeDensity < 0 then
            biome = 'Forest'

        --- You could add the biome properties here.
         end
    end
end

This might also be flawed since tiny biomes are something that you can’t entirely avoid using perlin noise.

I have tried this before but it give me a sort of repetitive pattern having certain biomes next to each other. Is there any way to get around this?

Look at the video that @East98 posted a link to, above. In that video Henrik talks about how they take the noise values and apply them to splines, and look up tables.

I know it’s a bit late, but how did you manage to make these caves? They’re honestly super cool, and I can’t figure it out!