Continents, States, Towns, Tiles


For a while now, I have wanted to do a truly large-scale terrain generation method. Isle Terrain ended up looking like a single island, Country Terrains had terrible-looking continents, and even Cozy Kingdoms ended up being closer to Cozy Counties than anything. Finally, this method does large-scale structures much better than anything small.



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:


I know it looks like I simply am removing the black spots to reveal already-existing terrain, but that's not the case at all. The black tiles are filled with the terrain of a random neighbouring tile - and if no neighbouring tile is filled in, there's a chance to become the origin of a new region. And that's really all.

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.


I also worked on drawing the political borders of the region, but could not quite get the desired effect. At the end, I disabled the function entirely because the image was already busy enough with region and town names.

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.

Comments