The make-countries
method sets up the starting units for
each side, placing them in a confined area, separated from the
starting units of other sides and taking terrain preferences
into account. If requested, this method will also expand the
country outwards by a specified amount, possibly placing additional
units in the process.
SynthesisMethod: make-countries
This method works by looking for a likely place for the country, randomly places a basic set of starting units within that area, then expands the country outwards. The parameters give you control over the mix of terrain types in the country, as well as the size and relative positions of the different countries. This method runs on any side with fewer units than it is supposed to start with, as given by the parameters below. It places groups of units at locations separated from each other by specified distances.
GlobalVariable: country-radius-min
dist
This variable is the radius of the country's initial area.
Defaults to -1
, which allows the algorithm to calculate a "reasonable"
country size appropriate to the given number of units.
GlobalVariable: country-separation-min
dist
GlobalVariable: country-separation-max
dist
These variables are the minimum and maximum
distances of country centers from each other, in cells.
If small, countries will mostly overlap;
if very large, then attempts to use small worlds will fail;
if the max and min are too close to each other, placements can also fail.
For both of these, a value of -1
disables their effect.
Both default to -1
.
The max separation bound needs to be satisfied for a country with respect to only one other country, so for instance the final layout may involve a long "string" of countries where the first and last countries are very far apart from each other. The minimum bound must be satisfied for all pairs of countries.
TerrainTypeProperty: country-terrain-min
n
This property is the minimum amount of terrain
that must be within the country's initial radius.
Defaults to 0
.
TerrainTypeProperty: country-terrain-max
n
This property is the most terrain of the given type that may appear.
If -1
, then any amount may be present.
Defaults to -1
.
UnitTypeProperty: start-with
n
UnitTypeProperty: independent-near-start
n
These properties set the number of units of the given type in a player's country.
These units are randomly scattered within the initial radius,
and the favored
table (see below) decides which terrains
will be used. Units may be placed inside each other; in fact,
units with no favored terrain will be made into occupants if possible.
The independent units will be placed after the ones belonging to the side, so on the average they will get the less desirable locations in the country. Both independent and the side's units will be named using the side's namers.
Both default to 0
.
Table: favored-terrain
u t -> n%
This table sets
the probability of the unit type being on the given type of terrain at the
outset. A value of 0
is an absolute prohibition against placing
the unit on that type of terrain, thus every game must specify at least
one non-zero value for some terrain type and some initial unit type.
Defaults to 100
.
Once the initial country area has been set up, then you can allow the countries to expand outwards. Expansion occurs at the same rate for all countries. Countries may expand into and through each other.
TerrainTypeProperty: country-growth-chance
n%
This property is the chance that a country will expand onto an unclaimed cell
of the given terrain type.
Defaults to 100
.
TerrainTypeProperty: country-takeover-chance
n%
This property is the chance that a country will expand onto another country's cell
of the given terrain type.
Defaults to 0
.
UnitTypeProperty: unit-growth-chance
n.f%
This property is the chance that a unit of the given type will be placed
when the country expands onto a cell.
The unit will only be placed if the favored
chance is also true.
Defaults to 0
.
UnitTypeProperty: independent-growth-chance
n.f%
This property is the chance that an independent unit of the given type will be placed
when the country expands onto a cell.
The favored
chance is also evaluated.
Defaults to 0
.
UnitTypeProperty: unit-takeover-chance
n.f%
This property is the chance that a unit of the given type in another country and
belonging to another side will be given to the growing side.
Defaults to 0
.
UnitTypeProperty: independent-takeover-chance
n.f%
This property is the chance that an independent unit of the given type in
another country will be given to the growing side.
Defaults to 0
.
GlobalVariable: country-radius-max
dist
This variable is a cap on the country growth process.
Values between 0
and country-radius-min
prevent country growth entirely,
while a value of -1
allows growth to encompass the entire world.
Defaults to 0
.
UnitTypeProperty: country-units-max
n
This property is a cap on the number of units given to the side's country.
Defaults to -1
, which disables any limit.
GlobalVariable: growth-stop-chance
n%
This variable is the chance that a country's growth will stop,
if during the current [ring or round] no new cells were added
to the country.
Defaults to 0
.
TerrainTypeProperty: country-people-chance
n%
This property is the chance that the people's side will be changed to
match that for the country they are in.
Defaults to 100
.