In other languages:

Command line parameters: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
No edit summary
Add better explanation to --sync-mods
 
(12 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Languages}}__TOC__
{{Languages}}__TOC__


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. This page pertains to version 0.17.79.
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.


{| class="wikitable"
{| class="wikitable"
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
|config file to use
| PATH
| 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
|Mod directory to use
| PATH
| 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
|Override autodetected __PATH__executable. Usually not needed except on very weird systems.
| PATH
| Override autodetected __PATH__executable. Usually not needed except on very weird systems.
|}
|}


{| class="wikitable"
{| class="wikitable"
|+ Running options
|+ Running options
|-
|-
| -s, --map2scenario arg
| -s, --map2scenario
|map to scenario conversion
| arg
| map to scenario conversion
|-
|-
| -m, --scenario2map arg
| -m, --scenario2map
|scenario to map conversion
| arg
| scenario to map conversion
|-
|-
| --apply-update arg
| --apply-update
|immediately apply update package
| arg
| immediately apply update package
|-
|-
| --create FILE
| --create
|create a new map
| FILE
| 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 <code>--generate-map-preview</code>. See data/map-gen-settings.example.json
|-
|-
| --map-gen-seed SEED
| --map-gen-seed
|Map generation seed for use with --create, --start-server-load-scenario or --generate-map-preview. Will override seed specified in map gen settings
| 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-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.
| 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
|Map settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua
| FILE
| Map settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua
|-
|-
| --preset arg
| --preset
|Name of the map generation preset to be used.
| arg
| Name of the map generation preset to be used.
|-
|-
| --generate-map-preview PATH
| --generate-map-preview
|Generate preview images of the map; PATH should name a PNG file or end with a '/' or '\' to indicate a directory.
| 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
| --generate-map-preview-random
|Number of maps to generate with a random seed using --generate-map-preview.
| COUNT
| Number of maps to generate with a random seed using --generate-map-preview.
|-
|-
| --map-preview-size SCALE
| --map-preview-size
|Size (in pixels) of map preview (default: 1024)
| SIZE
| Size (in pixels) of map preview (default: 1024)
|-
|-
| --map-preview-scale SCALE
| --map-preview-offset
|Scale (meters per pixel) of map preview (default: 1)
| X,Y
| Offset of the center of the map, in meters (default: 0,0)
|-
|-
| --map-preview-offset X,Y
| --map-preview-planet
|Offset of the center of the map, in meters (default: 0,0)
| PLANET
| Planet to generate the preview for (default: nauvis)
|-
|-
| --noise-outputs TAG,TAG...
| --report-quantities
|Indicate which variables of noise program to output
| PROTOTYPE,...
| When generating map preview, report approximate quantities of the named entity prototypes
|-
|-
| --slope-shading SHADEAMOUNT
| --threads
|Apply elevation shading to map preview
| THREADCOUNT
| Number of threads to use when generating map previews
|-
|-
| --slope-shade-property SHADEPROP
| --disable-migration-window
|Property to apply slope shading to (default: elevation)
|
| Disables the gui that is shown when opening a save with migrated content
|-
|-
| --report-quantities PROTOTYPE,...
| --instrument-mod
|When generating map preview, report approximate quantities of the named entity prototypes
| arg
| Name of a mod to enable [https://lua-api.factorio.com/latest/auxiliary/instrument.html Instrument Mode]
|-
|-
| --threads THREADCOUNT
| --sync-mods
|Number of threads to use when generating map previews
| FILE
| Sync mods with save. Note for headless servers: requires <code>service-username</code> and <code>service-token</code> to be set in the player-data.json file.
|-
|-
| --disable-migration-window
| --enable-unsafe-lua-debug-api
|Disables the gui that is shown when opening a save with migrated content
|
| Enables unsafe functions in the Lua debug library.
|-
| --host
| FILE
| Start hosting a multiplayer game
|-
|-
| --instrument-mod
| --host-interactive
|Name of a mod to enable [https://lua-api.factorio.com/latest/Instrument.html Instrument Mode]
| FILE
| Open multiplayer server settings for hosting the selecting save
|-
|-
| --start-server FILE
| --start-server
|start a multiplayer server
| FILE
| start a multiplayer server
|-
|-
| --start-server-load-scenario [MOD/]NAME
| --start-server-load-scenario
|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.
| [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-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
|run a save until given map tick
| TICK
| run a save until given map tick
|-
|-
| --benchmark FILE
| --benchmark
|load save and run benchmark
| FILE
| load save and run benchmark
|-
|-
| --benchmark-ticks N
| --benchmark-ticks
|number of ticks for benchmarking. Default is 1000
| N
| number of ticks for benchmarking. Default is 1000
|-
|-
| --benchmark-runs N
| --benchmark-runs
|how often the number of ticks will be run, map will reload after each run. Default is 1
| N
| how often the number of ticks will be run, map will reload after each run. Default is 1
|-
|-
| --benchmark-verbose timings
| --benchmark-verbose
|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.
| timings
| comma separated list of timings to output each tick. "all", "timestamp" as well as all other values seen in the debug view are allowed here. An empty string disabled verbose benchmarking.
|-
|-
| --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
|path of file to which rendering performance statistics measurements should be saved. Special tags {api}, {hw}, {time} and {tag} will be replaced.
| 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
| --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
|start factorio and connect to address
|-
|-
| --password PASSWORD
| --report-autogenerated-icon-mipmaps
|the password to use when using mp-connect (if any)
|
| Report which icons will have generated mipmaps.
|-
|-
| --heavy
| --log-shared-tile-layers
|run the game in heavy mode if singleplayer with graphics (heavy mode is related to investigating desyncs, see [[Desynchronization#Using_heavy_mode_command]])
|
| After loading prototypes logs which tile layers are shared by multiple prototypes and lists the prototypes that share them.
|-
|-
| --load-game FILE
| --log-spritesheets-to-optimize
|start Factorio and load a game in singleplayer
| N
| Logs N spritesheets that seem to have some nearly transparent noise, and could be made much smaller if the noise was cleaned up.
|-
|-
| --load-scenario [MOD/]NAME
| --mp-connect
|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.
| ADDRESS
| start factorio and connect to address
|-
|-
| --benchmark-graphics FILE
| --password
|load save and run it with graphics for benchmark-ticks number of ticks as normal game would
| PASSWORD
| the password to use when using mp-connect (if any)
|-
|-
| --benchmark-frame FILE
| --heavy
|load save and benchmark graphics rendering of single frame (prepare + render) without updating the game
|
|-
| run the game in heavy mode if singleplayer with graphics. (heavy mode is related to investigating desyncs, see [[Desynchronization#Using_heavy_mode_command]])
| --force-opengl
|use OpenGL for rendering (windows only)
|-
|-
| --force-d3d
| --load-game
|use Direct3D for rendering (windows only)
| FILE
| start Factorio and load a game in singleplayer
|-
|-
| --d3d-adapter ID
| --load-scenario
|adapter which should be used to initialized Direct3D (windows only)
| [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.
|-
|-
| --d3d-feature-level
| --benchmark-graphics
|override feature level (11, 10.1, 10) (windows only)
| FILE
| load save and run it with graphics for benchmark-ticks number of ticks as normal game would
|-
|-
| --dxgi-blit-model
| --benchmark-frame
|force Blit presentation mode (windows only)
| FILE
|-
| load save and benchmark graphics rendering of single frame (prepare + render) without updating the game
| --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
| --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
|start game in windowed mode (saved to configuration)
|
| start game in windowed mode (saved to configuration)
|-
|-
| --max-texture-size N
| --max-texture-size
|maximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048
| N
| 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
|accepted values: high, normal, low, very-low. low and very-low are deprecated and are migrated to normal.
| arg
| accepted values: high, medium
|-
|-
| --video-memory-usage arg
| --video-memory-usage
|accepted values: all, high, medium, low
| arg
| accepted values: all, high, medium, low
|-
|-
| --force-graphics-preset arg
| --force-graphics-preset
|accepted values: very-low, low, mac-with-low-ram, medium-with-low-vram, medium, high, very-high, extreme
| arg
| 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)
| arg
| 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
|Desired window resolution. For example "1680x1050". Or "maximized"
| arg
| 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
|Enable/disable sprite atlas cache.
|
| Enable/disable sprite atlas cache.
|-
| --nogamepad
|
| Disable gamepad(controller) support
|}
|}


{| class="wikitable"
{| class="wikitable"
|+ Server options
|+ Server options
|-
|-
| --port N
| --port
|network port to use
| N
| network port to use
|-
|-
| --bind ADDRESS[:PORT]
| --bind
|IP address (and optionally port) to bind to
| ADDRESS[:PORT]
| IP address (and optionally port) to bind to
|-
|-
| --rcon-port N
| --rcon-port
|Port to use for RCON
| N
| Port to use for RCON
|-
|-
| --rcon-bind ADDRESS:PORT
| --rcon-bind
|IP address and port to use for RCON
| ADDRESS:PORT
| IP address and port to use for RCON
|-
|-
| --rcon-password PASSWORD
| --rcon-password
|Password for RCON
| PASSWORD
| Password for RCON
|-
|-
| --server-settings FILE
| --server-settings
|Path to file with server settings. See data/server-settings.example.json
| FILE
| Path to file with server settings. See data/server-settings.example.json
|-
|-
| --use-authserver-bans BOOL
| --use-server-whitelist
|Verify that connecting players are not banned from multiplayer and inform Factorio.com about ban/unban commands.
|
| If the whitelist should be used.
|-
|-
| --use-server-whitelist BOOL
| --use-authserver-bans
|If the whitelist should be used.
|
| Verify that connecting players are not banned from multiplayer and inform Factorio.com about ban/unban commands.
|-
|-
| --server-whitelist FILE
| --server-whitelist
|Path to file with server whitelist.
| FILE
| Path to file with server whitelist.
|-
|-
| --server-banlist FILE
| --server-banlist
|Path to file with server banlist.
| FILE
| Path to file with server banlist.
|-
|-
| --server-adminlist FILE
| --server-adminlist
|Path to file with server adminlist.
| FILE
| Path to file with server adminlist.
|-
|-
| --console-log FILE
| --console-log
|Path to file where a copy of the server's log will be stored
| FILE
| Path to file where a copy of the server's log will be stored
|-
|-
| --server-id FILE
| --server-id
|Path where server ID will be stored or read from
| FILE
| Path where server ID will be stored or read from
|}
|}
=== Boolean options ===
Parameters shown above with a BOOL option must be formatted as <code>[parameter]=true</code> or <code>[parameter]=false</code>. For example,
  --fullscreen=false
will start the game in windowed (not fullscreen) mode.


=== Multiplayer ===
=== Multiplayer ===
Line 320: Line 408:
</pre>
</pre>


Note that this is the same format as [https://lua-api.factorio.com/latest/Concepts.html#MapGenSettings MapGenSettings] that are modifiable from Lua. Everything in the file is optional.
Note that this is the same format as [https://lua-api.factorio.com/latest/concepts/MapGenSettings.html MapGenSettings] that are modifiable from Lua. Everything in the file is optional.


Creating a custom save:
Creating a custom save:
Line 336: Line 424:
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:
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>)))
  /c helpers.write_file('map.txt', helpers.table_to_json(helpers.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:
Then open the script_output folder in the [[user data directory]] and open map.txt - it will look like this:
Line 346: Line 434:
== See also ==
== See also ==
* [[Console]]
* [[Console]]
{{C|Modding}}

Latest revision as of 12:45, 25 January 2025

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 SIZE Size (in pixels) of map preview (default: 1024)
--map-preview-offset X,Y Offset of the center of the map, in meters (default: 0,0)
--map-preview-planet PLANET Planet to generate the preview for (default: nauvis)
--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 arg Name of a mod to enable Instrument Mode
--sync-mods FILE Sync mods with save. Note for headless servers: requires service-username and service-token to be set in the player-data.json file.
--enable-unsafe-lua-debug-api Enables unsafe functions in the Lua debug library.
--host FILE Start hosting a multiplayer game
--host-interactive FILE Open multiplayer server settings for hosting the selecting save
--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 timings to output each tick. "all", "timestamp" as well as all other values seen in the debug view are allowed here. An empty string disabled verbose benchmarking.
--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.
--report-autogenerated-icon-mipmaps Report which icons will have generated mipmaps.
--log-shared-tile-layers After loading prototypes logs which tile layers are shared by multiple prototypes and lists the prototypes that share them.
--log-spritesheets-to-optimize N Logs N spritesheets that seem to have some nearly transparent noise, and could be made much smaller if the noise was cleaned up.
--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
--debug-graphics enables debugging layer for graphics API. If DirectX is used DirectX SDK needs to be installed for this to work.
--fullscreen 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, medium
--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 arg 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 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-server-whitelist If the whitelist should be used.
--use-authserver-bans Verify that connecting players are not banned from multiplayer and inform Factorio.com about ban/unban commands.
--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 helpers.write_file('map.txt', helpers.table_to_json(helpers.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