Home

AutoplaceSpecification

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.

Type

struct

Properties

control

Name of the AutoplaceControl (row in the map generator GUI) that applies to this entity.

default_enabled

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.

force

Force of the placed entity. Can be a custom force name. Only relevant for EntityWithOwnerPrototype.

order

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.

placement_density

For entities and decoratives, how many times to attempt to place on each tile. Probability and collisions are taken into account each attempt.

tile_restriction

Restricts tiles or tile transitions the entity can appear on.

probability_expression

Provides a noise expression that will be evaluated at every point on the map to determine probability.

richness_expression

If specified, provides a noise expression that will be evaluated to determine richness. Otherwise, probability_expression will be used instead.

local_expressions

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.

local_functions

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.