fantasy-bot-map.jpgpinterest
Martin O'Leary

Is the task of coming up with all those names for regions and cities preventing you from writing that epic fantasy trilogy? Well you're in luck, because there is a Twitter bot that generates thousands of fantasy novel-style maps.

xView full post on X

Created by glaciologist Martin O'Leary of Swansea University in Wales, the map-generating bot creates fictitious landscapes complete with place names and tweets them out every hour from the account @unchartedatlas. The Outer 'el Sle Lowlands, the Tusxi Mountains, and the Western Diocese of Tanutpul are just a few of the endless worlds O'Leary's program has created.

O'Leary came up with the idea for his cartography bot while participating in National Novel Generating Month, or NaNoGenMo. The event is the programmer's version of National Novel Writing Month, which challenges writers to pen a 50,000-word novel within the month of November. NaNoGenMo, alternatively, challenges coders to write a program that can generate a 50,000-word novel. O'Leary wanted a computer-generated map to go along with his computer-generated story.

The glaciologist was frustrated with existing map-generating programs, which do a pretty good job imitating the texture of real landscapes but fail to realistically place natural features such as rivers and canyons, because they are randomly generated rather than forming according to real-world geology. "It works well on the small scale, and if you're not paying attention," O'Leary told National Geographic. "If you look at it as someone who understands where valleys come from, it doesn't make any sense. Valleys just start and disappear, and you have no sense of how the landscape connects to itself."

So O'Leary wrote a program that first generates a grid of dots and builds landscape around them, like other map generators, but then simulates heavy rains that create natural features as a result of simulated erosion. The process is repeated multiple times, with water flowing to lower regions of the map to create realistic valleys and lakes and islands—features you could find in the real world.

When it's time to add the pieces of human civilization, the program identifies factors that make a spot a realistic place for a city or town, placing human settlements near water, away from cliffs, and a certain distance away from other cities. After initially placing the towns, the program scans the map again to move them if they violate one of the placement parameters. It then draws territory boundaries that extend out into the landscape, stopping when they encounter natural barriers like rivers and mountains.

For each map, the program labels landscapes and cities using a language generator that names everything with a similar etymological structure. For example, in the map below, the Inner Diocese of Low Hut-Mut, each place name uses a hyphenated structure that seems like it stems from a common language. The labels are also placed in locations that do not obstruct the features of the map itself, as if written in by a real cartographer.

O'Leary has his program available on his website for anyone to create a map, and the source code is also available on GitHub so you can add new features such as forest generation or snowfall. Or you can create new skins to generate maps with unique visual designs. The map generator was part of O'Leary's NaNoGenMo project, so he didn't have time to add everything he wanted before the deadline at the end of November. He tells National Geographic that he "really wanted to get some volcanism in there... to produce volcanoes and craters and lava flows and things."

Thanks to O'Leary, you don't need to be a cartographer to create beautiful maps of fantasy worlds, and you don'd need to be a philologist like Tolkien to create cohesive place names for the fictional realms. I'm already imagining the hardships one would encounter crossing the the Qampig Marches and the battle tactics a general could employ in the Mountains of Enommoterk.

Source: National Geographic

Headshot of Jay Bennett
Jay Bennett
Associate Editor


Jay Bennett is the associate editor of PopularMechanics.com. He has also written for Smithsonian, Popular Science and Outside Magazine.