Biome Generation - Voronoi Noise
So, it's time to talk biome generation.
In a procedurally generated world, there's plenty of different ways to pick out which biomes should appear where, but in a world of individual hexes things are just a touch more complicated.
You could have each hex roll the dice and pick a random biome, but then every other hex would be a completely different biome and none of them would be grouped together.
You could tie biome to certain world coordinates, but then the same biomes would always be in the same place (and you could still end up with random biomes every other hex, depending on how it's handled).
You could have each hex influence the hexes around themselves, but how do you control which direction takes priority? If you don't control that then biomes in an area would change depending on the direction you travelled in.
So what's a good way to have procedurally generated biomes that can be consistent in one run, but different on a new run?
I ended up going with a Voronoi Diagram map.
What's a Voronoi Diagram?
Well:
-Take a square, for example, and choose a number of random points on that square. These are 'seed points'
-For every other point on the squares surface, decide which 'seed point' it is closest to. These are part of the 'Voronoi cell' of that 'seed point'
-Colour code each cell so that you can easily tell them apart
Now you have a Voronoi Diagram.
This produces a random, but rather natural looking pattern.
It can be used to produce interesting textures, even resembling things we might be familiar with, such as
The spots of a giraffe:
or cobblestone paths:
It can even be used in 3D, to quickly generate random and procedural destruction and fracture of materials:
In the case of this game, we want the diagram to be used to decide where different biomes are in the world generation.
So, how would we achieve that?
Simple enough, we take a square we choose a number of random points on that square, organise everything into Voronoi cells, and then colour code them according to the relevant biome.
Looking at the above biome maps, you might even be able to guess which biomes are represented by which colours.
From there, each biome can be tweaked to have a certain chance of being included in a given biome map, and a certain amount of 'size' to be taken up.
For example, you might notice that pink only shows up in two of those maps, and only takes up a small amount of space.
Meanwhile, light green shows up in all of them, and can clump into large patches, like in the middle of the centre square.
The game then takes these maps and compares the world coordinates of a hex to the pixels on the maps. Each hex is a part of whichever biome it falls under on the map.
Using this, it's possible to control how common, or rare, a certain biome is as well as how big it is compared to other biomes.
And that's how biome generation works here.
Hope that was fun, and that you learned something new and interesting!
until next time!
Get What, Once, was Here?
What, Once, was Here?
Explore and uncover the history of a lost civilisation while managing your supplies
Status | In development |
Author | DimlightGames |
Genre | Adventure |
Tags | 3D, Exploration, Indie, Isometric, Low-poly, Mystery, Roguelite, Singleplayer, Unity |
Languages | English |
More posts
- Update 0.9.3 - Events, Compass, and Skybox16 days ago
- Slow week23 days ago
- Dark Fantasy Studios - Music30 days ago
- Synty Studios - 3D assets37 days ago
- Future Biomes44 days ago
- World Generation - The Beginning, and Now51 days ago
- Rewrite - sneak peak58 days ago
- Hello, World!65 days ago
Leave a comment
Log in with itch.io to leave a comment.