Scripting

Look here for the default settings MapGen uses.

Scripting commands for next major release.

# Supported Commands

## General

script: filename;

• execute another script
• files will be numbered
• filename - any valid path and file name

batch: num;

• generate a batch of maps
• batch - 1 to 999

filename: name;

• set the base file name for output

## Terrain Generation

level: terrain height;

• designate the levels at which certain terrains will occur
• terrain - one of the following
• ocean
• terrain will be ocean when the heightmap is less than height
• mountain
• terrain will be mountain when the heightmap is greater than height
• river
• do not use
• height - integer from 0 to 255

dimension: width height;

• sets the dimensions of the map
• width, height
• integer from 500 to 10000

wraparound: wraptype;

• set the wrap around type for the map
• wraptype - one of the following
• none - wrapping is disable for this map
• xy - wrapping in both dimensions
• x - wrap left to right (not yet)
• y - wrap top to bottom (not yet)

zoom: factor;

• change the map zoom
• effects how large land masses appear
• factor - floating point number greater than zero

tsize: dist1 dist2;

• change the size of grown terrain groups
• dist1 - distance between initial seeds
• dist2 - distance between secondary seeds
• dist1 > dist2
• a good rule of thumb is to use the following equations
(1)
\begin{align} dist_1 = \frac{1}{10}\frac{\sqrt{x y}}{zoom} \end{align}
(2)
\begin{align} dist_2 = \frac{1}{3} dist_1 \end{align}

## Province Generation

The psize function family allows for the size of provinces to be specified. as many provinces will be packed onto the map as possible, constrained by the distances between each province seed. Using any psize function will override any psize function called before, as well as any pcount function.

psize: dist;

• define the distance which all province seeds must have between them
• all provinces will be about the same size

psize: land water;

• as psize: dist; but a distinction is made between land and water seeds
• the average will be used when comparing land seeds against water seeds
• all water provinces will be about the same size, all land provinces will be about the same size

The pcount function family allows the user to define the total number of provinces on a map. Using any pcount function will override any psize or pcount function called previously.

pcount: count;

• define the total number of provinces on the map

pcount: land water;

• define the total number of land and water provinces on the map.

nbdist: dist;

• define the distance which province seeds must have between them and natural borders

## Image Commands

pixel: r g b terrain;

• designate a background color for a terrain type
• r, g, b - integer from 0 to 255
• terrain - one of the following
• farm
• forest
• mountain
• plain
• swamp
• waste
• water
• *

pixel: r g b terrain1 terrain2;

• designate a color for borders between terrains
• r, g, b - integer from 0 to 255
• terrain1, terrain2 - one of the following
• farm
• forest
• mountain
• plain
• swamp
• waste
• water
• *

provnum: flag;

• display province id numbers on map image
• flag - yes or no;

## Map File Commands

verbose: flag;

• use detailed comments in the map file
• terrain types for each province
• center point of province
• flag - yes or no

pthresh: count;

• define the number of pixels two provinces must have in common on their borders to be neighbors

# Work in Progress

sprite: filename distance terrain (count);

• designate a sprite to be used in a given terrain
• filename - any valid path and file name
• distance - minimum distance this sprite must be from all other sprites
• terrain - one of the following
• farm
• forest
• mountain
• plain
• swamp
• waste
• water
• *
• count (optional) - add this sprite count times

pcount: lands landm landl waters waterm waterl;

• specify target number of large, medium and small land and water provinces

psize: dists lands landm landl waters waterm waterl;

• designate a distribution for province type (land/water) and size
• dists is the target distance small provinces must be away from other provinces
• province types types within the same size category will be roughly the same size (i.e. small land provinces will be about the same size as small water provinces, etc.)
• the relation between number of water provinces and land provinces depends on the map

• define the radius for terrain blurring
• used in conjunction with tblur: terrain1 terrain2;

tblur: terrain1 terrain2;

• blur between two terrain types
• used in conjunction with tblur: radius;
• terrain1, terrain2 - one of the following
• farm
• forest
• mountain
• plain
• swamp
• waste
• water
• *
• terrain1 = terrain2 has no effect

blur: sigma1 sigma2;

• define sigma for guassian blur on map
• sigma1 - blur before sprites are placed
• sigma2 - blur after sprites are placed
• use zero (0) to disable blurring for either of the sigmas

an asterisk in a list denotes that the command will be run for all possible values of the argument that the asterisk was used for.

page revision: 27, last edited: 10 May 2007 22:57