# Creating a new map

## General information about a map

A map is a game level that typically does not contain scenario logic (scripts).\
It includes a ground surface and map entities such as trees, fences, houses, sound effects, and visual effects.

{% hint style="info" %}
The ground surface is a mesh composed of triangles (a type of polygon). \
The shape and size of these polygons significantly influence texture mapping, which directly impacts the quality of visual detail on the ground surface.
{% endhint %}

{% hint style="info" %}
Smaller polygons allow for smoother and higher-quality texture transitions but can significantly increase the overall number of polygons, negatively affecting game performance (fps).
{% endhint %}

The [Map Editor](/editor/map-editor.md) is the primary tool for both creating new maps and making changes to existing ones.

## **Creating a new map**&#x20;

1. Open the [Map Editor menu](/editor/map-editor.md#main-menu).
2. Click the **New** button.
3. Confirm the intention by clicking the **Yes** button.

<figure><img src="/files/kjaJ61dg9bKIkIu2DzOt" alt=""><figcaption><p><strong>Warning when pressing the 'New' button</strong></p></figcaption></figure>

4. Fill up parameters  in the **Setup landscape** window and click the **Ok** button.

<figure><img src="/files/YKeBddy1CEPOdruNyxVH" alt=""><figcaption><p>Initial map parameters window</p></figcaption></figure>

### **Setup landscape parameters**

<table><thead><tr><th width="186">Parameter</th><th width="237">Description</th><th>Note</th></tr></thead><tbody><tr><td>polygon</td><td>Initial polygon settings of the ground surface mesh</td><td></td></tr><tr><td>polygon/triangle</td><td><p><strong>Type of polygon:</strong> </p><p>90 - rectangular, </p><p>60 - equilateral.</p></td><td>Recommended type is rectangular. <br>The shape affects the quality of texture blending along transition lines</td></tr><tr><td>polygon/side</td><td>Side size of the polygon</td><td>Recommended side parameter is 2,2 m.<br>This parameter influences the detail of the ground surface rendered with materials</td></tr><tr><td>texture</td><td>Settings of initial material</td><td></td></tr><tr><td>texture/size</td><td>Size of the initial texture tile</td><td>Affects the average texture density</td></tr><tr><td>texture/bitmap</td><td>Name of the base material</td><td>Selected from the list.<br>For a new map, 'grid001' can be used as the initial texture</td></tr><tr><td>terrain</td><td>Initial terrain type</td><td>Default is 'ground', not recommended to change.</td></tr><tr><td>mapSize</td><td>Map size in game units of length.</td><td>Recommended size is 600x600.</td></tr></tbody></table>

After setting up the initial landscape parameters of the map, click the 'OK' button to create the mesh with the specified parameters. \
At this stage, the map template is created.

**The next step is to save the new map to specify its name.**

### **Naming rules for maps**

Map names can include:

* latin alphabet letters (both uppercase and lowercase A to Z),&#x20;
* arabic numerals (0-9),&#x20;
* and symbols such as hyphen (-) and underscore (\_) to enhance readability or separate elements within the map name.

{% hint style="info" %}
Using a slash "/" in the map name automatically creates an additional intermediate folder (if it doesn't exist) and sets the path for saving the map files. \
For example, entering "multi/first\_map" as the name will save the map in the folder `map\multi\first_map`.
{% endhint %}

{% hint style="warning" %}
The GEM RTS engine is case-insensitive to map names It treats names such as "MapName", "mapname", and "MAPNAME" as equivalent.
{% endhint %}

{% hint style="warning" %}
It is possible to save the map under an existing name by selecting the desired name from the list. Before saving, the editor will issue a warning about overwriting the map. After saving, it will be impossible to restore the original map.
{% endhint %}

### **Saving the map**&#x20;

1. Open the **Map editor menu**
2. Click the **Save as** button

<figure><img src="/files/xVPvpAIrj0Mnqod1YsFp" alt=""><figcaption><p><strong>Map editor's main menu window</strong></p></figcaption></figure>

3. In the **Save As** dialog box that appears, enter the desired name for your map in the **File** field and press the **Ok** button.

<figure><img src="/files/GYmsfFuR0Fu15iBbK45U" alt=""><figcaption><p><strong>Naming a new map in the 'File' field of the 'Save as' window</strong></p></figcaption></figure>

**At this stage, the template of the new map is ready for creating game level and missions.**

## **Map files**&#x20;

After the first save, the editor creates a named folder containing three main map files essential for game functionality.

<table><thead><tr><th width="199">File name</th><th>Description</th></tr></thead><tbody><tr><td>map</td><td>Entity layer</td></tr><tr><td>map.ply</td><td>3D model of the ground surface</td></tr><tr><td>map.net</td><td>Heightmap</td></tr></tbody></table>

### Entity layer

This layer includes both static and dynamic entities, such as buildings, entities of flora, entourage and other non-terrain elements that players can interact with. \
The Entity Layer is created and modified using the [Entity Editor.](/editor/map-editor/2-entity-editor.md)

### 3D landscape model

The map.ply file contains the 3D model for the ground surface, which includes all the topographical details defining the terrain's appearance and behavior in the game. Key aspects include:

* **Geometry**\
  Defines the 3D shape of the terrain, including elevations, depressions, and the overall form such as mountains, valleys, and flat areas.
* **Textures and materials**\
  Textures are applied to the geometry to provide a realistic look, incorporating materials like grass, rocks, sand, etc.
* **Terrain PP and FX data**\
  These data ensure proper interaction between units and the terrain. \
  Terrain PP (Physical Properties) data ensures units like humans or vehicles respond correctly to the terrain. \
  Terrain FX data adds the correct visual effects when units interact with the terrain.

This file is created and modified using the [Land Editor](/editor/map-editor/3-landscape-editor.md).&#x20;

### Heightmap

This file is used by the game engine for calculating various game components and parameters. It is crucial for AI pathfinding, as it delineates where units can and cannot move, defining blocked areas and regions with special movement rules.\
The heightmap file is edited using the Heights brush of the Land Editor


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bestway.com.ua/editor/map-editor/creating-a-new-map.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
