I found this twitter bot https://twitter.com/unchartedatlas posting maps that look like they came from a pulp fantasy novel.

enter image description here

Any idea on how they are done?


3 Answers 3


Fortunately the author, Martin O'Leary, has posted rather detailed walkthrough of the algorithm of how the maps are generated here: http://mewo2.com/notes/terrain/ as well as how the names were created here: http://mewo2.com/notes/naming-language/.

A brief summary of the algorithm covered by Martin O'Leary’s post:

  • Grid: Create a height map with a grid of random points. Random points doesn’t look naturalistic so apply an iteration of Lloyd’s algorithm to the corners of the Voronoi polygons.

  • Rough Outline: Apply a set of sequence of primitives (constant slope, cones, blobs) and operations (normalize, round hills, average local height, set sea level) can be varied to produce different kinds of landscape, such as coastlines, islands and mountain ranges.

  • Erosion: Apply a constant flow of water over the entire map and use Planchon-Darboux algorithm to fill in the depressions. Calculate water flux to get rivers.

  • Render terrain: Coastline is where the height map crosses zero. Rivers based on the water flux and some smoothing of the points. Apply shading to slope.

  • Cities and borders: Place city near river and penalize nearness to other cities and to edge of map. Mark out region based on distance, slope, water flux, and shorelines.

This is a rough summary of Martin O'Leary's post. I really recommend reading the post as the author does go into detail about the programmatic terrain generation and the post itself has interactive elements.

Similarly the author the post on the linguistic aspect of how the place names were generated also has interactive elements.

The terrain map project is open sourced on github here: https://github.com/mewo2/terrain

The naming project is open sourced on github here:


  • 2
    $\begingroup$ Another detailed article on programmatic map generation: www-cs-students.stanford.edu/~amitp/game-programming/… $\endgroup$ Aug 10, 2016 at 18:50
  • $\begingroup$ Links rot. Would you care to describe the process inside the post instead? $\endgroup$
    – Mast
    Aug 10, 2016 at 19:42
  • $\begingroup$ @Mast what is in those links would be a very very very very long answer that is still lacking... $\endgroup$
    – Durakken
    Aug 10, 2016 at 19:48
  • 1
    $\begingroup$ The main flaw with those programs is that they don't map a full world and putting it together would be extremely tough. I really wish someone made one of those that worked on a global scale, but that's unlikely because how tough it is to get such stuff to work correctly. $\endgroup$
    – Durakken
    Aug 10, 2016 at 19:50
  • $\begingroup$ @Mast I agree on the link rot but if you actually looked at the post it is (a) long and (b) interactive. I suspect that the each of references within the post alone would merit its own discussion, i.e. just the Grid section speaks of Lloyd relaxation and Voronoi polygons. The author is directed to a technical audience but as he does provide the code and his thought process, I thought it would be at least a reference appropriate for this site. $\endgroup$ Aug 10, 2016 at 19:50

The creator's website is pretty well documented on how they did it.

  • $\begingroup$ (This was brought up in chat, and we encouraged OP to answer his own question as it's a useful resource, and it seemed the best way to document it for the community.) $\endgroup$
    – Ranger
    Aug 10, 2016 at 18:00

There's also a wonderful fantasy map generator at: https://donjon.bin.sh/fantasy/world/

Also, a more scientific world map generator at the same site - https://donjon.bin.sh/scifi/world/ & also a complete stellar system generator: https://donjon.bin.sh/scifi/system/


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .