LerpworksAcademy
On this page

World and levels › Terrain

Terrain from a generator into the engine

Know first: Landscape: terrain from a heightmap, What real land looks like

This flow moves terrain into Unreal step by step, so that meters stay meters. The terrain comes from a generator (Gaea, World Machine and similar programs) or from real elevation data. It is the hands-on companion to the lessons Landscape: terrain from a heightmap and What real land looks like, which explain how a heightmap works. This page gives the numbers: which one goes where, and how to check that it is right.

Goal

Before: a heightmap file and an empty level. After: a landscape whose side, heights and zero match the plan, and a ruler confirms it. The example throughout is a 4 × 4 km world with a height range of 600 m and 2017 vertices per side. Swap in your own numbers.

You enter these numbers by hand because the file cannot hold them. A paper map without a scale bar and a legend is almost useless: you can see where the mountains are, but not how many kilometers away they are or how high. A heightmap file is that kind of map, with the legend torn off. A 16-bit PNG or r16 holds only the numbers from 0 to 65,535, one per vertex. The generator knows how many meters a pixel covers and how many meters white means, but that never reaches the file. So this flow is about the legend. You write it down before the export. At import, you enter it in Unreal: the scale bar becomes Scale X and Y, the height legend becomes Scale Z, and the zero mark becomes Location Z.

Try it

The dashed line is a cross-section of the land as it was designed in the generator: 4 km across, from 0 to 600 m. The filled shape is how it stands in Unreal with these settings. The sliders start at the Unreal defaults: the world is half as wide, and half of the land has sunk below zero. Move the three sliders and see what each one does to the section: X and Y stretch it sideways, Z stretches it upward, and Location Z lifts the whole thing. Then press “From the legend”. The picture exaggerates the heights; otherwise mountains on a 4 km world would look like a flat line.


Further in the article

  1. What you need to start
  2. Steps
  3. If the numbers don’t match
  4. Checklist
  5. Theory
  6. Sources and further reading
  7. Test yourself