Factorio.com|Forums|Wiki|Mod Portal|API Docs

# Factorio Runtime Docs Version 2.0.77

# EnemyExpansionMapSettings - Runtime Docs

## EnemyExpansionMapSettings :: table

Candidate chunks are given scores to determine which one of them should be expanded into. This score takes into account various settings noted below. The iteration is over a square region centered around the chunk for which the calculation is done, and includes the central chunk as well. Distances are calculated as Manhattan distance.

The pseudocode algorithm to determine a chunk's score is as follows:

    player = 0
    for neighbour in all chunks within enemy_building_influence_radius from chunk:
      player += number of player buildings on neighbour
        * building_coefficient
        * neighbouring_chunk_coefficient^distance(chunk, neighbour)
    base = 0
    for neighbour in all chunk within friendly_base_influence_radius from chunk:
      base += num of enemy bases on neighbour
        * other_base_coefficient
        * neighbouring_base_chunk_coefficient^distance(chunk, neighbour)
    score(chunk) = 1 / (1 + player + base)

#### Table fields

enabled | :: boolean | Whether enemy expansion is enabled at all.
Whether enemy expansion is enabled at all.
max_expansion_distance | :: uint32 | Distance in chunks from the furthest base around to prevent expansions from reaching too far into the player's territory. Defaults to `7`.
Distance in chunks from the furthest base around to prevent expansions from reaching too far into the player's territory. Defaults to `7`.
friendly_base_influence_radius | :: uint32 | Defaults to `2`.
Defaults to `2`.
enemy_building_influence_radius | :: uint32 | Defaults to `2`.
Defaults to `2`.
building_coefficient | :: double | Defaults to `0.1`.
Defaults to `0.1`.
other_base_coefficient | :: double | Defaults to `2.0`.
Defaults to `2.0`.
neighbouring_chunk_coefficient | :: double | Defaults to `0.5`.
Defaults to `0.5`.
neighbouring_base_chunk_coefficient | :: double | Defaults to `0.4`.
Defaults to `0.4`.
max_colliding_tiles_coefficient | :: double | A chunk has to have at most this high of a percentage of unbuildable tiles for it to be considered a candidate to avoid chunks full of water as candidates. Defaults to `0.9`, or 90%.
A chunk has to have at most this high of a percentage of unbuildable tiles for it to be considered a candidate to avoid chunks full of water as candidates. Defaults to `0.9`, or 90%.
settler_group_min_size | :: uint32 | The minimum size of a biter group that goes to build a new base. This is multiplied by the evolution factor. Defaults to `5`.
The minimum size of a biter group that goes to build a new base. This is multiplied by the evolution factor. Defaults to `5`.
settler_group_max_size | :: uint32 | The maximum size of a biter group that goes to build a new base. This is multiplied by the evolution factor. Defaults to `20`.
The maximum size of a biter group that goes to build a new base. This is multiplied by the evolution factor. Defaults to `20`.
min_expansion_cooldown | :: uint32 | The minimum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `4*3 600=14 400` ticks.
The minimum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `4*3 600=14 400` ticks.
max_expansion_cooldown | :: uint32 | The maximum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `60*3 600=216 000` ticks.
The maximum time between expansions in ticks. The actual cooldown is adjusted to the current evolution levels. Defaults to `60*3 600=216 000` ticks.

Concept used in

- AdvancedMapGenSettings
- MapAndDifficultySettings