Firaxis and 2K Games are working on a Civilization 7 update that revamps the game’s map generation, while adding a couple of city states and rounding out Napoleon’s skillset. It’s slated to land sometime in the week of September 29th. Why am I writing about it right now? Because senior graphics engineer Ken Pruiksma has just posted a little blog about the intricacies of strategy game map generation that caused Beethoven’s Ode To Joy to play tinnily in my head.
This is almost certainly a reflection of emotional diarrhea brought on by minor insomnia brought on by a nagging foot injury. Still, there’s something… uplifting about the motions of plate tectonics as approximated by computer code. Perhaps you, kind stranger, will be similarly moved.
“When Civilization VII first shipped, the map generation technique we used focused on ensuring balanced play while following some new gameplay rules around things like Deep Ocean and Distant Lands,” Pruiksma explains on the game’s official site. “This technique, which has its roots in previous Civ games, created fair maps, but also made them predictable.”
That predictability led to complaints of repetitiveness during Civ 7’s exploration phase. Players are also unhappy about “the straight-edged coastlines that could occur between the two major halves” of each map, as Pruiksma goes on. Firaxis are trying to address that in update 1.2.5 with two new map types – “Continents and Islands (two large continents, with islands) and Pangea and Islands (one large continent, with islands)”. Both these map types use Voronoi diagrams to grow their landmasses, rather than fractal noise.
Being a clueless humanities grad, I won’t try to explain Voronoi diagrams – the Wikipedia page calls them “a partition of a plane into regions close to each of a given set of objects”. I’m not qualified to walk you through “fractal noise”, either, other than to theatrically repeat that it “sounds like a waterfall”. Thankfully, Pruiksma jumps straight to explaining the impact of these unsettling math demons on Civilization map generation.
Fractal noise, he notes, “works really well when it can be applied uniformly to the whole map. That said, it can be hard to steer towards specific gameplay needs. Voronoi diagrams, on the other hand, give us structure we can build rules on top of, so maps can stay organic while still meeting the gameplay requirements of Civ VII.”
Now, here’s the walkthrough of how the new generator operates that had me hallucinating Beethoven. If you’re not into Beethoven, maybe play this track from Gorillaz album Demon Days.
- Randomly spray a bunch of points onto the map. The more points we spray, the higher the resolution. We’ll start low res.
- Draw lines around each point dividing them into “cells.” You end up with something that looks a bit like cracked glass.
- Select some starting cells. These are the seeds of tectonic plates in the game map, similar to the tectonic plates that form our Earth.
- Each plate grows, one cell at a time, following some configurable rules, until the whole map is filled. Each plate gets a rotation and movement direction. This is your map’s crust, and will be used to help influence the growth of continents later.
- Now spray many more dots for a higher resolution version! Draw those lines again to get another shattered-glass look sitting on top of your tectonic plates.
- Choose some new starting points for the primary landmasses, and grow them once again following a custom set of configurable rules. These rules can do things like influence landmasses to grow along plate boundaries (especially if they’re colliding), avoid the poles, and prefer certain latitudes, just to name a few. This is also where we can apply gameplay-based restrictions, like ensuring Homelands and Distant Lands are separated by a Deep Ocean.
- Based on the map’s settings, we then grow islands, erode the coastline, add mountains and volcanoes, and perform other finishing touches. Many of these steps involve the same set of generic rules used earlier to determine where features are placed.
- Once finished, we overlay the hex grid and then hand the map off to the gameplay layer to determine tile types, Yields, Resources, starting location, and more.
Wonderful! I think it’s wonderful? I wish devs posted this stuff more often. Ah, remember when “generation” used to be a happy, magic word, rather than the harbinger of cost-cutting.
We’ve only got his word for it, but Pruiksma says that the new Voronoi-derived maps appear “far more varied and look much more natural”, with oddities or “impossible” features appearing more regularly, such as chains of islands between Homelands and Distant Lands.
The tuning of the new generator is designed to produce “natural-feeling maps with standard gameplay” about “95% of the time”, he comments, so every 1 in 20 games you might encounter something totally bizarre. If you’re concerned about broken terrain, especially in multiplayer games, you’ll still be able to play the old map types and generation processes after update 1.2.5.
Do you have a favourite map or terrain generator in a game of any genre? I have fond memories of certain pre-acquisition eras of Minecraft, when the invisible sandworms hired by Mojang to sculpt the geography would produce huge surface-level caves and giddy rock bridges a couple of pickaxe swings away from being floating islands.
Also yes, regulars who know who they are – this is your cue to once again recommend Civilization 5’s Vox Populi mod as a vastly superior alternative to Civilization 7, which continues to divide players. I’m not avoiding writing about that mod, I’m just short of time. I never have enough time!