In other languages:

Command line parameters: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
m (Clarify the usage of boolean options)
(Separate arg type from arg name)
 
Line 7: Line 7:
|-
|-
| -h, --help
| -h, --help
|
| display help
| display help
|-
|-
| --version
| --version
|
|show version information
|show version information
|-
|-
| -v, --verbose
| -v, --verbose
|
|enable verbose logging
|enable verbose logging
|-
|-
| -c, --config PATH
| -c, --config
| PATH
|config file to use
|config file to use
|-
|-
| --no-log-rotation
| --no-log-rotation
|
|don't rotate log file
|don't rotate log file
|-
|-
| --mod-directory PATH
| --mod-directory  
| PATH
|Mod directory to use
|Mod directory to use
|-
|-
| --check-unused-prototype-data
| --check-unused-prototype-data
|
|Print a warning for all prototype values that were not accessed. Note for mod authors: If an entry is unused and is a table that contains the key/value pair 'ignore' with the value 'true' then the entire entry is ignored.
|Print a warning for all prototype values that were not accessed. Note for mod authors: If an entry is unused and is a table that contains the key/value pair 'ignore' with the value 'true' then the entire entry is ignored.
|-
|-
| --executable-path PATH
| --executable-path  
| PATH
|Override autodetected __PATH__executable. Usually not needed except on very weird systems.
|Override autodetected __PATH__executable. Usually not needed except on very weird systems.
|}
|}
Line 34: Line 42:
|+ Running options
|+ Running options
|-
|-
| -s, --map2scenario arg
| -s, --map2scenario
| arg
|map to scenario conversion
|map to scenario conversion
|-
|-
| -m, --scenario2map arg
| -m, --scenario2map  
| arg
|scenario to map conversion
|scenario to map conversion
|-
|-
| --apply-update arg
| --apply-update  
| arg
|immediately apply update package
|immediately apply update package
|-
|-
| --create FILE
| --create  
| FILE
|create a new map
|create a new map
|-
|-
| --map-gen-settings FILE
| --map-gen-settings
|Map generation settings for use with --create, --start-server-load-scenario or --generate-map-preview. See data/map-gen-settings.example.json
| FILE
|Map generation settings for use with <code>--create</code>, <code>--start-server-load-scenario</code> or --generate-map-preview. See data/map-gen-settings.example.json
|-
|-
| --map-gen-seed SEED
| --map-gen-seed
| SEED
|Map generation seed for use with --create, --start-server-load-scenario or --generate-map-preview. Will override seed specified in map gen settings
|Map generation seed for use with --create, --start-server-load-scenario or --generate-map-preview. Will override seed specified in map gen settings
|-
|-
| --map-gen-seed-max SEED
| --map-gen-seed-max  
| SEED
|Map generation seed for use with --generate-map-preview to generate multiple previews using every second seed in the interval from map-gen-seed to map-gen-seed-max.
|Map generation seed for use with --generate-map-preview to generate multiple previews using every second seed in the interval from map-gen-seed to map-gen-seed-max.
|-
|-
| --map-settings FILE
| --map-settings  
| FILE
|Map settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua
|Map settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua
|-
|-
| --preset arg
| --preset  
| arg
|Name of the map generation preset to be used.
|Name of the map generation preset to be used.
|-
|-
| --generate-map-preview PATH
| --generate-map-preview
| PATH
|Generate preview images of the map; PATH should name a PNG file or end with a '/' or '\' to indicate a directory.
|Generate preview images of the map; PATH should name a PNG file or end with a '/' or '\' to indicate a directory.
|-
|-
| --generate-map-preview-random COUNT
| --generate-map-preview-random
| COUNT
|Number of maps to generate with a random seed using --generate-map-preview.
|Number of maps to generate with a random seed using --generate-map-preview.
|-
|-
| --map-preview-size SCALE
| --map-preview-size
| SCALE
|Size (in pixels) of map preview (default: 1024)
|Size (in pixels) of map preview (default: 1024)
|-
|-
| --map-preview-scale SCALE
| --map-preview-scale
| SCALE
|Scale (meters per pixel) of map preview (default: 1)
|Scale (meters per pixel) of map preview (default: 1)
|-
|-
| --map-preview-offset X,Y
| --map-preview-offset
| X,Y
|Offset of the center of the map, in meters (default: 0,0)
|Offset of the center of the map, in meters (default: 0,0)
|-
|-
| --noise-outputs TAG,TAG...
| --noise-outputs
| TAG,TAG...
|Indicate which variables of noise program to output
|Indicate which variables of noise program to output
|-
|-
| --slope-shading SHADEAMOUNT
| --slope-shading
| SHADEAMOUNT
|Apply elevation shading to map preview
|Apply elevation shading to map preview
|-
|-
| --slope-shade-property SHADEPROP
| --slope-shade-property
| SHADEPROP
|Property to apply slope shading to (default: elevation)
|Property to apply slope shading to (default: elevation)
|-
|-
| --report-quantities PROTOTYPE,...
| --report-quantities
| PROTOTYPE,...
|When generating map preview, report approximate quantities of the named entity prototypes
|When generating map preview, report approximate quantities of the named entity prototypes
|-
|-
| --threads THREADCOUNT
| --threads
| THREADCOUNT
|Number of threads to use when generating map previews
|Number of threads to use when generating map previews
|-
|-
| --disable-migration-window
| --disable-migration-window
|
|Disables the gui that is shown when opening a save with migrated content
|Disables the gui that is shown when opening a save with migrated content
|-
|-
| --instrument-mod
| --instrument-mod
|
|Name of a mod to enable [https://lua-api.factorio.com/latest/Instrument.html Instrument Mode]
|Name of a mod to enable [https://lua-api.factorio.com/latest/Instrument.html Instrument Mode]
|-
|-
| --start-server FILE
| --start-server  
| FILE
|start a multiplayer server
|start a multiplayer server
|-
|-
| --start-server-load-scenario [MOD/]NAME
| --start-server-load-scenario
| [MOD/]NAME
|start a multiplayer server and load the specified scenario. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.
|start a multiplayer server and load the specified scenario. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.
|-
|-
| --start-server-load-latest
| --start-server-load-latest
|
|start a multiplayer server and load the latest available save
|start a multiplayer server and load the latest available save
|-
|-
| --until-tick TICK
| --until-tick
| TICK
|run a save until given map tick
|run a save until given map tick
|-
|-
| --benchmark FILE
| --benchmark  
| FILE
|load save and run benchmark
|load save and run benchmark
|-
|-
| --benchmark-ticks N
| --benchmark-ticks
| N
|number of ticks for benchmarking. Default is 1000
|number of ticks for benchmarking. Default is 1000
|-
|-
| --benchmark-runs N
| --benchmark-runs
| N
|how often the number of ticks will be run, map will reload after each run. Default is 1
|how often the number of ticks will be run, map will reload after each run. Default is 1
|-
|-
| --benchmark-verbose timings
| --benchmark-verbose
| timings
|comma separated list of Update timings to output each tick. "all", "timestamp" as well as all other values seen in the debug show-time-usage view's Update section are allowed here. An empty string disabled verbose benchmarking. Timings are returned in nanoseconds.
|comma separated list of Update timings to output each tick. "all", "timestamp" as well as all other values seen in the debug show-time-usage view's Update section are allowed here. An empty string disabled verbose benchmarking. Timings are returned in nanoseconds.
|-
|-
| --benchmark-sanitize
| --benchmark-sanitize
|
|only output the final benchmark results
|only output the final benchmark results
|-
|-
| --benchmark-ignore-paused
| --benchmark-ignore-paused
|
|leaves the game paused if it was paused when saved. By default the game is unpaused when a benchmark starts.
|leaves the game paused if it was paused when saved. By default the game is unpaused when a benchmark starts.
|-
|-
| --output-perf-stats FILE
| --output-perf-stats  
| FILE
|path of file to which rendering performance statistics measurements should be saved. Special tags {api}, {hw}, {time} and {tag} will be replaced.
|path of file to which rendering performance statistics measurements should be saved. Special tags {api}, {hw}, {time} and {tag} will be replaced.
|-
|-
| --dump-data
| --dump-data
|
|dumps data.raw as JSON to the script output folder and exits.
|dumps data.raw as JSON to the script output folder and exits.
|-
|-
| --dump-icon-sprites
| --dump-icon-sprites
|
|dumps all icon sprites as png files to the script output folder and exits.
|dumps all icon sprites as png files to the script output folder and exits.
|-
|-
| --dump-prototype-locale
| --dump-prototype-locale
|
|dumps all prototypes name and description (if they have a valid value) to the script output folder and exits.
|dumps all prototypes name and description (if they have a valid value) to the script output folder and exits.
|-
|-
| --mp-connect ADDRESS
| --mp-connect
| ADDRESS
|start factorio and connect to address
|start factorio and connect to address
|-
|-
| --password PASSWORD
| --password
| PASSWORD
|the password to use when using mp-connect (if any)
|the password to use when using mp-connect (if any)
|-
|-
| --heavy
| --heavy
|
|run the game in heavy mode if singleplayer with graphics (heavy mode is related to investigating desyncs, see [[Desynchronization#Using_heavy_mode_command]])
|run the game in heavy mode if singleplayer with graphics (heavy mode is related to investigating desyncs, see [[Desynchronization#Using_heavy_mode_command]])
|-
|-
| --load-game FILE
| --load-game  
| FILE
|start Factorio and load a game in singleplayer
|start Factorio and load a game in singleplayer
|-
|-
| --load-scenario [MOD/]NAME
| --load-scenario
| [MOD/]NAME
|start Factorio and load the specified scenario in singleplayer. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.
|start Factorio and load the specified scenario in singleplayer. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.
|-
|-
| --benchmark-graphics FILE
| --benchmark-graphics  
| FILE
|load save and run it with graphics for benchmark-ticks number of ticks as normal game would
|load save and run it with graphics for benchmark-ticks number of ticks as normal game would
|-
|-
| --benchmark-frame FILE
| --benchmark-frame  
| FILE
|load save and benchmark graphics rendering of single frame (prepare + render) without updating the game
|load save and benchmark graphics rendering of single frame (prepare + render) without updating the game
|-
|-
| --force-opengl
| --force-opengl
|
|use OpenGL for rendering (windows only)
|use OpenGL for rendering (windows only)
|-
|-
| --force-d3d
| --force-d3d
|
|use Direct3D for rendering (windows only)
|use Direct3D for rendering (windows only)
|-
|-
| --d3d-adapter ID
| --d3d-adapter
| ID
|adapter which should be used to initialized Direct3D (windows only)
|adapter which should be used to initialized Direct3D (windows only)
|-
|-
| --d3d-feature-level
| --d3d-feature-level
|
|override feature level (11, 10.1, 10) (windows only)
|override feature level (11, 10.1, 10) (windows only)
|-
|-
| --dxgi-blit-model
| --dxgi-blit-model
|
|force Blit presentation mode (windows only)
|force Blit presentation mode (windows only)
|-
|-
| --audio-driver
| --audio-driver
|
|default = sdl = SDL's WASAPI driver (windows)/SDL's PulseAudio or ALSA driver (linux)/SDL's CoreAudio driver (mac); allegro = Allegro's DirectSound8 driver (windows)/Allegro's PulseAudio, ALSA or OSS driver (linux)/Allegro's OpenAL driver (mac); allegro-via-sdl = Allegro mixer with SDL's WASAPI driver (windows)/not supported (linux + mac)
|default = sdl = SDL's WASAPI driver (windows)/SDL's PulseAudio or ALSA driver (linux)/SDL's CoreAudio driver (mac); allegro = Allegro's DirectSound8 driver (windows)/Allegro's PulseAudio, ALSA or OSS driver (linux)/Allegro's OpenAL driver (mac); allegro-via-sdl = Allegro mixer with SDL's WASAPI driver (windows)/not supported (linux + mac)
|-
|-
| --debug-graphics
| --debug-graphics
|
|enables debugging layer for graphics API. If DirectX is used DirectX SDK needs to be installed for this to work.
|enables debugging layer for graphics API. If DirectX is used DirectX SDK needs to be installed for this to work.
|-
|-
| --fullscreen BOOL
| --fullscreen
| BOOL
|start game in windowed mode (saved to configuration)
|start game in windowed mode (saved to configuration)
|-
|-
| --max-texture-size N
| --max-texture-size
| N
|maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048
|maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048
|-
|-
| --graphics-quality arg
| --graphics-quality  
| arg
|accepted values: high, normal, low, very-low. low and very-low are deprecated and are migrated to normal.
|accepted values: high, normal, low, very-low. low and very-low are deprecated and are migrated to normal.
|-
|-
| --video-memory-usage arg
| --video-memory-usage  
| arg
|accepted values: all, high, medium, low
|accepted values: all, high, medium, low
|-
|-
| --force-graphics-preset arg
| --force-graphics-preset  
| arg
|accepted values: very-low, low, mac-with-low-ram, medium-with-low-vram, medium, high, very-high, extreme
|accepted values: very-low, low, mac-with-low-ram, medium-with-low-vram, medium, high, very-high, extreme
|-
|-
| --gfx-safe-mode
| --gfx-safe-mode
|
|resets some graphics settings to values that should work on most configurations
|resets some graphics settings to values that should work on most configurations
|-
|-
| --low-vram
| --low-vram
|
|sprites that are not put into sprite atlases won't be allocated as texture objects
|sprites that are not put into sprite atlases won't be allocated as texture objects
|-
|-
| --shader
| --shader
|
|enable/disable shader postprocessing (saved to configuration)
|enable/disable shader postprocessing (saved to configuration)
|-
|-
| --disable-audio
| --disable-audio
|
|Disable audio. Mainly for faster startup during development.
|Disable audio. Mainly for faster startup during development.
|-
|-
| --window-size arg
| --window-size  
| arg
|Desired window resolution. For example "1680x1050". Or "maximized"
|Desired window resolution. For example "1680x1050". Or "maximized"
|-
|-
| --single-thread-loading
| --single-thread-loading
|
|Disables loading of sprites in multiple threads.
|Disables loading of sprites in multiple threads.
|-
|-
| --cache-sprite-atlas BOOL
| --cache-sprite-atlas  
| BOOL
|Enable/disable sprite atlas cache.
|Enable/disable sprite atlas cache.
|-
|-
| --nogamepad
| --nogamepad
|
|Disable gamepad(controller) support
|Disable gamepad(controller) support
|}
|}
Line 224: Line 294:
|+ Server options
|+ Server options
|-
|-
| --port N
| --port
| N
|network port to use
|network port to use
|-
|-
| --bind ADDRESS[:PORT]
| --bind
| ADDRESS[:PORT]
|IP address (and optionally port) to bind to
|IP address (and optionally port) to bind to
|-
|-
| --rcon-port N
| --rcon-port
| N
|Port to use for RCON
|Port to use for RCON
|-
|-
| --rcon-bind ADDRESS:PORT
| --rcon-bind
| ADDRESS:PORT
|IP address and port to use for RCON
|IP address and port to use for RCON
|-
|-
| --rcon-password PASSWORD
| --rcon-password
| PASSWORD
|Password for RCON
|Password for RCON
|-
|-
| --server-settings FILE
| --server-settings  
| FILE
|Path to file with server settings. See data/server-settings.example.json
|Path to file with server settings. See data/server-settings.example.json
|-
|-
| --use-authserver-bans BOOL
| --use-authserver-bans  
| BOOL
|Verify that connecting players are not banned from multiplayer and inform Factorio.com about ban/unban commands.
|Verify that connecting players are not banned from multiplayer and inform Factorio.com about ban/unban commands.
|-
|-
| --use-server-whitelist BOOL
| --use-server-whitelist  
| BOOL
|If the whitelist should be used.
|If the whitelist should be used.
|-
|-
| --server-whitelist FILE
| --server-whitelist  
| FILE
|Path to file with server whitelist.
|Path to file with server whitelist.
|-
|-
| --server-banlist FILE
| --server-banlist  
| FILE
|Path to file with server banlist.
|Path to file with server banlist.
|-
|-
| --server-adminlist FILE
| --server-adminlist  
| FILE
|Path to file with server adminlist.
|Path to file with server adminlist.
|-
|-
| --console-log FILE
| --console-log  
| FILE
|Path to file where a copy of the server's log will be stored
|Path to file where a copy of the server's log will be stored
|-
|-
| --server-id FILE
| --server-id  
| FILE
|Path where server ID will be stored or read from
|Path where server ID will be stored or read from
|}
|}

Latest revision as of 12:49, 4 September 2024

Command line parameters can be used to set settings in the command line before the game launches, this is useful mainly for advanced users or server hosts.

General options
-h, --help display help
--version show version information
-v, --verbose enable verbose logging
-c, --config PATH config file to use
--no-log-rotation don't rotate log file
--mod-directory PATH Mod directory to use
--check-unused-prototype-data Print a warning for all prototype values that were not accessed. Note for mod authors: If an entry is unused and is a table that contains the key/value pair 'ignore' with the value 'true' then the entire entry is ignored.
--executable-path PATH Override autodetected __PATH__executable. Usually not needed except on very weird systems.
Running options
-s, --map2scenario arg map to scenario conversion
-m, --scenario2map arg scenario to map conversion
--apply-update arg immediately apply update package
--create FILE create a new map
--map-gen-settings FILE Map generation settings for use with --create, --start-server-load-scenario or --generate-map-preview. See data/map-gen-settings.example.json
--map-gen-seed SEED Map generation seed for use with --create, --start-server-load-scenario or --generate-map-preview. Will override seed specified in map gen settings
--map-gen-seed-max SEED Map generation seed for use with --generate-map-preview to generate multiple previews using every second seed in the interval from map-gen-seed to map-gen-seed-max.
--map-settings FILE Map settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua
--preset arg Name of the map generation preset to be used.
--generate-map-preview PATH Generate preview images of the map; PATH should name a PNG file or end with a '/' or '\' to indicate a directory.
--generate-map-preview-random COUNT Number of maps to generate with a random seed using --generate-map-preview.
--map-preview-size SCALE Size (in pixels) of map preview (default: 1024)
--map-preview-scale SCALE Scale (meters per pixel) of map preview (default: 1)
--map-preview-offset X,Y Offset of the center of the map, in meters (default: 0,0)
--noise-outputs TAG,TAG... Indicate which variables of noise program to output
--slope-shading SHADEAMOUNT Apply elevation shading to map preview
--slope-shade-property SHADEPROP Property to apply slope shading to (default: elevation)
--report-quantities PROTOTYPE,... When generating map preview, report approximate quantities of the named entity prototypes
--threads THREADCOUNT Number of threads to use when generating map previews
--disable-migration-window Disables the gui that is shown when opening a save with migrated content
--instrument-mod Name of a mod to enable Instrument Mode
--start-server FILE start a multiplayer server
--start-server-load-scenario [MOD/]NAME start a multiplayer server and load the specified scenario. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.
--start-server-load-latest start a multiplayer server and load the latest available save
--until-tick TICK run a save until given map tick
--benchmark FILE load save and run benchmark
--benchmark-ticks N number of ticks for benchmarking. Default is 1000
--benchmark-runs N how often the number of ticks will be run, map will reload after each run. Default is 1
--benchmark-verbose timings comma separated list of Update timings to output each tick. "all", "timestamp" as well as all other values seen in the debug show-time-usage view's Update section are allowed here. An empty string disabled verbose benchmarking. Timings are returned in nanoseconds.
--benchmark-sanitize only output the final benchmark results
--benchmark-ignore-paused leaves the game paused if it was paused when saved. By default the game is unpaused when a benchmark starts.
--output-perf-stats FILE path of file to which rendering performance statistics measurements should be saved. Special tags {api}, {hw}, {time} and {tag} will be replaced.
--dump-data dumps data.raw as JSON to the script output folder and exits.
--dump-icon-sprites dumps all icon sprites as png files to the script output folder and exits.
--dump-prototype-locale dumps all prototypes name and description (if they have a valid value) to the script output folder and exits.
--mp-connect ADDRESS start factorio and connect to address
--password PASSWORD the password to use when using mp-connect (if any)
--heavy run the game in heavy mode if singleplayer with graphics (heavy mode is related to investigating desyncs, see Desynchronization#Using_heavy_mode_command)
--load-game FILE start Factorio and load a game in singleplayer
--load-scenario [MOD/]NAME start Factorio and load the specified scenario in singleplayer. The scenario is looked for inside the given mod. If no mod is given, it is looked for in the top-level scenarios directory.
--benchmark-graphics FILE load save and run it with graphics for benchmark-ticks number of ticks as normal game would
--benchmark-frame FILE load save and benchmark graphics rendering of single frame (prepare + render) without updating the game
--force-opengl use OpenGL for rendering (windows only)
--force-d3d use Direct3D for rendering (windows only)
--d3d-adapter ID adapter which should be used to initialized Direct3D (windows only)
--d3d-feature-level override feature level (11, 10.1, 10) (windows only)
--dxgi-blit-model force Blit presentation mode (windows only)
--audio-driver default = sdl = SDL's WASAPI driver (windows)/SDL's PulseAudio or ALSA driver (linux)/SDL's CoreAudio driver (mac); allegro = Allegro's DirectSound8 driver (windows)/Allegro's PulseAudio, ALSA or OSS driver (linux)/Allegro's OpenAL driver (mac); allegro-via-sdl = Allegro mixer with SDL's WASAPI driver (windows)/not supported (linux + mac)
--debug-graphics enables debugging layer for graphics API. If DirectX is used DirectX SDK needs to be installed for this to work.
--fullscreen BOOL start game in windowed mode (saved to configuration)
--max-texture-size N maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048
--graphics-quality arg accepted values: high, normal, low, very-low. low and very-low are deprecated and are migrated to normal.
--video-memory-usage arg accepted values: all, high, medium, low
--force-graphics-preset arg accepted values: very-low, low, mac-with-low-ram, medium-with-low-vram, medium, high, very-high, extreme
--gfx-safe-mode resets some graphics settings to values that should work on most configurations
--low-vram sprites that are not put into sprite atlases won't be allocated as texture objects
--shader enable/disable shader postprocessing (saved to configuration)
--disable-audio Disable audio. Mainly for faster startup during development.
--window-size arg Desired window resolution. For example "1680x1050". Or "maximized"
--single-thread-loading Disables loading of sprites in multiple threads.
--cache-sprite-atlas BOOL Enable/disable sprite atlas cache.
--nogamepad Disable gamepad(controller) support
Server options
--port N network port to use
--bind ADDRESS[:PORT] IP address (and optionally port) to bind to
--rcon-port N Port to use for RCON
--rcon-bind ADDRESS:PORT IP address and port to use for RCON
--rcon-password PASSWORD Password for RCON
--server-settings FILE Path to file with server settings. See data/server-settings.example.json
--use-authserver-bans BOOL Verify that connecting players are not banned from multiplayer and inform Factorio.com about ban/unban commands.
--use-server-whitelist BOOL If the whitelist should be used.
--server-whitelist FILE Path to file with server whitelist.
--server-banlist FILE Path to file with server banlist.
--server-adminlist FILE Path to file with server adminlist.
--console-log FILE Path to file where a copy of the server's log will be stored
--server-id FILE Path where server ID will be stored or read from

Boolean options

Parameters shown above with a BOOL option must be formatted as [parameter]=true or [parameter]=false. For example,

 --fullscreen=false

will start the game in windowed (not fullscreen) mode.

Multiplayer

 --start-server SAVE

Will start a Headless (Dedicated) server, with no GUI.

 --mp-connect ADDRESS

ADDRESS is the IP:port of the remote host. Port is optional. Examples:

 ./factorio --mp-connect 192.168.1.101
 ./factorio --mp-connect 192.168.1.101:2345

As above, port can be specified by placing the port number after a colon in the address.

Creating a map from custom settings

Sometimes it's useful to create a new game with map and/or map generator settings stored in a JSON file rather than going through the in-game map settings screen. One reason is that by editing the settings directly it is possible to set settings outside the range normally available from the GUI.

To do this, Factorio is run from the command-line, and a JSON file containing the map generator settings and a JSON file containing map settings (if customizing them) are needed.

Example for custom generator settings:

{
    "terrain_segmentation": 0.5,
    "water": "2",
    "width": 0,
    "height": 0,
    "starting_area": "normal",
    "peaceful_mode": false,
    "autoplace_controls":
    {
        "coal": {"frequency": 1, "size": 2, "richness": 0.5},
        "copper-ore": {"frequency": "low", "size": "normal", "richness": "high"},
        "crude-oil": {"frequency": "normal", "size": "normal", "richness": "normal"},
        "enemy-base": {"frequency": "normal", "size": "normal", "richness": "normal"},
        "iron-ore": {"frequency": "normal", "size": "normal", "richness": "normal"},
        "stone": {"frequency": "normal", "size": 0, "richness": "normal"},
        "uranium-ore": {"frequency": "normal", "size": "none", "richness": "normal"}
    },

    "cliff_settings":
    {
        "name": "cliff",                
        "cliff_elevation_0": 30,        
        "cliff_elevation_interval": 20, 
        "richness": 1                   
    },

    "property_expression_names":
    {
        "elevation": "0_16-elevation",
        "temperature": "35"
    },
    
    "seed": null
}

Note that this is the same format as MapGenSettings that are modifiable from Lua. Everything in the file is optional.

Creating a custom save:

"C:\Program Files\Factorio\bin\x64\Factorio.exe" --create stuff-seed123.zip --map-gen-settings map-gen-settings.json --map-gen-seed 123

Generating a map preview:

"C:\Program Files\Factorio\bin\x64\Factorio.exe" --generate-map-preview preview-seed123.png --map-gen-settings map-gen-settings.json --map-gen-seed 123

Creating the JSON files from a map exchange string

It can be useful to create the initial JSON files from a known map exchange string instead of creating them from scratch. To convert the map exchange string to JSON, open the game and run the following command with your map exchange string:

/c game.write_file('map.txt', game.table_to_json(game.parse_map_exchange_string("<your exchange string here>")))

Then open the script_output folder in the user data directory and open map.txt - it will look like this:

{"map_settings":{ ...<MAP_SETTINGS> ... },"map_gen_settings":{ ...<MAP_GEN_SETTINGS>... }}

Copy the { ...<MAP_SETTINGS> ... } section into a new file called 'map-settings.json' in the desired location. Copy the { ...<MAP_GEN_SETTINGS> ... } section section into a new file called 'map-gen-settings.json' in the desired location.

See also