Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
English

Overview

The following tutorial will show you the fastest way to create how to set up a new level and its initial terrain map. Maps created
Terrain elevation in CRYENGINE Sandbox are is based on height maps to get a realistic looking landscapebrightness values of a height map textures assigned to the terrain geometry.

Table of Contents
maxLevel3
minLevel2
excludeOverview

Creating a New

Map

Level Folder and File

Warning
titleWarning

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.

Note

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, the Editor will create a new folder in the levels directory, named after the map and containing all the necessary 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 map 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.

Info

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

Pre-generated

1x Color Multiplier

4x Color Multiplier

Tip

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.

Excerpt
hiddentrue
Learn how to create a new map, add terrain, and generate a surface texture.
Chinese

创建新地图

下面的教程将向您展示如何以最快的方式创建一个新地图。在 Sandbox 中创建的地图都基于真实的高度图以得到一个逼真的全景。

创建一个新地图文件夹和文件

在*文件*菜单上,单击*新建*。

 

在“新关卡”对话框的“关卡名称”文本框中给关卡输入一个名称。您应根据关卡所需的大小和细节程度来调整高度图的分辨率和每个单位多少米。“地形大小”(以下列出的两个下拉菜单)由高度图的分辨率和每单位多少米的简单乘法得到。单击 OK 以创建新的关卡。

当您单击 OK 时,“编辑器”将在关卡目录下创建一个新文件夹,文件夹与贴图同名,并包含所有必需的文件。在该目录中的最重要的文件是 *.cry文件,其中包含“编辑器”所需的所有主要信息。

 

添加地形到关卡中

生成地形

现在,关卡中有一个新的空贴图,您需要一些地形以便在上面行走。您可以自动生成地形。

若要创建地形,在*地形*菜单上,单击*编辑地形*。

 

这样会打开“地形编辑器”。

 

接下来,在*工具*菜单上,单击*生成地形*。

 

这将显示“生成”对话框,您可以通过修改以下参数来影响地形的外观:

 

默认设置的效果不错,所以单击 OK。在地形创建结束之后,您应该看到类似这样的东西:

 

现在,通过单击 OK 关闭“地形编辑器”窗口,您将可以看到在 3D 视图中的变化。

地形将呈灰色,根据地形的高度,其颜色会有所改变。地形越亮,则高度越高。水蓝色的纹理隐藏所有低于海平面的地形,给您一个真实的陆地应有的实际视觉印象。

若要获得应用默认纹理的第一印象,您需要重新生成地形表面的纹理。

生成地形表面纹理

在*文件*菜单上,单击*生成表面纹理*。

 

将显示“选择纹理尺寸”对话框,您不用进行任何设置,但若想要进行设置,可以选择“高质量”(这将需要较长的计算时间,但会得到更好的显示效果)。单击 OK 并耐心等待直至计算完成。

 

 

 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.

 

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

 

结果

现在,按下 Ctrl+G 组合键,您将能够进入游戏模式,并可以在新建关卡里四处走动。

进行实验的事项:

地形编辑器参考

本节有地形编辑器的菜单和工具栏的信息。

文件

修改

工具

选项

工具栏