Empires Terrain
AEP Map and Terrain
The AEP map is a specialized instance of a MapDisplayUIControl used to display the map for a scenario.
Creating a Scenario
To create a new scenario, click Editor from that main menu and then the + (Create a brand new campaign) button from the scenario selection screen. Enter the scenario folder name and display name for the scenario.
To use an existing map for this scenario, click Use map: <New Map> and choose a BAM file.
To create a new map, specify the following:
- Map Image
- Height Map Image
- Height Scale - a multiplier applied to the height map values
- Logical Map Width - this is how large the map will appear to be in game, it is independent of the resolution of the map textures
- Logical Map Height - may be set smaller than the width to create a non-square map, the upper portion of the map textures will be used
- Import Borders from SVG (Advanced) - optionally specify an SVG file that contains border polygons to create initial borders. Note: SVG importing ONLY supports a list of polygons indicating a list of bordered regions. There are many other ways a map could be constructed and saved in a valid SVG that will not be imported, if you are planning to use SVG importing, be sure that your software and approach results in this particular format.
If you have not imported borders, or wish to edit borders, choose Border mode from the upper left palette in the editor and follow the directions below the palette.
Before a map can be played, you will also need to associate the bordered regions with entries in an existing Regions.CSV file located in the Data folder in either the current scenario folder or the game folder. Switch to the Region mode from the palette. When you select a region, the Region Properties panel will be displayed. To associate the region to a row in the table, select the row by name from the Template list. You may also need to add or remove connections between regions to allow movement on the map (importing an SVG automatically creates connections between regions which share two or more consecutive border points). This is also edited in the Region mode under Connections in the Region Properties panel. The anchor points within a region can also be edited, the meanings of the anchors are specified by script and can be used to indicate city location, army locations, etc.
The Unit Placement and Scenario Properties modes of the editor are read-only modes displaying properties set by other CSV or script files.
Files
Unless otherwise specified, all map related files are located in either the Data/Maps folder within the current scenario folder (highest priority) or in the Data/Maps folder of the game folder (in which case they may be shared by multiple scenarios).
SCENARIO.TXT
Each scenario requires a SCENARIO.TXT file in its root folder. This file contains an entry which specifies which BAM file to use as the map for the scenario. It is created automatically when a scenario is created in the editor, and may be edited manually if required.
BAM
The BAM file contains the map data. It is created automatically by the editor. Some fields in the [MAP] chunk of the file corresponding to the new map settings in Scenario Creation may be safely edited by hand. Otherwise, the editor will normally be used to edit this file.
Map Image
The map image is the base texture for the map and may be in any supported image format. The RGB channels of this texture determine the colour of the terrain (land and water). If the terrain detail shader is used, the alpha channel is used to indicate which regions of the map are treated as land and which are treated as water. Alpha 0 is water, alpha max is land. If a smoother transition is required, providing intermediate alpha values will fade out water or terrain detail effects.
Height Map Image
The height map image is used to determine the height values for the terrain. It may be either a 32 bit TGA file (height is taken from the blue channel) or a RAW file.
Normal Map
Optional. Normal map applied over the entire map. The filename is based on the map image filename <map_image>_N.ext. It may be in any supported image format.
Specular Map
Optional, requires a normal map. Specular map applied over the entire map. The filename is based on the map image filename <map_image>_S.ext. It may be in any supported image format.
Detail Map
Optional, requires a normal and specular map. A map of the terrain detail textures to be applied over the entire map. The filename is based on the map image filename <map_image>_D.ext. It may be in any supported image format (although good results may require an uncompressed format). The red channel of the texture is used to indicate which of 8 detail textures to use.
- detail0: Red values 0 to 17 / 255
- detail1: Red values 18 to 53 / 255
- detail2: Red values 54 to 91 / 255
- detail3: Red values 92 to 127 / 255
- detail4: Red values 128 to 163 / 255
- detail5: Red values 164 to 201 / 255
- detail6: Red values 202 to 237 / 255
- detail7: Red values 238 to 255 / 255
For best results and performance, detail0 - detail3 should be exactly the same resolution and detail4 - detail7 should be exactly the same resolution.
Detail Textures
Optional. Detail textures blended with the global map image and global normal map to provide additional terrain detail at high zoom levels without requiring a massive map images. They are named detail0.tga to detail7.tga and detail0_N.tga to detail7_N.tga. Only tga format is supported. The detail textures are treated as greyscale images (only the red channel is used) and are tiled over the map image based on the detail map texture on land areas of the map.
Slicing
To support very high resolution textures, the Map Image, Normal Map, Specular Map, and Height Map Images may be sliced into multiple tiles. The naming of these files is based on the untiled filename. The top-left corner has the same name as the untiled filename, the remaining files have the x and y coordinates appended with _x_y. For example, if the BAM specifies a map image texture of "map.dds", the 2x2 tiled versions are:
- map.dds: top left (0,0)
- map_0_1.dds: lower left (0,1)
- map_1_0.dds: upper right (1,0)
- map_1_1.dds: lower right (1,1)
If slicing is used, Map Image, Normal Map, and Specular Map must all use the same number of tiles. Height Map Image tiling is independent.