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

# Factorio Runtime Docs Version 2.0.77

# MapGenSettings - Runtime Docs

## MapGenSettings :: table

When reading MapGenSettings, all properties will always be present, but they can be omitted when writing.

#### Table fields

autoplace_controls | :: dictionary[string → AutoplaceControl]? | Indexed by autoplace control prototype name.
Indexed by autoplace control prototype name.
default_enable_all_autoplace_controls | :: boolean? | Whether undefined `autoplace_controls` should fall back to the default controls or not. Defaults to `true`.
Whether undefined `autoplace_controls` should fall back to the default controls or not. Defaults to `true`.
autoplace_settings | :: dictionary[`"entity"` or `"tile"` or `"decorative"` → AutoplaceSettings]? | Each setting in this dictionary maps the string type to the settings for that type.
Each setting in this dictionary maps the string type to the settings for that type.
seed | :: uint32? | ) The random seed used to generated this map.
) The random seed used to generated this map.
width | :: uint32? | ) Width in tiles. If `0`, the map has 'infinite' width, with the actual limitation being one million tiles in each direction from the center.
) Width in tiles. If `0`, the map has 'infinite' width, with the actual limitation being one million tiles in each direction from the center.
height | :: uint32? | Height in tiles. If `0`, the map has 'infinite' height, with the actual limitation being one million tiles in each direction from the center.
Height in tiles. If `0`, the map has 'infinite' height, with the actual limitation being one million tiles in each direction from the center.
starting_area | :: MapGenSize? | Size of the starting area. Defaults to `1`.
Size of the starting area. Defaults to `1`.
starting_points | :: array[MapPosition]? | Positions of the starting areas.
Positions of the starting areas.
peaceful_mode | :: boolean? | Whether enemy creatures will not attack unless the player first attacks them.
Whether enemy creatures will not attack unless the player first attacks them.
no_enemies_mode | :: boolean? | Whether enemy creatures will not naturally spawn from spawners, map gen, or trigger effects.
Whether enemy creatures will not naturally spawn from spawners, map gen, or trigger effects.
property_expression_names | :: PropertyExpressionNames? | Overrides for tile property value generators.
Overrides for tile property value generators.
cliff_settings | :: CliffPlacementSettings? | Map generation settings for entities of the type "cliff".
Map generation settings for entities of the type "cliff".
territory_settings | :: TerritorySettings? |

#### Examples

    -- Assuming a NamedNoiseExpression with the name "my-alternate-grass1-probability" is defined...
    local surface = game.player.surface
    local mgs = surface.map_gen_settings
    mgs.property_expression_names["tile:grass1:probability"] = "my-alternate-grass1-probability"
    surface.map_gen_settings = mgs
    -- ...would override the probability of grass1 being placed at any given point on the current surface.

    -- To make there be no deep water on (newly generated chunks) a surface
    local surface = game.player.surface
    local mgs = surface.map_gen_settings
    mgs.property_expression_names["tile:deepwater:probability"] = -1000
    surface.map_gen_settings = mgs
    -- This does not require a NamedNoiseExpression to be defined, since literal numbers (and strings naming literal
    -- numbers, e.g. `"123"`) are understood to stand for constant value expressions.

Concept used in

- LuaGameScript::create_surface()
- LuaGameScript::default_map_gen_settings
- LuaSpaceLocationPrototype::map_gen_settings
- LuaSurface::map_gen_settings
- MapExchangeStringData
- MapGenPreset