Algorithm to generate biomes

Hello there,
What is a good way in generating biomes? I’m making a hex based game and when I generate the map I want to generate certain hexes depending on the biome. Ideally I would love to generate a simple int grid array.
(where 0 - Grass, 1 - Water, 2 - Snow, 3 - Desert)

0-3-3-0-0-0
0-3-3-0-0
0-0-3-3-0-0
0-0-3-0-0
2-0-0-0-1-0
2-0-0-1-1
2-2-0-0-1-1

So I could then use this information to generate a full grid and have something like this at the end:

Are there any algorithms that I could use that would help me to achieve this type of result? Thank you

I am not sure about the algorithm, other than a for loop and instantiating the correct tile or game object depending on the bioma type. You could use a enum to define the types of biomas and then cast the enum to int to get its numeric value, you can see how to do it here:

Hey, I want to make this procedural, so I could generate a random map and get different layouts every time. I use a for loop to create a grid, but I need an algorithm that would help me to determine which tiles needs to be created to get something like in the image.

A standard way to create biomes (and there are tons of great tuorials around) is to first define the general type of biome (e.g. arid, arctic, temparate and tropic). The type defines how to assign a trrain type by “height”.
for arid you could go (desert sand, desert rocky, mountainous), for teperate (water, grass, forest, snow) and for tropic perhaps (water, desert (beach), forest, rocky)

To get an organic feel to this, then generate the ‘height’ values with a suitable perlin noise function and you are 99% set.

1 Like

Hey there! Thanks for the reply. So I managed to create a hex grid, based on the generated noise map and when generating a grid based on the noise value I instantiated a certain hex block.

But the thing is that I want to generate more like a region map, this solution really doesn’t have that much control. What if I want to only in grass biome have another biome, which could be like a forest biome. And same for other biomes. Some specific things that can only be generated in the certain ragions. Like rivers, mountains, lava pools and ect.

Also using a noise map will generate biomes in a way that some will never be close to one another, let’s say a grass biome and a dirt biome. Where grass biome height is higher that a dirt biome height and dirt biome height is lower than a desert biome height. That way grass and dirt will always be separated by the desert.Which is not really interesting.

Hey man!!! I’ve just found this videon in YT:

He did the algorithm like in this article:
http://mc-server.xoft.cz/docs/Generator.html#preface

Hope it helps!!!

1 Like