Search public documentation:
Landscapes can be created in a few different ways. The editing tools provide the ability to create a completely new landscape, import a heightmap created previously in Unreal Editor or through external tools, or convert existing terrains created using the previous terrain system in Unreal Engine 3. Using external tools to create a base to work from can be a good way of speeding up the landscape creation process. That base can then be imported and cleaned up or modified using the editing tools inside Unreal Editor to customize the landscape and make it fit into the world and desired gameplay. Obviously, being able to convert legacy terrains to landscapes makes it possible to salvage existing maps containing terrain and allow them to make use of the new system and tools. This conversion process is fairly painless as it is mostly automatic.
Valid dimensions for Landscape heightmaps are not always immediately obvious when getting started. Being able to determine what dimensions for heightmaps are valid, and beyond that which are optimal, requires a thorough understanding of the underlying architecture of the Landscape. In order to create a system which allows for huge terrains while still being efficient in terms of memory and performance, the architecture implicity applies restrictions on the dimensions of the heightmap, meaning there are certain dimensions which are valid and others which are not. In previous terrain systems in Unreal Engine, there were either no restrictions (i.e., any dimensions were valid and would work) or the restrictions were fairly simple (i.e., only square power of two heightmaps were allowed). The restrictions on heightmaps for Landscapes are much more complex and rigid.
If we start with a component comprised of a single section which contains 64x64 vertices, then the component size is 63x63 quads. Say we have a landscape of 10x10 of these components, then we have 630x630 quads total in our landscape. Now if we wanted to import the heights for such a landscape, we would have to have a heightmap of 631x631 vertices, because there is always one more row of vertices than there are quads (think of a 1x1 quad - it needs 4 vertices). So 631x631 is a valid landscape size.Example 2
If we have a component divided into 4 subsections, each of which is made up of 64x64 vertices. That leads to 63x63 quads per section and 126x126 quads per component. If we have 32x32 of these components, we get 126 * 32 = 4032 quads total in each direction. So the total landscape will be 4033x4033 vertices.These examples focus on square Landscapes. However, you can create Landscapes which are not square. For instance, in the first example the 10x10 is not special. Assuming 63 quads per component, you could have any landscape of AxB components with total size in vertices of (A*63+1 , B*63+1).
|Overall size (vertices)||Quads per section||Sections per component||Component size (quads)||Total Components|
|4033x4033||63||4 (2x2)||126x126||1024 (32x32 components)|
|2017x2017||63||4 (2x2)||126x126||256 (16x16 components)|
|1009x1009||63||4 (2x2)||126x126||64 (8x8 components)|
|1009x1009||63||1||63x63||256 (16x16 components)|
|509x509||127||4 (2x2)||254x254||4 (2x2 components)|
|505x505||63||4 (2x2)||126x126||16 (4x4 components)|
|253x253||63||4 (2x2)||126x126||4 (2x2 components)|
|127x127||63||1||63x63||4 (2x2 components)|
Creating a new landscape from scratch is done through the Create New section of the Landscape Edit window. Expanding this section shows the avilable options: The Heightmap Size section is used in creating new landscapes. Set the Size (vertices) values to the desired dimensions of the landscape. The Component Size properties will be selected automatically based on the dimensions entered. Note: The dimensions must facilitate the creation of components and sections according to the stipulations previously discussed in order to create the new landscape. The total components will be a value other than 0 and the Create Landscape button will be enabled if the values comply. There may be some options to choose from as far as quads per section and sections per component, but be careful in choosing as the number of components can increase dramatically which will have an effect on build times and possibly performance as well. Press the to create the new landscape. When it is finished, the landscape will be visible in the viewport as a flat plane with the default material applied.
Heightmaps, and layers if desired, can be imported into Unreal Editor to create landscapes from. This process is also initiated from the Create New section of the Landscape Edit window. Heightmap Format For heightmaps, the .raw/.r16 is 16-bits per sample, litle-endian, unsigned values, one per vertex, with no header or other data. That is, two bytes per vertex in PC byte order. So for a 127x127 case you'll need 32258 bytes. To save a heightmap from Photoshop, change the image mode to 16-bit grayscale. Then choose the RAW file format and select 1 channel, 16 bits per pixel, and PC byte order. Layer Format For layer alpha maps, you need an 8-bit per pixel, single channel RAW file. Heightmap Import The Heightmap Import section is used to specify the file to import for the heightmap. This file should be either a 16-bit .raw or .r16 file and there are options to specify the format of the data.
- Unsigned/Singed - Sets whether the imported heightmap data is signed or unsigned.
- PC/Mac - Sets the byte order of the imported heightmap data.
For maps containing terrains created using the existing terrain system, Landscape provides a conversion path in the more section of the Landscape Edit window. The conversion process is extremely simple; just press the button and all terrains in the map will be converted. There are certain restrictions that exist when converting existing terrains into Landscape terrains:
Max Component Sizemust be a 1x, 2x, or 3x multiple of one less than a power of 2 (e.g. 1, 2, 3, 6, 7, 9, 14, 15, 21, 30, 45)
Num Patches [X/Y]must be multiples of the
Max Component Size
Max Tessellation Levelmust be set to 1.