



The day-to-day details of the realm are abstracted away, in other words, almost completely. He does not order them about on the field or even decide which part of York to control. Tactics have no place in war: the player can order his armies about in a mass, but only with enough fidelity to send a ten thousand men to York. The Super Huge, Detailed Map of the Warhammer Old World The world has much more detail than I could readily use as a player, and the user interface is overwhelmingly complex. One of my long-term goals was to build a completely procedural game, a la Minecraftbut with a deep story. I still have some work to do to color the polygons as the CKII engine demands, but this is a good start. Each polygon will be a county for our random CKII map. Given those points, we can make a Voronoi diagramshowing the plane divided into polygons in such a fashion that each polygon contains those points which are closer to a given seed than to any other. One such person calls himself BenDiand he saved me the trouble of implementing an algorithm to compute Voronoi diagrams myself. One of the greatest things about being alive in the 21st century is that other people provide source code on the internet for free. With that second seed, some of the empires are just single kingdoms. Those are pretty big empires, and surprisingly regular. If the seed county is a water county, we force any neighboring land counties to choose the nearest land county instead. Generating Duchies is accomplished by randomly selecting between and counties as seeds, then iterating over all the counties on the map, computing the nearest duchy seed, and assigning the county to the appropriate duchy. Now we have an array of corner points, each of which is associated with a seed point. I ended up iterating over each seed point, then iterating over all the edges and creating an array of edges for each seed, then sorting the endpoints of those edges to give us an array of points that we can actually use to draw the polygons.

First, I needed to build data structures for the polygons themselves - this is kind of a roundabout task, since each edge tracks its left and right seed and its two vertices.
