# Heights Editor

The **Heights Editor** \[`Heights`] toolset allows you to modify the **ground surface** mes&#x68;**:** creating hills, mountains, valleys, ravines, and lowlands on the map.

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FM0ulwiaEA18GUuuFzy6c%2FLand%20Editor.png?alt=media&#x26;token=80a8de22-5eaf-418c-9eaf-ae5062758a9d" alt=""><figcaption><p>Heights Editor Tab</p></figcaption></figure>

The `Alt+W` key combination toggles the display of the **ground surface** mesh polygonal grid and switches between polygonal grid display modes.

## **Heights Brush operation**

* **Raising vertices**\
  Moving the brush with the Left Mouse Button (`LMB`) held down raises the vertices of the ground surface mesh.
* **Lowering vertices**\
  Moving the brush with the Right Mouse Button (`RMB`) held down lowers the vertices.
* **Smoothing** **vertices**\
  Moving the mouse while holding the `Shift` key smooths out the height differences for the vertices of the ground surface mesh that fall within the brush area. This helps create smoother transitions between areas of varying heights.
* **Fixing alignment**\
  Moving the mouse while holding the left `Alt` key fixes the alignment of the vertices to the level of the vertices under the brush area at the moment the Alt key is pressed.
* **Brush size**\
  The brush size can be increased and decreased using the Numpad Plus (`+`) and Numpad Minus (`-`) keys.

## Configuring the Heights brush

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FuAZJYr8f4DUDHQQToqQK%2FHeights%20Editor%201.png?alt=media&#x26;token=5577655c-c691-4ee6-b975-8de8d1d04665" alt="" width="563"><figcaption><p>Tools for adjusting <strong>Heights brush</strong> properties</p></figcaption></figure>

* **Soft-Sharp slider** \[2.1]\
  Adjusting the slider position achieves the desired degree of softness for the **Heights brush**:
  * the `Sharp` position makes the brush hard: all vertices of the ground surface mesh under the brush change height with the same intensity.
  * the `Soft` position makes the brush soft: the intensity of height change is greater at the center of the brush and gradually decreases towards the edges.
* **Slow-Fast slider** \[2.2] affects the speed of height change for the vertices.
* **Fixed Height parameters**
  * The `fixed height` \[2.3] checkbox locks the alignment level of the ground surface mesh vertices at the specified height, which is set in the field next to it.
  * The `fix relative` checkbox enables discrete operations for the Heights brush, allowing vertices to be raised by a set height with each `LMB` click and lowered with each `RMB` click.\
    The ability to set the brush's discreteness becomes available when the fixed height parameter is enabled and set.

## **Additional functions of the Heights Editor**

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FmrQDQDVoAVvbbGjjReYk%2FHeights%20Editor%202.png?alt=media&#x26;token=9d500939-f94b-4f8a-9cf4-2325646c6a71" alt="" width="563"><figcaption><p>Functions for debugging and configuring ground surface mesh</p></figcaption></figure>

<table><thead><tr><th width="285">Function name</th><th>Purpose</th></tr></thead><tbody><tr><td>[3.1] <code>heightmap</code> </td><td>Debugging tool. <br>Checking this box enables visualization of the <strong>Path Planner heightmap</strong> with slope angle parameters for each grid cell.</td></tr><tr><td>[3.2] <code>Heightmap level</code></td><td>Debugging tool for slope steepness to check terrain passability based on <strong>ground surface</strong> slope angles.</td></tr><tr><td>[3.3] <code>Water altitude</code></td><td>Sea level parameter. <br>Used in the <strong>Entity Editor</strong> to align entities to the water level.</td></tr><tr><td>[3.4] <code>Clip heightmap</code></td><td>"Clip" function. <br>Allows clipping the <strong>Heightmap</strong> grid to the boundaries of the visible <strong>ground surface</strong> mesh. <br>Useful after reducing map size using the <strong>Polygon Editor</strong>.</td></tr><tr><td>[3.5] <code>Heightmap by mesh</code></td><td>Synchronize the heightmap grid with the visible <strong>ground surface</strong> mesh.</td></tr></tbody></table>

## **Heightmap transfer tools**

The **Heights Editor** tab contains tools for creating map terrain using a topographic map image or **Land decal** image, as well as transferring the heightmap for the **ground surface** mesh from one map to another.

### Import heightmap

The `Import heightmap` tool is used to create terrain based on a topographic map. Supported import formats: `tga`, `ebm`, `bmp`, `dds`, `jpg`, `png`.

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FmJqoJvTV3KWsczGdkF4G%2FImport%20Heightmap.png?alt=media&#x26;token=1b3fbc13-1236-4912-be01-eff24e5729a2" alt="" width="563"><figcaption><p>Heightmap Import  tools</p></figcaption></figure>

**Heightmap import instruction**

1. **Prepare a heightmap image**\
   The heightmap uses a grayscale color scheme:

   * `black` represents the lowest elevation;
   * `white` represents the highest;
   * `shades of gray` indicate intermediate heights.

   The maximum supported image size is 8K, in 8-bit grayscale format, and the image aspect ratio must match the map’s aspect ratio (e.g., 1:1 for square maps).
2. **Set the Import parameters**
   * `Max height` \[4.1] - specifies the maximum terrain height in meters. This corresponds to the highest vertex of the ground surface mesh, reflecting the map’s intended design.\
     To convert game height units to meters, use the ratio `1 meter = 20 height units`.&#x20;
   * `Zero height` \[4.2] - defines the gray shade that represents the **zero level** of the ground surface mesh. \
     By default, black color corresponds to the map’s zero ground surface level. Adjust this parameter for maps with depressions below the **zero level**, such as lakebeds or other low areas.
3. **Import the heightmap**\
   Click `Import heightmap`button \[4.4], then select the image file to import.

### Export heightmap

The `Export heightmap` tool allows creating a topographic map based on the terrain of the current map.

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2F0mKy0JcJwFRDbErzIEB2%2FExport%20Heightmap.png?alt=media&#x26;token=76d5743c-a08f-4257-afee-18ba7552d495" alt="" width="563"><figcaption><p>Heightmap export tools</p></figcaption></figure>

**Heightmap export instructions**

1. Set the image size by filling in the `Image width` and `Image height` \[5.1] parameters.
2. Click `Export heightmap` \[5.2], choose the folder to save the file, and specify the file name.

### Land decal

The `Land decal` \[6] tool is used to apply a texture across the entire map, which simplifies the creation of maps based on real-world locations.

<figure><img src="https://2358506489-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2UV9d5d9aTZPISbocWyo%2Fuploads%2FjcqbQYWBLe13211AJhnG%2FLand%20decal.png?alt=media&#x26;token=637bc65c-96a4-4169-be7a-e82ddfa384b8" alt="" width="563"><figcaption><p>Land decal</p></figcaption></figure>

#### Working with the Land decal

1. **Preparing the texture**
   * Prepare the decal image in one of the supported formats: `tga`, `ebm`, `bmp`, `dds`, `jpg`, `png`.
   * It is recommended to set the image size proportional to the map size. \
     For a 650x650 meter map, use an image size of 650x650 pixels (scale 1:100 m) or 1300x1300 pixels (scale 1:50 m), or according to the site plan.
2. **Saving the texture**
   * Save the image in the `scene/texture` directory. \
     For convenience, you can create a separate folder for decals.
3. **Adding a decal to the map**
   * Open the **Heights Editor** tab.
   * In the `Land Decal` block, click the `Create` button to apply the decal to the map.
   * Select the prepared image from the `scene/texture` directory.
4. **Adjusting the decal**
   * Adjust the decal transparency using the `Transparency` slider to make working with the map easier.
5. **Removing the decal**
   * Click the `Remove` button in the `Land Decal` block to remove the decal.

<figure><img src="https://lh7-rt.googleusercontent.com/docsz/AD_4nXd1Kb5JaW89WWI-wTYyOsRFIZUIgmBKmSzujEBXedF85ld6LRBWfSjIUFGtnX3FpzQS-_hhq1Pon-d5gT4yfCZIcbe15dhpfPl2OhAPiDd0Xve9tr1LwB8JB8TpGAUjjSd-eyaiz3MOjzLfghGJeqgSiXjx?key=F5ZZ1NbgL9AIkbClRQiLwQ" alt=""><figcaption><p>Result of applying the Land decal to the map's surface</p></figcaption></figure>

## Derived Heightmaps

The game engine generates several invisible derived heightmaps based on the polygons of the visible **ground surface**, which are used for calculating various game parameters.

To visualize and toggle through the auxiliary heightmaps, use the `Alt+H` key combination. Each press cycles through the different heightmaps, and the last press disables the visualization mode.

<table><thead><tr><th width="315">Map name</th><th>Purpose</th></tr></thead><tbody><tr><td><code>Visibility heightmap</code></td><td>A colorful grid that follows the contours of the <code>ground surface</code> and the objects located on it. The colors correspond to the visibility blockage height relative to the ground: <br>- <code>blue</code> - up to 0.25m;<br>- <code>purple</code> - 0.25 to 1.25m;<br>- <code>yellow</code> - 1.25 to 2m;<br>- <code>green</code> - 2 to 3m;<br>- <code>red</code> - 3m and above.</td></tr><tr><td><code>Land heightmap</code></td><td>Visualizes the height of the ground surface’s polygonal grid cells. <br>The color of the grid changes based on the minimum and maximum heights. This map is used by the engine for calculations related to ground contact and intersections.</td></tr><tr><td><code>Terrain heightmap</code></td><td>A colorful grid following the terrain's contours, marking the different <code>terrain types</code>. <br>The contour colors are defined by the <code>РР color</code> parameter, while the cell fill colors are determined by the <code>FX color</code> parameter.</td></tr><tr><td><code>Path planner heightmap</code></td><td>Visualizes the heightmap with a focus on the slope angles of each cell relative to the horizon. <br>This same map is displayed when the <code>heightmap</code> checkbox is enabled in the <code>Heights</code> tab of the Height Editor. <br>Colors indicate the slope angle compliance to the chosen level:<br>- <code>blue</code> - equal to or above the specified level;<br>- <code>gray</code> - below the specified level. <br>Used as a terrain passability check tool based on the surface slope angle for Pathfinding calculations.</td></tr><tr><td><code>Flags heightmap</code></td><td>Marks the ground surface with <code>flags</code>, which prohibit certain in-game actions on the marked areas.</td></tr></tbody></table>
