clock menu more-arrow no yes mobile

Filed under:

This Twitter bot uses erosion science to create a new fantasy world every hour

All the maps you ever needed, plus the code that made them

Courtesy @UnchartedAtlas

Pop quiz: how many elaborately detailed, scientifically generated topographical maps have you created in the last day or so? Chances are the answer is "none," unless you're writing or publishing a series of old-school fantasy novels. Those kinds of novels were the inspiration for glaciologist Martin O'Leary, who created a Twitter bot named @UnchartedAtlas that generates a new map every hour, complete with cities, mountains, rivers, valleys, country borders, and other features. As O'Leary says in his public notes on the terrain generator:

I wanted to make maps that look like something you'd find at the back of one of the cheap paperback fantasy novels of my youth. I always had a fascination with these imagined worlds, which were often much more interesting than whatever luke-warm sub-Tolkien tale they were attached to.

At the same time, I wanted to play with terrain generation with a physical basis. There are loads of articles on the internet which describe terrain generation, and they almost all use some variation on a fractal noise approach, either directly (by adding layers of noise functions), or indirectly (e.g. through midpoint displacement). These methods produce lots of fine detail, but the large-scale structure always looks a bit off. Features are attached in random ways, with no thought to the processes which form landscapes. I wanted to try something a little bit different.

The bot has been cranking out made-up countries since February 2016, but National Geographic has a recent interview with O'Leary that provides a fascinating new peek behind the scenes. He initially created the bot for National Novel Generation Month, a NaNoWriMo spinoff focused on creating algorithms in an attempt to generate coherent text. O'Leary instead spent a month creating an algorithm to generate continents, coastlines, and place names. The bot starts with random data points, then uses a progressive system to stream virtual water from those points, eroding drainage channels through the landscapes, and softening the edges of the coasts. It's all based in actual geological science, which makes his maps look more realistic and believable. His notes on language generation are just as fascinating and elaborate, and they come with plenty of illustrative tools to make the process clear.

O'Leary's personal pages aren't just a guide to how his mapmaker works, they're an open invitation to examine and tweak his code and do your own thing with his project. So if you've ever wanted to build worlds of your own — or just generate a ton of maps for your own Game Of Thrones-style epic fantasy series — here's your chance.