Skip to content
Tool for procedural terrain design and generation.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Tripping archer is a tool for procedural terrain design and generation. It has been my university final project and I decided to release it on BSD license to the world, maybe someone will find it useful.

Input file, generated texture and 3D render of the terrain.

It's quite different from other heightmap sculpting editors as it needs a 2D top down sketch of the terrain (left) which it then processes and turns into a heightmap (middle), also generating a simple texture for it (right).

3D preview of textured heightmap.

Here's a little video showing what it does:

It can currently generate 3 types of terrain features: mountains, rivers and volcanoes.

Features overview

  • Simple and quick to use - provide a top down sketch of the desired terrain and the system will generate heightmap and a texture for it (texture configurations can be read from files).
  • Generated terrain features exactly match shapes and position on the sketch (that was one of the main objectives of the project).
  • Easy to integrate - there are only two dependencies: cml for maths and CImg for saving images, both included with the source.
  • Modular and easy to extend - terrain features are generated by application of sequences of "heightmap processors". Nothing stops you from changing or tweaking parameters of existing processors or adding your own.


Tripping archer is a command line utility. Windows and Linux binaries are in bin folder and they accept the following arguments:

  • -i [path] - input path to a sketch
  • -o [path] - output path for generated heightmap
  • -c [path] - texture output path (optional)
  • -r [path] - render configuration file path (optional)
  • -t [type] - terrain type, from 1 (gentle hills) to 3 (high mountains) (optional, default 3)
  • -v - use Voronoi diagrams to partition the mountains (default off)
  • -s - render shadows (default off)
  • -e - enable thermal erosion (default off)

Example call:

./tripping-archer -i input.png -o output.png -c color.png -r alps.cfg t 2 -v -s

Important - the input file has to be an image with black background where mountains are marked with red (i.e. #ff0000), rivers with green (#00ff00) and volcanoes with blue (#0000ff). If you are using tools like Photoshop to draw a sketch don't use anti-aliased brushes.

Texture configuration

You can example ones in bin/files. The first line is light direction vector. Next lines are stops for the gradient used to colour the heightmap. First value is always position of a stop (ranging from -1.0 to 1.0 i.e. from deep ocean floor to high mountains) followed by 3 RGB values in range 0 to 255.


Project uses cmake. You can also use the scripts provided for build which also run a simple test. They all are in build folder (bat for Windows and sh for Linux, mingw32-make required on Windows).

Extending the system

As said before, feel free to experiment with the source. The whole system is organized into heightmap processors which represent one particular action to be performed on the heightmap. These include:

  • Fractal noise - fills the heightmap with fractal noise (like noise Photoshop filter)
  • Hydraulic erosion
  • Thermal erosion
  • Particle depositor - forms hills and other landforms by dropping particles on the heightmap, which then roll down the slopes
  • Perturbation filter

Some of the processors make use of set of points which are used to bound the area the processor operates on. For instance, to create mountain ridges their skeletons are calculated using Brownian trees which in turn are used as drop points for particle deposition. Simpler example of use of particle deposition to create a volcano:

CParticleDeposition depositionFilter;
depositionFilter.setParameters(particlesHeight, 8, 5); // Sets single particle height, elevation threshold and  search radius
depositionFilter.setBoundingPoints(&boundingPoints); // Limit the area where the drop point can move
depositionFilter.setMode(MOVING); // Set drop point mode to moving
depositionFilter.setVentCenter(ventCenter); // Set the starting point for the drop point
depositionFilter.setParticlesCount(totalParticles); // Total number of particles to drop
depositionFilter.apply(&heightmap); // Do it!

What particular bits do should be clear from the source code and comments. Ayway, take a look at main.cpp to see how all of these filters are used to achieve different landforms.

More samples

Mountains generated with Voronoi cells:

Mountains generated with Voronoi cells.

Same mountains with thermal erosion (a lot of it):

Same mountains with thermal erosion (a lot of it).

Different colour scheme:

Different colour scheme.


  • Post issues and problems if found. There's probably loads of them as the thing hasn't been properly polished. Let me know if you find it useful.

  • If someone wants to add a Mac OS build I'd be obliged.

  • CImg makes use of external libraries (such is Graphicmagick) to process pngs, jpgs etc. By default it only supports bmp files so if you want any other formats and are getting errors about unrecognized formats ("Failed to recognize format of file.") then install Graphicmagick.

  • Excellent resources I came across while building this were especially this: and also a book called "Texture & Modeling - A Procedural Approach".

The end.

You can’t perform that action at this time.