Aaaand applied. I am yet to decide whether I want to allow completely free areas or work a bit more to make sure they are at least approximately equal, but that’s small.

Aaaand applied. I am yet to decide whether I want to allow completely free areas or work a bit more to make sure they are at least approximately equal, but that’s small.

So yeah, what was I thinking! I really did think my flooding mechanism did well for the biomes, until I tried it on the full scale map. Whereupon it was observed it did not do well!
So… voronoi then. 30-ish lines of code for a guaranteed quality. What’s not to like?
Here’s the test:

Aaand we have biomes!
In this case they have only a visual role. The objects that the environment is constructed of have types and those are what is functionally important. I need the biomes, however, to mark different sections of the map differently. The players needs to be able to look at their minimap and determine that they are not in the same type of terrain.
The approach I took was to select points on the map that are generally far away from each other, then flood the area around each one. Of course, steady flood would mean straight lines between the biomes, so I had to think of a randomness.

I used random ‘height’. There is no height in the game, but the concept for randomization is height and I needed a visual distinction between the tiles while devving, so…
The idea is that in each iteration of the flood a tile is evaluated.
Each non-marked neighbour is marked for checking (pretty standard).
The check of the tile itself is a comparison of the height of the tile against a pre-set threshold. If the tile is low enough – it is marked with the color of the biome. If not – it is lowered by an amount and added back to the collection of ‘to be checked’ tiles.
And if you do it for each biome in turn, each with its own flood – it works!
We’ll see how it will break when I add it to the main scene 🙂