Terrain
From MegaMekNET
A terrain is a MegaMek map configuration. Terrains are also called continents as they are associated with planets in a MekWars campaign context. A terrain is composed of many configuration values that affect the final output. Two generated maps from a single terrain definition share a lot of features but are almost unique entities. Terrains are defined in server-side "terrain.xml" configuration file.
Contents |
Configuration keys
Throughout this section associated configuration keys are marked using capitalized violet text : LIKETHIS. Please also note that all chance configuration are 0-100 values, defining a chance percentage.
Themes
Theme (THEME) are eye-candy set of tiles images that change overall looking of a map.
Features
There are eight non-blank hex types handled by terrain definition : forest, fortification, ice, pavement, rough, rubble, swamp and water. Each type is associated to 4 configuration keys defining :
- Minimum spot count (*MINSPOTS)
- Maximum spot count (*MAXSPOTS)
- Minimum spot size in hexes (*MINHEXES)
- Maximum spot size in hexes (*MAXHEXES)
A spot is a group of one hex type. For instance a definition of forest type with min-max spot equal to 4-10 and a min-max size equal to 4-6 will create a mean map with 7 clusters of 5 wood hexes.
This value definition is for a 15*17 (255 hexes) group. Depending on map size setting you'll maybe encounter more or less featured hexes proportionally to map size.
Heavy woods
Heavy woods are variation of the standard forest. Each wood hex have a given chance to be particularly dense. (FORESTHEAVYPROB)
Elevation
There are various configuration keys that affect the way a map is leveled.
Algorithm
There are actually two built-in map generation algorithm (ALGORITHM) in MegaMek. The first developed was not as balanced and created commonly one way sloped maps, that often favors one side. That's why a second algorithm was embedded that generates more balanced maps.
Second algorithm use a bugged HILLYNESS definition that is not 0-100 but 0-1000.
Elevation variation and smoothness
Terrain also define the lowest and highest possible elevation range number (HILLELEVATIONRANGE), as well as the chance a level variation happens between to hexes (HILLYNESS). One last important parameter define the chance a level variation has to be a break (2+ level variation) rather than a pursuance of the landscape (CLIFFS).
Terrain inversion
Two configuration keys define the probability a map has to be inverted (INVERTNEGATIVETERRAIN and HILLINVERTPROB).
Special elevation
Finally a set of keys allow MegaMek to generate featured hills or mountains by defining the number of peaks in the map (MOUNTPEAKS) and their mean height (MOUNTHEIGHTMIN,MOUNTHEIGHTMAX) and width (MOUNTWIDTHMIN, MOUNTWIDTHMAX). The mountains are themed (MOUNTSTYLE) featuring simple mountains, volcanoes (extinct or active) or finally a tarn capped mountains.
Buildings
Some configuration keys define the human effects on map.
Road
A key define the chance a map has to be crossed by a road (ROADPROB).
Urban map
Depending a key value a map is marked as urban or not (CITYTYPE). Available values are :
- None: not an urban map
- TOWN
- GRID
- METRO
- HUB
If a map is urban, further parameters define the city size (TOWNSIZE), the number of blocks (CITYBLOCKS) and their density (CITYDENSITY).
A set of configuration keys define the range of building size (MINFLOORS,MAXFLOORS) and their toughness range (MINCF, MAXCF) expressed in construction factor (CF).
Special effects
All the following special effects configuration key (excepted river) are subject to another one enhancing or mitigating them (FXMOD).
River
The chance a river has to cross the map are defined by an associated key (PROBRIVER).
Drought
Drought chances are defined by an associated key (PROBDROUGHT). If a map is drought all water hexes to be replaced by rough or swamps.
Flood
Flood chances are defined by an associated key (PROBFLOOD). If a map is flooded then all negative level hexes are transformed to water hex, furthermore all level zero hexes are turned to swamps.
Fire
The chance a wood hex has to be burning are defined by an associated key (PROBFORESTFIRE).
Freeze
Freeze chances are defined by an associated key (PROBFREEZE). If a map is frozen then all water and swamp hexes are turned into ice.
Associated softwares
TIG (Terrain Information Generator)
TIG is a XSLT stylesheets set created by Guibod that translate raw configuration content to a human readable html or wikimedia source content. This wiki terrain description pages are generated by this tool.
Campaign terrains definition
The actual campaign terrain definition can be found in the related wiki article.

