UDN
Search public documentation:
CreatingTerrain
日本語訳
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
Interested in the Unreal Engine?
Visit the Unreal Technology site.
Looking for jobs and company info?
Check out the Epic games site.
Questions about support via UDN?
Contact the UDN Staff
Creating Your First Terrain
Document Summary: An introductory document to creating Terrain. Document Changelog: Last updated by Jason Lentz (DemiurgeStudios?) to separate into smaller docs for the 2110 build. Original author was Lode Vandevenne (UdnStaff).Introduction
This document explains how to create a Terrain starting with an empty level. This document assumes that you've never made a Terrain before, but you are familiar with the general UnrealEdInterface and know how to use the Texture Browser, and Actor Browser.Preparing Your Map for Terrain
If you want to have a terrain in your map, you need a very large area to add the terrain. Subtract a very large cube, for example 65536*65536*65536. UnrealEd now supports sizes up to 524288*524288*524288, but I advise against making such a big space. To enable terrain in this cube, it needs to be a TerrainZone. You need a ZoneInfo for this. Open the Actor Class Browser, expand Info and then select ZoneInfo. Place the ZoneInfo close to the center of the cube. If you right click in the center of the 2D overhead view and choose "Add ZoneInfo Here", it should be in the center of the cube automatically. Right click on the ZoneInfo and choose ZoneInfo Properties. In the properties window, expand ZoneInfo and there set bTerrainZone to True. Now the editor knows that this zone will contain terrain. Expand ZoneLight and set AmbientBrightness to 128, this way you will be able to see the terrain when it's built. In the AdditionalTerrainTips document you will learn how to create SunLight which greatly improves the appearance of Terrain in a level. Note that setting the LevelInfo to bTerrainZone doesn't work, you have to use a ZoneInfo. Once you have set this zone to be a TerrainZone, then you can have as many Terrains in the Zone as you want, but if they spill over into another Zone that is not a TerrainZone, those Terrains will not be visible from the Non-TerrainZones. You will probably want to give the sides of the big box a texture now. Make sure it is one that you'll not use for the terrain. This is just to be able to distinguish the terrain and the sides of the box when you just made the terrain later.Your First Terrain
Now you are ready to actually create your Terrain. First, open the Terrain Editing Tools with this button from the left toolbar, and in the window that pops up select the "Terrains" tab if it isn't already selected. This is the Terrain Editor window. From here, press the button on the bottom left of the window and a "New Terrain" window will pop up. The only setting you need to change is the Name field. You could leave it named "TerrainHeightMap" but it's best to make sure that its name is a unique name to prevent the engine from getting confused or overwriting other textures. The rest of the fields can be left as is, although if you do wish to change any fields, here are some guidelines to follow.- Package - When creating your own Package, make sure its name is not the same as any other Texture Package OR an StaticMesh Package. If you do create a new package for this, you will need to load that package every time you open the editor and load your level.
- Group - The Group you assign the HeightMap to is not as crucial and can be named pretty much anything.
- Name - Naming the HeightMap a unique name will help to sort out your Terrain from other Terrains you might create and it also helps prevent it from being overwritten or overwriting other textures in its package.
- XSize & YSize - These values determine the size of the HeightMap only, not the actual Terrain itself. Make sure that these are set to powers of 2. For every pixel of the HeightMap a quad is created in the terrain and the darkness of that pixel determines the height of the terrain.
- Height - A solid grayscale value is assigned to the entire Terrain initially, and this value determines what height that color will represent. It's best to leave this number at 32768 since that is directly in the middle of the spectrum of useable values (exactly 1/2 of 2^16).
The TerrainMap
The TerrainMap of your terrain is a HeightMap that determines where the terrain is high, where it is low or anything between this. It determines the hills, mountains, canyons, valleys, etc. of your terrain. The TerrainMap is a 16-bit texture, but you can also import 8-bit textures in the editor. When you edit the terrain, you have to convert it to 16-bit then. In the texture you use for the TerrainMap, the black color or the first color in the palette represents the lowest parts of the terrain, and the white color or the last color in the palette the highest parts. Most of the times you will want to import 16-bit or 8-bit grayscale textures for the TerrainMap, but it is possible to use any colored 8-bit palletized texture. Theoretically you can use textures up to 2048*2048, but a enabling a texture of this size as TerrainMap takes much longer than rebuilding the lighting of a very large map. Most of the times textures with dimensions 256*256 will do fine. As you already know a TerrainMap was automatically created by the Terrain Editing Tools, and you can see it in the Texture Browser in the MyLevel package, with the Group and Name you gave it. Whenever you paint using the Paint Tool (described in the EditingTerrainMaps Doc) on the TerrainMap, this texture will be updated. Examples: This texture, fading linearly from black to white, will create a mountain with a peak. The texture is created with a brush with hardness 0 in PSP. This texture, created with a brush with hardness 50, makes a more flat mountain: If there is no fading in your texture, the faces of the mountain will be vertical: Textures like this create very thin peaks, so it looks like grass -although definitely not a good way to create grass: What you really want are complicated HeightMap textures, like this one:Adding a Texture
Your Terrain will now need a texture to display on the geometry created by the TerrainMap. Open the Texture Browser and select the texture you want to use for your terrain, for example grass or mud. Go back to the Terrain Editing window and this time select the Layers tab. Once in the Layers tab, select the top most empty layer and press the button on the right side of the window to create a new layer. Just as with the TerrainMap, the only field you will really want to change is the Name field. Also, just as with the TerrainMap, you will want to follow the guidelines listed below:- Package - This should probably be named the same package as the TerrainMap you created earlier since when you want to use one of these textures, you will most likely want to be using the other.
- Group - The Group you assign the HeightMap to is not as crucial and can be named pretty much anything.
- Name - As mentioned above, it is best to give your textures a unique name to prevent the engine from texture overwriting.
- AlphaHeight & AlphaWidth - It is very important to make sure that these values match the dimensions of the texture you are using. Otherwise, the texture may only appear as spots on a regular grid.
- AlphaFill - This determines the transparency of this texture over the layers above it in the Layers stack. The default setting of [0] should work fine (assuming you are using the 2110 build).
- ColorFill - This setting is ignore. In earlier versions of the engine, this could create a color on the Terrain.
- UScale & VScale - These affect the scale of the texture map as it is applied to the Terrain. If you don't get it to look quite right the first time, don't worry. You will be able to easily edit later so that it is an acceptable scale.