Command line parameters - Factorio Wiki (2024)

Contents

  • 1 Multiplayer
  • 2 Creating a map from custom settings
    • 2.1 Creating the JSON files from a map exchange string
  • 3 See also

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, --helpdisplay help
--versionshow version information
-v, --verboseenable verbose logging
-c, --config PATHconfig file to use
--no-log-rotationdon't rotate log file
--mod-directory PATHMod directory to use
--check-unused-prototype-dataPrint 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 PATHOverride autodetected __PATH__executable. Usually not needed except on very weird systems.
Running options
-s, --map2scenario argmap to scenario conversion
-m, --scenario2map argscenario to map conversion
--apply-update argimmediately apply update package
--create FILEcreate a new map
--map-gen-settings FILEMap generation settings for use with --create, --start-server-load-scenario or --generate-map-preview. See data/map-gen-settings.example.json
--map-gen-seed SEEDMap 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 SEEDMap 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 FILEMap settings for use with --create or --start-server-load-scenario. See data/base/prototypes/map-settings.lua
--preset argName of the map generation preset to be used.
--generate-map-preview PATHGenerate preview images of the map; PATH should name a PNG file or end with a '/' or '\' to indicate a directory.
--generate-map-preview-random COUNTNumber of maps to generate with a random seed using --generate-map-preview.
--map-preview-size SCALESize (in pixels) of map preview (default: 1024)
--map-preview-scale SCALEScale (meters per pixel) of map preview (default: 1)
--map-preview-offset X,YOffset 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 SHADEAMOUNTApply elevation shading to map preview
--slope-shade-property SHADEPROPProperty to apply slope shading to (default: elevation)
--report-quantities PROTOTYPE,...When generating map preview, report approximate quantities of the named entity prototypes
--threads THREADCOUNTNumber of threads to use when generating map previews
--disable-migration-windowDisables the gui that is shown when opening a save with migrated content
--instrument-modName of a mod to enable Instrument Mode
--start-server FILEstart a multiplayer server
--start-server-load-scenario [MOD/]NAMEstart 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-lateststart a multiplayer server and load the latest available save
--until-tick TICKrun a save until given map tick
--benchmark FILEload save and run benchmark
--benchmark-ticks Nnumber of ticks for benchmarking. Default is 1000
--benchmark-runs Nhow often the number of ticks will be run, map will reload after each run. Default is 1
--benchmark-verbose timingscomma 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-sanitizeonly output the final benchmark results
--benchmark-ignore-pausedleaves the game paused if it was paused when saved. By default the game is unpaused when a benchmark starts.
--output-perf-stats FILEpath of file to which rendering performance statistics measurements should be saved. Special tags {api}, {hw}, {time} and {tag} will be replaced.
--dump-datadumps data.raw as JSON to the script output folder and exits.
--dump-icon-spritesdumps all icon sprites as png files to the script output folder and exits.
--dump-prototype-localedumps all prototypes name and description (if they have a valid value) to the script output folder and exits.
--mp-connect ADDRESSstart factorio and connect to address
--password PASSWORDthe password to use when using mp-connect (if any)
--heavyrun the game in heavy mode if singleplayer with graphics (heavy mode is related to investigating desyncs, see Desynchronization#Using_heavy_mode_command)
--load-game FILEstart Factorio and load a game in singleplayer
--load-scenario [MOD/]NAMEstart 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 FILEload save and run it with graphics for benchmark-ticks number of ticks as normal game would
--benchmark-frame FILEload save and benchmark graphics rendering of single frame (prepare + render) without updating the game
--force-opengluse OpenGL for rendering (windows only)
--force-d3duse Direct3D for rendering (windows only)
--d3d-adapter IDadapter which should be used to initialized Direct3D (windows only)
--d3d-feature-leveloverride feature level (11, 10.1, 10) (windows only)
--dxgi-blit-modelforce Blit presentation mode (windows only)
--audio-driverdefault = 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-graphicsenables debugging layer for graphics API. If DirectX is used DirectX SDK needs to be installed for this to work.
--fullscreen BOOLstart game in windowed mode (saved to configuration)
--max-texture-size Nmaximal size of texture that the game can use (saved to configuration). Should be power of two greater than 2048
--graphics-quality argaccepted values: high, normal, low, very-low. low and very-low are deprecated and are migrated to normal.
--video-memory-usage argaccepted values: all, high, medium, low
--force-graphics-preset argaccepted values: very-low, low, mac-with-low-ram, medium-with-low-vram, medium, high, very-high, extreme
--gfx-safe-moderesets some graphics settings to values that should work on most configurations
--low-vramsprites that are not put into sprite atlases won't be allocated as texture objects
--shaderenable/disable shader postprocessing (saved to configuration)
--disable-audioDisable audio. Mainly for faster startup during development.
--window-size argDesired window resolution. For example "1680x1050". Or "maximized"
--single-thread-loadingDisables loading of sprites in multiple threads.
--cache-sprite-atlas BOOLEnable/disable sprite atlas cache.
--nogamepadDisable gamepad(controller) support
Server options
--port Nnetwork port to use
--bind ADDRESS[:PORT]IP address (and optionally port) to bind to
--rcon-port NPort to use for RCON
--rcon-bind ADDRESS:PORTIP address and port to use for RCON
--rcon-password PASSWORDPassword for RCON
--server-settings FILEPath to file with server settings. See data/server-settings.example.json
--use-authserver-bans BOOLVerify that connecting players are not banned from multiplayer and inform Factorio.com about ban/unban commands.
--use-server-whitelist BOOLIf the whitelist should be used.
--server-whitelist FILEPath to file with server whitelist.
--server-banlist FILEPath to file with server banlist.
--server-adminlist FILEPath to file with server adminlist.
--console-log FILEPath to file where a copy of the server's log will be stored
--server-id FILEPath where server ID will be stored or read from

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

  • Console

Retrieved from ""

Command line parameters - Factorio Wiki (2024)
Top Articles
Latest Posts
Article information

Author: Melvina Ondricka

Last Updated:

Views: 6221

Rating: 4.8 / 5 (48 voted)

Reviews: 95% of readers found this page helpful

Author information

Name: Melvina Ondricka

Birthday: 2000-12-23

Address: Suite 382 139 Shaniqua Locks, Paulaborough, UT 90498

Phone: +636383657021

Job: Dynamic Government Specialist

Hobby: Kite flying, Watching movies, Knitting, Model building, Reading, Wood carving, Paintball

Introduction: My name is Melvina Ondricka, I am a helpful, fancy, friendly, innocent, outstanding, courageous, thoughtful person who loves writing and wants to share my knowledge and understanding with you.