| Home Page | Recent Changes | Preferences

Creating A Terrain

This page is one of a sequence of Mapping Lessons.


This tutorial shows you how to quickly make a terrain in UnrealEd 3. This applies to the retail version of UT2003; other games' editors may be different versions of UnrealEd in which the tools don't all work, eg U2.

There is full reference for UnrealEd's terrain tools at Terrain Mode.

Preliminaries

We need a suitable zone to hold the terrain.

The World Space

If you don't already have some open space in your map for the terrain, create a room. If this is your first terrain, we recommend a large space: a box 8192x8192x8192 UU in size should do. But bear in mind that terrains can be scaled as big or as small as you want (and you can also have as many as you want). A terrain could be a small area of a map within architecture, such as a sandy courtyard, or the basic world space, such as with a large outdoor level.

Zone

Next add an Actor >> Info >> ZoneInfo if you don't already have one. This sets properties for this zone; and in particular we're going to use it to tell the engine that you want to render terrain in this zone.

Now set the following properties of the ZoneInfo actor:

  • ZoneInfo → bTerrainZone = True
  • In a very large space, we recommend Display → DrawScale = 8 or 12 or something so you can see the actor easily

You'll need to rebuild your map for the ZoneInfo to be tied to the zone it sits in.

Making the Terrain

There are two methods here.

  1. you can create from scratch in UnrealEd and use the internal tools to raise hills and drop valleys. This is the simplest and quickest method.
  2. or you can make a heightmap texture in an external graphics application, and import it. With this method, you'll be able to edit in UnrealEd later anyway.

From Scratch

This method adds a TerrainInfo actor for you automatically, and also creates a new heightmap texture for you.

  1. go into Terrain mode
  2. Select the "Tools" tab at the tob of the floating Terrain Editing Window, then the "Terrains" tab below that
  3. Click on the "new terrain" icon (it just looks like a blank page at the very foot of the tab area)
  4. This pops up a New Terrain window. Set:
    • package: the package in which to store the new heightmap texture. Use MyLevel to embed it within you map
    • group: whatever you like
    • name: this will be the name of the heightmap texture
    • the other options should be fine as they are
  5. Click OK

Now go into wireframe view. The TerrainInfo actor has been added for you and the terrain is ready for painting. because the TerrainInfo has been added at the camera position, you'll need to move the camera about to see the terrain: it currently should look like a very big wireframe grid. You'll probably need to move up and look down to see it.

You also may want to position the actor so the terrain it generates lines up with your subtracted space: do Actor Context Menu → Reset → Move to Origin. If you're working elsewhere in your map, set the TerrainInfo's Advanced → bEdSShouldSnap and position it on-grid yourself.

Now skip ahead to the next section.

From a Heightmap Texture

This is a more complicated procedure.

The terrain map is a basic height map – an 8 bit grayscale image where white is interpreted as the highest point, and black is the lowest point.

Build your terrain map in a program such as Adobe Photoshop, or a terrain-generating program such as TerraGen. Personally, I like to create a 50% gray terrain map and build all the terrain with the terrain tools in UnrealEd.

No matter how you do it, the terrain map needs to be saved as an 8-bit grayscale BMP file.

When you're ready, Import the texture and set:

  • package: MyLevel to embed the texture within the level
  • Un-check the "Generate MipMaps" checkbox
  • give the texture a logical name you will remember!

You now need to add an Actor >> Info >> TerrainInfo to your map. This will later hold all the settings for the terrain: textures, heighmaps, etc.

After adding it I do Actor Context Menu → Reset → Move to Origin. This will ensure that when the terrain is scaled up it meets the walls of the subtracted cube exactly.

 

Now you need to set the greyscale texture we imported to be used as the terrain's heightmap.

Set the resource property TerrainInfo → TerrainMap to the terrain texture you just imported. (Select your texture in the texture browser, then click the Use button on the TerrainMap property.)

Once you've done this it's a good idea to rebuild the level & save it. Once you've rebuilt the level (both Geometry and BSP) you'll be able to see the terrain in the 3D UnrealEd viewport when it's in Wireframe mode.

To be able to edit the terrain height later within UnrealEd, you need to convert the heightmap texture to 16-bit greyscale. To do this, in the Terrain Mode window, go to the "Terrains" tab and right-click the block for your terrain in the list, and select "convert to G16" from the pop-up menu.

Setting some basic options

You now have a wireframe terrain and a TerrainInfo actor. It will only be visible in wireframe mode.

[tutorial-terrain-10-Flat-Terrain-Wireframe]

This is as far as this tutorial goes. The next major thing to do will be to add a terrain texture layer. But before that, there's a few things we can quickly do.

Quick Height Painting

Just to make it a little bit more interesting, let's raise a few hills.

  1. Go into terrain mode
  2. select the Painting Tool in the list on the left of the window
  3. in the 3D wireframe UnrealEd Viewport, your cursor will show a red dot in the middle of two yellow circles when it is on the terrain. Do:
    • CTRL-left mouse to raise the terrain in that area
    • CTRL-right mouse to lower it

Scaling the Terrain

Like everything in UT, you can scale your terrain in 3 dimensions. The default TerrainScale is 64 in each axis. This converts to world units by multiplying the scale by the size, in pixels, of the TerrainMap texture.

Because the texture we used was 256x256 pixels, this means that the size of our terrain is currently 64 x 256 in each direction, or 16384. Since the world space we subtracted was only 8192 in each direction, the terrain is twice the size of the world space.

In fact, there's nothing wrong with that – it won't cause any problems. And at some point you might find out you want to expand the level, so you've got plenty of room for expansion. But if you want to make the terrain fit exactly the 8192 unit large box it's in, then change the scale to 32 in the X and Y axes. You can use the Z axis scale to control how high the terrain is. The Z axis scaling also limits how high the terrain can be. I.e. it sets a maximum height. If you reach that height and find you want something to go higher, you'll need to set the Z scale larger. Of course, that will rescale everything else, so you should think about that in advance.

Moving on

  • to actually see your terrain in other than wireframe, you need to add a layer: see Terrain Texture Layer
  • you'll also want to light your terrain later. Terrains are affected by ambient lighting and normal lights, so you can use those as you would anywhere else in a map. However, if your map is going to be an outdoor level you'll want to use a Sunlight, which produces much more realistic outdoor lighting:

Next Lessons:

Note: in UT2003 you can't add Sunlight to your map unless it is in a SkyBox. Current build users should proceed directly to the second link first.


Related Topics


Category Mapping
Category Tutorial

The Unreal Engine Documentation Site

Wiki Community

Topic Categories

Image Uploads

Random Page

Recent Changes

Offline Wiki

Unreal Engine

Console Commands

Terminology

Mapping Topics

Mapping Lessons

UnrealEd Interface

Questions&Answers

Scripting Topics

Scripting Lessons

Making Mods

Class Tree

Questions&Answers

Modeling Topics

Questions&Answers

Log In