Terrain Generation From Geographical Data

From AHWiki
Revision as of 05:23, 3 November 2013 by Artik (talk | contribs) (Created page with '__TOC__ ==Introduction== Special events and historical arenas require geographically accurate terrains. Creating such terrains using TE itself or various graphical programs can...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Introduction

Special events and historical arenas require geographically accurate terrains. Creating such terrains using TE itself or various graphical programs can be hard process. A special tool called MakeAHMap[1] significantly simplifies the process making many stages fully automatically.

It generates the following output using geographical data:

  1. Accurate terrain elevations (.elv file)
  2. Accurate high resolution shorelines and rivers (waterd.bmp/waterc.bmp)
  3. Appropriated ground cover (tiles) according to the geographical data set, i.e. farm, forest, dessert areas, etc.
  4. Nice looking clipboard map.


Installation

Basics Installation

Download the latest zip file from http://cppcms.com/files/makeahmap/, extract it in any suitable location. Note: you need at 1GB of free space on the disk for the geographical data (which would be downloaded automatically on demand).

In the extracted folder you would find:

  • makeahmap.exe - the main program
  • config.ini - configuration file that defines all the terrain settings, by default pointing to the Battle of Britain area.

You can just double click the makeahmap.exe. At the first time your run the program, the required data would be downloaded. There are 3 types of data needed:

  1. GlobCover database[2] - the mapping of ground types - single tif file of 375MB - the largest file. Downloaded only once
  2. GSHHS[3] - shoreline and river database
  3. Elevation database - one of the three: GTOPO30[4], SRTM30 or SRTM3[5]

While the entire data-set for the first two would be downloaded, only relevant files from the elevation database are downloaded on demand. The generated files would be placed into output directory. Once the program completes you'll need to press an Enter to close the window.

Working Cycle

The basic working cycle with MakeAHMap program consists of 3 basic steps:

  1. Ajdusting settings in config.ini file
  2. Running the makeahmap.exe, watching the output for interesting details
  3. Using the generated files in TE


Using the MakeAHMap

Most of the information about various configuration options can be found in config.ini itself. So refer to this file for detailed instructions.

Basic Configuration

You need to specify, the TE map name, the size of the map, the geographical coordinates of the center of the area you are interested and and the map scale:

  • map_size - the size of the map in miles, one of 512, 256, 128 and 64
  • map_name - the name of the AH map you selected
  • lat, lon - the latitude and longitude of the central point of the terrain you are creating
  • scale - the map scale, 1.0 for 1:1 maps 2.0 for AH map being twice smaller than real one, etc.

Once you configured them run, see if the map covers appropriate areas and continue.

Importing the files into Terrain Editor

Once the output is generated (files in output directory), you can import the data into TE. For this tutorial we would call the terrain "mymap". Replace it with the name you are actually going to use,

On the first time: if the terrain does not exist yet, create one using appropriate size and save it. In our example we would name the terrain "mymap"

  1. Run the makeahmap.exe, watch it completes the work without errors.
  2. Exit the Terrain Editor
  3. Copy mymap.elv and gndtype.elv to the "ahiiterr\mapmap" folder where the TE is installed.
  4. Copy mymap.bmp to the "ahiiterr\mapmap\texsrc" folder, create one if it does not exit
  5. Copy waterd.bmp and waterc.bmp to the "ahiiterr\mapmap\imptexpt" folder, create one if it does not exist
  6. Open Terrain Editor
  7. Go to File->Import Water Bitmap
  8. Go to File->Save - you would get a message that water boundary was added.
  9. Review the result. If needed adjust the config.ini and go to step 1 again.

Handling Rivers

By default, MakeAHMap would create all known rivers and water channels. Sometimes you may found too many rivers and channels on the map you don't actually want. More than that, the program would automatically adjust the terrain elevations such the rivers would have legal slopes of at most 120 feet per mile. In real life the slopes may be much higher and such a correction would create deep canyons in the terrain you do not really want.

Thus, it is recommended:

  1. Define the maximal river level you want to render - option river_level in config.ini. Major rivers have low level index and small channels and rivers have high ones. So you can set the minimal required level. Typical values are 3 to 6. Depending on your needs
  2. Provide a maximal allowed correction in feet - the river_correction_limit option. For example, if you set the value to 500 feet, than all rivers that need more than 500 feet of elevation corrections to fit the TE requirements would be removed from the map. It is your choice - do you prefer to have more water and pay for it with deeper canyons, or eliminate them to keep the altitudes more accurate.

There are several things that would help you to optimize the parameters selection. One of them is program output:

...
- Pass 1: Collecting required water slope corrections
  ...
  -- Found 10 rivers causing elevation drops above 500 feet.

...
- Fixing river and lake slopes... completeed
  ...
  Total alt. corrections: 550 feet


Another one is the final maximal altitude adjustment map. In the output\water_altitude_correction.bmp you'll see the areas affected by the altitude correction. Black represents no correction and white (255,255,255) maximal correction. The the case of thee example above, the white would be correction of 550 feet.

You and find a map of removed river sections that was required to prevent too high corrections: output\removed_rivers.bmp

Using all of the above, you'll be able to define the options that would suit your needs.


Notes