Warring Empires

I made this thing:

Or you can see it in fullscreen here:
https://www.openprocessing.org/sketch/582274

There are two parts to the program. The first is the terrain, which is based on Perlin noise, but instead of rendering it out pixel by pixel, it is made out of hexagonal tiles:


If they do not look like hexagonal tiles, it is only because the lines of the hexagons have then been deformed. First, the six corners of the hexagon are deformed by Perlin noise. Then midpoints are added to the shape. Now the 12 points are randomly displaced (not with Perlin noise). Then midpoints are added again. Finally, the 24 points are displaced once more, creating the natural-looking shape of the tiles.

Apart from that, it's just the usual Perlin-noise altitude+oceans, and Perlin-noise biomes.

Then there's the other part of the program: Empires. A tile which has a civilisation has a chance every step of the program to spread to one of its six neighbours. If the neigbour is empty, the civilisation is now bigger, or, with a small chance, a new civilisation splinters off into the new tile. If the neighbouring tile has a different civilisation, the two empires compare strengths (which are based on Perlin noise using civilisation index and time as coordinates), and whichever is strongest takes over the other.

There are some extra quirks, like a small chance to jump to a further-away cell, so that islands can be colonized. Big empires also have a chance to break apart in two. But all in all, it's just a basic extra layer to add to the world.

Comments