Fantasy Map Creator

Posted on by
Fantasy Map Creator

These are some notes on how I generate the maps for my Twitter bot, which is based on a generator I originally produced during. There's JavaScript code for the generator on Github, and the original messy Python generator code can be seen. You may also be interested in this, which describes the placename generation. Inspiration 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.

The fantasy world generator requires approximately 45 seconds to create and draw a world map, 4000 pixels wide and comprising over 19,000 hexes. Updated January 3, 2018. Fantasy Map Generator.

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. There are a few different stages to the generator.

First we build up a height-map of the terrain, and do things like routing water flow over the surface. Then we can render the 'physical' portion of the map. Finally we can place cities and 'regions' on the map, and place their labels. Grids To represent the heightmap, first we need a grid of points. Although it can be simpler to work on a regular square grid, I much prefer to work on an irregular set of points for something like this. With a regular grid, it's very easy to run into weird artifacts, and you often have to do a lot of postprocessing to hide the effects of the grid.

If you use an irregular grid, then there are a few things which are more complicated, but the structure of the grid helps to give the map a rough, organic feel, and you never have to worry about nasty linear artifacts in the finished product. The approach I use is the same as in, which is one of the better references out there on how to do non-fractal terrain generation. I won't go into too much detail here because that article explains it very clearly, with lots of diagrams. I start by selecting points at random within the map. These points tend to be a bit clumpy and uneven, so I use to improve the point set. For speed, I only use one iteration of this process, but you can repeat it as many times as you like.

There are rapidly diminishing returns after a few iterations though. All of the calculations are actually carried out on the 'dual points' of the original point set, which correspond to the corners of the Voronoi polygons. This has the advantage that the number of neighbours per node is fixed at three, which helps in some parts of the code. Note: this shows 256 (2 8) points, to make viewing easier, but the real generator uses 16,384 (2 14) points. I have a programmer's superstitions about always using powers of 2, which are more pleasing to the spirit of the machine.

Rough outlines One of the difficulties of creating landscapes in a realistic way is that real landscapes aren't created all at once. Instead, they evolve from earlier landscapes, which in turn evolved from even earlier landscapes, and so on back for billions of years. There's no good way to simulate this process in a reasonable amount of time, so we need to cheat slightly. Rather than an infinite regress of older landscapes, I start with a simple 'proto-landscape', built with geometric primitives. This lets me control the broad outlines of the terrain, while leaving the details for the more physical processes to fill in later.

Note: the black line indicates the zero contour, which we treat as 'sea level'. Also, this map uses 4,096 (2 12) points, for speed.

Erosion The results of this process can be a little bit on the blobby side, which means they rarely look good on their own. We want to scuff them up a bit, so they look more like real landscapes. We do this by applying an erosion operation. In most of the world, by far the largest influence on the shape of landforms is fluvial (water-based) erosion.

Water flows downhill, carrying sediment along with it, carving out valleys and river basins. This is a massively complex phenomenon, and modelling it correctly is a very active research area, but we can get a long way by sketching a simple version of the process. We need to start by tracing the routes that water would take over the grid. For each grid point, we say that water flows to its lowest neighbour, and so on down until we reach the edge of the map. This gives a map of water flow. There's an obvious problem when we reach gridpoints which are lower than all of their neighbours. Do we route the water back uphill? Quarkxpress 10 Validation Code Crack on this page.