Autoplace specification is used to determine which entities are placed when generating map. Currently it is used for enemy bases, tiles, resources and other entities (trees, fishes, etc.).
Autoplace specification describe conditions for placing tiles, entities, and decoratives during surface generation. Autoplace specification defines probability of placement on any given tile and richness, which has different meaning depending on the thing being placed.
control optional | :: AutoplaceControlID | Name of the AutoplaceControl (row in the map generator GUI) that applies to this entity. |
Name of the AutoplaceControl (row in the map generator GUI) that applies to this entity. | ||
default_enabled optional | :: bool | Indicates whether the thing should be placed even if MapGenSettings do not provide frequency/size/richness for it. [...] |
Indicates whether the thing should be placed even if MapGenSettings do not provide frequency/size/richness for it. [...] | ||
force optional | :: "enemy" or "player" or "neutral" or string | Force of the placed entity. [...] |
Force of the placed entity. [...] | ||
order optional | :: Order | Order for placing the entity (has no effect when placing tiles). [...] |
Order for placing the entity (has no effect when placing tiles). [...] | ||
placement_density optional | :: uint32 | For entities and decoratives, how many times to attempt to place on each tile. [...] |
For entities and decoratives, how many times to attempt to place on each tile. [...] | ||
tile_restriction optional | :: array[TileIDRestriction] | Restricts tiles or tile transitions the entity can appear on. |
Restricts tiles or tile transitions the entity can appear on. | ||
probability_expression | :: NoiseExpression | Provides a noise expression that will be evaluated at every point on the map to determine probability. |
Provides a noise expression that will be evaluated at every point on the map to determine probability. | ||
richness_expression optional | :: NoiseExpression | If specified, provides a noise expression that will be evaluated to determine richness. [...] |
If specified, provides a noise expression that will be evaluated to determine richness. [...] | ||
local_expressions optional | :: dictionary[string → NoiseExpression] | A map of expression name to expression. [...] |
A map of expression name to expression. [...] | ||
local_functions optional | :: dictionary[string → NoiseFunction] | A map of function name to function. [...] |
A map of function name to function. [...] |
probability_expression | :: NoiseExpression | Provides a noise expression that will be evaluated at every point on the map to determine probability. |
Provides a noise expression that will be evaluated at every point on the map to determine probability. | ||
control optional | :: AutoplaceControlID | Name of the AutoplaceControl (row in the map generator GUI) that applies to this entity. |
Name of the AutoplaceControl (row in the map generator GUI) that applies to this entity. | ||
default_enabled optional | :: bool | Indicates whether the thing should be placed even if MapGenSettings do not provide frequency/size/richness for it. [...] |
Indicates whether the thing should be placed even if MapGenSettings do not provide frequency/size/richness for it. [...] | ||
force optional | :: "enemy" or "player" or "neutral" or string | Force of the placed entity. [...] |
Force of the placed entity. [...] | ||
local_expressions optional | :: dictionary[string → NoiseExpression] | A map of expression name to expression. [...] |
A map of expression name to expression. [...] | ||
local_functions optional | :: dictionary[string → NoiseFunction] | A map of function name to function. [...] |
A map of function name to function. [...] | ||
order optional | :: Order | Order for placing the entity (has no effect when placing tiles). [...] |
Order for placing the entity (has no effect when placing tiles). [...] | ||
placement_density optional | :: uint32 | For entities and decoratives, how many times to attempt to place on each tile. [...] |
For entities and decoratives, how many times to attempt to place on each tile. [...] | ||
richness_expression optional | :: NoiseExpression | If specified, provides a noise expression that will be evaluated to determine richness. [...] |
If specified, provides a noise expression that will be evaluated to determine richness. [...] | ||
tile_restriction optional | :: array[TileIDRestriction] | Restricts tiles or tile transitions the entity can appear on. |
Restricts tiles or tile transitions the entity can appear on. |
Name of the AutoplaceControl (row in the map generator GUI) that applies to this entity.
Default: true
Indicates whether the thing should be placed even if MapGenSettings do not provide frequency/size/richness for it. (either for the specific prototype or for the control named by AutoplaceSpecification.control).
If true, normal frequency/size/richness (value=1
) are used in that case. Otherwise it is treated as if 'none' were selected.
"enemy"
or "player"
or "neutral"
or string optional Default: "neutral"
Force of the placed entity. Can be a custom force name. Only relevant for EntityWithOwnerPrototype.
Default: ""
Order for placing the entity (has no effect when placing tiles). Entities whose order compares less are placed earlier (this influences placing multiple entities which collide with itself), from entities with equal order string only one with the highest probability is placed.
Default: 1
For entities and decoratives, how many times to attempt to place on each tile. Probability and collisions are taken into account each attempt.
Restricts tiles or tile transitions the entity can appear on.
Provides a noise expression that will be evaluated at every point on the map to determine probability.
If specified, provides a noise expression that will be evaluated to determine richness. Otherwise, probability_expression
will be used instead.
A map of expression name to expression. Used by probability_expression
and richness_expression
.
Local expressions are meant to store data locally similar to local variables in Lua. Their purpose is to hold noise expressions used multiple times in the named noise expression, or just to tell the reader that the local expression has a specific purpose. Local expressions can access other local definitions and also function parameters, but recursive definitions aren't supported.
A map of function name to function. Used by probability_expression
and richness_expression
.
Local functions serve the same purpose as local expressions - they aren't visible outside of the specific prototype and they have access to other local definitions.