This project does not use any sort of Perlin noise, instead figuring everything out just using tiles and growth. The tiles are a big grid of perturbed hexagons. Through several thousand iterations, random tiles are turned into regions, and then the regions grow by random chance - similar to Organic Voronoi and Warring Empires. Some regions are land, some water - as well as the border of the screen being water. And that's really all there is to it.
Look, if you don't believe me, here's an animation as proof:
If you pay attention, you will also be able to see in the first three frames - the original hexagonal grid, the displaced centres and the new, perturbed hexagonal grid. The interesting thing is that perturbed hexagons look pretty similar to rounded Voronoi cells at an eye's glance. They are much easier to work with, though.
The whole disappearance of black tiles is pretty flashy, but you might notice at the same time that the already settled tiles also change colours, as they blend their colours with their neighbours. Originally, each region had unique colours, making region borders quite clear. You can still see the borders, especially early in the animation, but then they blend out to be more subtle.
How do we get those colours, anyhow? When a new region spawns in, it chooses a terrain colour between arid sands and humid forests, as well as a political colour. The terrain colour steals a bit of the political colour, too, which is how you sometimes get unique-looking terrain colours. Then, as the region grows tile by tile, the colour mutates just the slightest bit. Finally, colour blending as described above gives the water-brushed look.
Some regions are smaller than others. Part of this is random chance, as region growth is pretty chaotic and self-reinforcing - if a region gets an early start, it is likely to keep growing faster. But on top of this, new regions spawn in continously as long as there are still unclaimed tiles. A region that is born at the end of the process will have little opportunity to grow large.
All regions are given a name, the size of which depends on how many tiles are in that specific region. The method of generation is the same as described in the Town Names post a week ago. The towns/cities themselves use almost the same algorithm too, just with a chance of inheriting part of their name from the region they are in. For instance, in Crolebrook above, we have Croleley, Nolebrook, Croleing, Croleness, and, of course, Crolebrook. Despite how it looks, for each part of three parts of the name, there is only a 40% chance of inheritance, giving:
- 21,6% chance of no inheritance
- 43,2% chance of one inheritance
- 28,8% chance of two inheritances
- 6,4% chance of full inheritance
The town names in general are quite wonderful, I love them, just say them out loud with your best British accent.
This project was made in Openprocessing and can thus be found with live demonstration and editable code over at yonder site.
I regret this, though. I much prefer working with data-structures and objects in GML. Perhaps I'll port it over at some point and add some extra flourishes, do some textures and make sure the stupid names don't overlap. My biggest benefit from Openprocessing, apart from it being much easier to set up a new project, is the faster Perlin noise, which I never even used.
Great insights! I never thought about it from this angle before. Thanks for broadening my perspective!
ReplyDeleteworld map eu