Creating a New Level

Overview

The following tutorial will show how to set up a new level and its initial terrain map.
Terrain elevation in CRYENGINE Sandbox is based on brightness values of a height map textures assigned to the terrain geometry.

Creating a New Level Folder and File

Warning

Do not use spaces or non-Alphanumeric characters in your level name. Underscores can be used instead of spaces. Example: my_level instead of my level

On the File menu, click New:

In the New Level dialog box enter a name for the level in the Level Name text box. You should adjust the Heightmap Resolution and the Meters Per Unit (or, Meters Per Pixel) according to the size and and detail level required for your level.

It is not recommended to have a total terrain size greater than 4096x4096. Using lower Meters Per Unit will give more precision in the terrain details, lowering heightmap resolution will decrease memory consumption.

The Terrain Size (listed below the two drop down menus) is simply a multiplication of the Heightmap Resolution and Meters Per Unit. Click OK to create your new level.

When you click OK, a new subfolder within the 'Levels' directory is created. It uses the name provided under 'Level Name' and contains various files. The most important file in that directory is the *.cry file, which contains all the main information that is required by the Editor.

Adding Terrain to the Level

Generating a Terrain

Now, there is a new empty level, filled with water and terrain underneath it. You will probably need some terrain to walk on and there are three main ways to do that - You can sculpt in manually, import a heightmap or have Sandbox automatically generate a heightmap.

To create terrain, on the Terrain menu, click Edit Terrain:

This opens the Terrain Editor:

Next, on the Tools menu, click Generate Terrain:

This will display the Generation dialog box, where you can influence the appearance of the terrain by using the following parameters:

Parameter

Description

Feature Size

Determines the amount of land created.

Bumpiness/Noise

Determines the degree of bumpiness or deformation of the surface.

Detail

Determines the number of times that effects will be applied.

Variation

Determines the random seeding of the islands.

Blurring

Sets the number of times that smoothing will be applied to the noise filter.

Cover (Exp. Substract)

Deprecated

Sharpness (Exp. Base)

Determines the sharpness of the surface.

Sharpness (Freq. Step)

Determines the number of times that the sharpness filter will be used on the surface.

The default settings are good, so click OK. After the generation has been completed, you should see something similar to this:

The terrain will be in gray, which resembles the height of the terrain. The brighter the terrain, the higher it is. The blue water texture indicates that the terrain in that area is below sea level (user definable), giving you a correct impression of the actual land masses.

On older versions of CryENGINE, to get a first impression with a default texture applied, you need to regenerate the surface texture of the terrain. Since CryENGINE 3.4 however, terrain textures are generated upon level creation so this will have already been done.

Now, close the Terrain window and you will be able to see the changes in the perspective view.

Generating Surface Texture

On the File menu, click Generate surface texture:

The Generate Terrain Texture dialog box will be displayed. Default settings are usually OK. A description of the options can be found below.

Click OK and wait until the calculation has been completed.

High Quality
  • It uses more different code for texture compression.
  • Terrain texture generation will take 2-3 more time but there will be less compression artifacts.
  • It does not affect memory usage or CPU in final game.
Calculate Terrain Sky Accessibility
  • It will export additional textures containing ambient occlusion information and normals.
  • In final game if e_TerrainAo is non-zero it will darken terrain and objects depending on terrain and vegetation around. Additionally terrain normals will be more detailed at distance, so lighting will look more detailed.
  • In final game it will cause little more intensive texture streaming, but should not increase memory usage.
Terrain Color Multiplier

When the generated surface texture is compressed using DXT, its colors always get somewhat distorted. If the colors use the full dynamic range (0-255), they are preserved better. If artists know that they have used only darker colors in the level, they can use the Terrain Color Multiplier to make the colors use more of the dynamic range. For example, if only colors in the 0-63 range have been used, enter a multiplier of 4 to make them fill the entire 0-255 range and 'survive' the compression in better shape. When rendering, the decompressed color values should be divided by the multiplier in the shader to restore the original brightness.

In short, if your colors are artifacting, increase the color multiplier to compensate for the compression.

Pre-generated

1x Color Multiplier

4x Color Multiplier

When painting terrain, the information is temporarily stored by the engine, which adds to DP/drawcall count. Depending on how much painting has been done, this can reach well into the thousands.
When you generate the terrain textures, the engine bakes the color information down into textures (stored in the terraintexture.pak file) which then frees up the temporary storage, and thus, the DP.

Results

The view should now look similar to this, showing you a first impression of the landscape.

You will now be able to jump into the game mode by holding down Ctrl and pressing G, and you can run around in the new creation.

Things to experiment with:

  • Change the parameters when creating the terrain.
  • Change the resolution of the created surface texture, to either speed up the calculation, or to increase the quality.
  • Manually sculpt terrain with the terrain brush tools.

Terrain Editor Reference

This section has information on the Terrain Editor's menus and toolbar.

ToolBar

Parameter

Description

Open/Import Heightmap

This opens up the browser to search for a valid heightmap to import.

Clear

This option will delete the current heightmap data.

Resize

This option will resize the current heightmap data.

Invert

Changes black to white and white to black.

Noise

Adds irregular noise across your entire heightmap.

Smooth

Smooths hard edges across the entire terrain.

Generate Terrain

See above what Generate Terrain does.

Terrain Texture Layers

Opens the Terrain Texture Layers.

Lighting

Opens the Terrain Lighting window.

Different Sized Brushes

Allows you to paint with a smaller or bigger brush. Adjusts the inner and outer radius of the terrain brushes.

Low, Medium, High Opacity

Allows you to choose the strength at which you paint on the terrain. Affects the Hardness amount of the terrain brushes.

File

Parameter

Description

Import Heightmap

Lets you import an image to be used as new heightmap (the size of the heightmap must be the equal or smaller than the current level heightmap resolution). Supported files:

  • 8-bit.bmp
  • 16-bit.pgm
  • 16-bit.raw
  • 16-bit.raw r16 (new!)

Export Heightmap

Use this option to export the heightmap file to be edited in Photoshop (version CS1+ required). Supported files:

  • 8-bit.bmp
  • 16-bit.pgm
  • 16-bit.raw
  • 16-bit.raw r16 (new!)

Show Large Preview

Shows you a preview of the heightmap as a *.bmp. This will create a file called HeightmapPreview.bmp in the TEMP folder inside the root of your build directory and open up an external application to view the file (i.e. Photoshop).

Modify

Parameter

Description

Make Isle

Sinks the current heightmap.

Remove Ocean

Sets the water level to -100000.

Set Water Level

This feature adjust the water level (Default 16m).

Set Max Height

Adjusting this value will change how high the tallest mountain can be (Default 1024).

Set Unit Size

Deprecated. Please use Resize Terrain function.

Flatten (Light)

Flattens terrain to either highest or lowest point.

Flatten (Heavy)

Flattens terrain to either highest or lowest point.

Smooth

Removes hard edges on the entire terrain.

Smooth Slope

Removes hard edges from steep areas.

Smooth Beaches

Removes hard edges from flat areas.

Normalize

Makes sure the entire greyscale spectrum is used (highest point is the one specified in max height and lowest point is 0).

Reduce Range (Light)

Makes mountains smaller.

Reduce Range (Heavy)

Makes mountains smaller.

Noise

DEPRECATED - Adds irregular noise across your heightmap.

Randomize

DEPRECATED - Randomizes your heightmap.

Erase Terrain

This option will delete the current heightmap data.

Resize Terrain

Re-opens the initial heightmap creation panel to adjust the Heightmap Resolution and Meters Per Unit scale.

Invert Terrain

Changes black to white.

Tools

Parameter

Description

Generate Terrain

Opens the Generate Terrain dialog. Adjusting the parameters in this window will result in different noise pattern.

Surface Texture

Opens the Terrain Texture Layers.

Lighting

Opens the Terrain Lighting window.

Options

Parameter

Description

Show Water

Turns water on and off in the Terrain Editor dialog window.

Show Map Objects

Turns map object helpers on and off in the Terrain Editor dialog window.