April 2, 2018


I've been playing D&D for only a few years now, but I've always been a mapper at heart. In fact, part of the reason I was drawn to DMing is the kind of control I have over the cartography. I'm also a sucker for realism; the standard medieval countryside of many D&D settings doesn't  appeal to me.

Even all that wouldn't have gotten me to where I am today. My very first campaign saw my PCs in a tiny village in the badlands of a fading empire, on the shores of a wide sea, which existed to provide a port-of-call for ships carrying valuable spices and wine across the ocean and push them on down the coast towards the capital. So I got to thinking: how far is this trade route? How does that affect the prices of those goods? Is it even worth the trip? (No, as it turns out.)

I wasn't satisfied. To make things worse, D&D 5e, with its emphasis on simplicity (good in many ways) provided no help whatsoever in thinking about consistent production of goods, and supply and demand. Sure, I could say "wine is 2x more expensive here" but that wasn't good enough. I'm an engineer by training, and a data cruncher for fun, so that didn't cut it for me. To be honest, there are very few places where 5e is in fact consistent.

Then I found Alexis. His trade system was exactly what I'd been looking for! He'd based his  detailed system (and gorgeous maps) on a fascimile of the real world. Regardless, I was hooked. I began thinking about how to install this system for my own world. Even better, if I could make it flexible, able to accept any inputs, that'd be perfect. I know enough Python to be dangerous, so I threw together a few generator functions and started plugging away.

...Only to find that Maxwell had followed nearly the same path, with much prettier results. I wasn't discouraged - after all, one size might not fit all, and I have much to learn from this convergent evolution. But that body of work also sparked some of my own dormant ideas.

I'd continued to work on my maps, both because I love doing them and because a knowledge of local and global terrain was necessary to build the table of trade routes. But I still wasn't very happy. It was so much work, and I'm very impatient. Alexis has had the benefit of many years to build his system...I wanted it all and I wanted it now.

But what if I could automatically generate many of these resources? What if I gave my program a map, and it produced the tables I needed? Not only which resources could be found where, but the distances between them? There was no end to the data I could generate from that. And from data, comes stories. I wanted detail, informed by reality, of what sorts of things happened in a given area.

So I started researching.

There's been a lot of work done on procedural generation for stuff like this, a lot of very good work. But the systems I've looked at are never exactly what I wanted. Many systems use Voronoi polygons - I wanted to stick to hexes. Voronoi polygons look good and make pretty terrain, but they aren't immediately gameable like a hex is (at least to me). The other problem is that most procedural generation is either random or starts from a seed. I want the ability to make things that don't make procedural sense. The world doesn't always make sense - sometimes rivers DO split (this is very rare, though). Sometimes cities pop up in odd or unfavorable places. Real life is dirty, and the infinite number of choices available in the growth of terrain and civilization means that a pure procedural world will have too many smooth edges.

Also, I'm not that good of a coder.

So I decided that I'd use an SVG format for my map. I can manipulate the file programmatically (with Python and BeautifulSoup4), and manually (using Inkscape).

From the terrain map, I can generate resources. I can get a list of settlements (and generate new ones) to collect and refine them. I can determine lengths of trade routes. I'm a big fan of decentralization, even at the cost of a little initial speed.

This blog is to be a repository for some of my thoughts and the things I come across in my research. I'm not looking for advice, feedback, or praise, although I won't say no to those.

It's not going to be a quick project. And even though it's not the best or the cleanest, it's mine.


  1. Jack L. Chalker wrote a series of novels about a Well World.... which is itself a whole lot of hexes .... each with part of a world in it. That would be the ultimate Random Generation almost, generate all of that. :)


  2. When I used to play Civilization series in school, I was dissatisfied by the map generation algorithms and (perhaps like many kids) dreamed about developing a better one based on science. I have only read a few blogposts here yet, but already enjoyed it a lot.
    The phrase which motivated me to write this comment was, however, "Voronoi polygons look good and make pretty terrain, but they aren't immediately gameable like a hex is (at least to me)."
    While I used to play Civ III and then IV, I used to think that only square grid is "immediately gameable". After Civ V was released, my mistake became evident. Soon afterwards I went to a uni to study physics, leaving no time to play grand strategies, but a couple of years ago I tried Paradox strategies, and I think they demonstrate convincingly that provinces of arbitrary geometry are as playable as regular ones.

    1. Ultimately it was easier for me to program hexes. That's what I should have said instead of "immediately gameable."

      Thanks for reading!