Procedurally Generating Random Medieval Cities

With procedural content generation, you build data algorithmically rather than manually — think Minecraft worlds, replete with all the terrains and mobs you’d expect, but distributed differently for every seed. A lot of games use algorithms similarly to generate appropriate treasure and monsters based on the level of the character.

Game developer [Oleg Dolya] built a random city generator that creates excellently tangled maps. You select what size you want, and the application does the rest, filling in each ward with random buildings. The software also determines the purpose of each ward, so the slum doesn’t have a bunch of huge mansions, but instead sports a tangle of tiny huts. [Oleg] shows a little of how the application works, using polygons created with the guard towers serving as vertices. You can learn more about the project on Reddit.

As new as this project is, it’s limited. All the maps feature a walled community, each has one castle within a bailey, and none of the cities includes a river or ocean port. [Oleg] designed it to make cool-looking maps, not necessarily accurate or historically realistic ones. That said, he’s already tweaked the code to reduce the number of triangular buildings. Next up, he wants to generate shanty towns outside the city walls.

17 thoughts on “Procedurally Generating Random Medieval Cities

  1. IRC there are some arcade games that didn’t have enough memory to store game levels. They just ran the level number through an algorithm that generated the level each time.

        1. All I know is that in the old days most cities/large towns were build around a river or stream or if need be a canal, for you need access to water and waterways to run a city.
          Which makes me wonder how many of those cities listed to be without river also have no canals.

          (On a related note, and probably no coincidence, I noticed once when looking at a map of ISIL territory that all their occupied places where next to rivers too. And i wonder if that’s how they might get supplies also, and I wonder if those fighting them thought about that. Maybe they need Vietnam-era style swift boats.)

  2. I wrote a city generator a decade or two ago in C (console app) that builds a complete procedurally generated city, assigning professions to each building, filling them with objects and NPCs (and creating all the details about the NPCs). Only thing I never got around to was generating maps for it. It’ll handle cities in various types of surroundings, including rivers, oceans, foothills, deserts, and vary the chance of building type for each locale. Always meant to write a GUI for it and actually generate layouts.

    1. Your statement was probably referring to cities where, for layout purposes (if nothing else) round buildings are wasteful. Yurts and other similar round structures were incredibly common in rural areas/societies.

Leave a Reply to notarealemailCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.