GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing wiki.factorio.com — Multiplayer Multiplayer
Jump to navigation
Jump to search
In addition to being a single-player game, Factorio also supports multiplayer, allowing many players to cooperate and assist each other, or work against each other in pvp. This page documents how to set up a multiplayer game, how to join one, and the Multiplayer Admin features for managing other users and the server. By default, multiplayer games run the CO-OP freeplay scenario where all players work together to launch a rocket with a satellite into space. Other scenarios, including PvP maps, are available for download from the Maps and Scenarios forum. Setting Up a Multiplayer GameMultiplayer games can be joined, hosted while playing, or hosted by a dedicated server. Multiplayer games can be advertised to other players on the same LAN or worldwide. To start playing a multiplayer game, select the Multiplayer button from the main menu. Then, choose one of these options to host and play:
To join an existing game, choose one of these options:
Notes and tips:
Dedicated/Headless serverA dedicated (or headless) server can be started using the --start-server command line option. You can run factorio --help to get a list of all command-line arguments that Factorio accepts. Any version of the game can be run in headless mode, though for Linux servers it may be preferable to use the Headless version of the game, which does not include graphics to reduce download size. This can be found on the factorio.com Downloads page. In the headless mode:
0.13 onwards expects --start-server to be followed by a path to a save file. You will need to create your save file before you start the server, as the dedicated server REQUIRES a save file to be provided. This can easily be done using the --create command-line argument. For example: ./bin/x64/factorio --create ./saves/my-save.zip # This creates a new save, as if by clicking the New Game button in the GUI ./bin/x64/factorio --start-server ./saves/my-save.zip # This starts a server that will host the file created on the previous line There are several JSON configuration files that factorio can make use of to change the server and map settings:
Example files for each of these parameters are included in the data subdirectory, and are also visible on Wube's github here: https://github.com/wube/factorio-data The --map-gen-settings and --map-settings options must be used with the --create option when you create a new map. For example: ./bin/x64/factorio --create saves/my-save.zip --map-gen-settings my-map-gen-settings.json --map-settings my-map-settings.json Starting the factorio server requires you to specify the location of the server-settings.json file. By default this is in the factorio data folder. For example to start factorio using the most recent saved map, you would run: ./bin/x64/factorio --start-server-load-latest --server-settings ./data/server-settings.json On windows, it may be useful to start the server with a .bat file. The bat file should have the following content: start /wait .\bin\x64\factorio.exe --start-server-load-latest --server-settings .\data\server-settings.json See Command line parameters for more command line parameters. Setting up a Linux Factorio serverNote: Factorio now requires glibc version 2.31, but CentOS/RHEL 7 only ship with version 2.17 so this guide will no longer work without manually compiling glibc 2.31. This step-by-step guide has been verified on fresh CentOS 7 and RHEL 7 installs but should be applicable with little to no changes on most distributions. The guide assumes you will install the headless server under /opt/factorio, adjust paths according to your own setup. We will also suggest that you run the Factorio server as a separate user to harden security of your setup. Note that there are two distinct packages for Linux that can be used to run a headless server. First is the usual Linux download, that contains the full game. The other is the special headless package. The headless package does not contain any files irrelevant for a pure server, such as graphics and sounds. It is also not linked against libraries that may not be present on a server machine, such as Xlib, libGL or libasound. This option should be selected if running in a 3rd party hosted server. This guide does not handle firewall/port forwarding since this can be done in various ways on Linux (make sure to read up how this is done as a Linux admin on your particular distribution) Basic installation
$cd /opt/ $sudo tar -xzf /tmp/factorio.tar.gz # Use the correct file name. It includes the factorio version number $sudo tar -xJf /tmp/factorio.tar.xz # if you downloaded a .tar.xz file (ver 0.15.x)
$useradd factorio $chown -R factorio:factorio /opt/factorio
$su factorio $/opt/factorio/bin/x64/factorio --start-server savename As long as it fails saying it cannot find/open the savename.zip you are set! Just upload a save from your own computer and put it in the /opt/factorio/saves directory, or use the --create ./saves/newgame.zip argument. How to list a server-hosted game on the matching serverIn order to publish the game to the matching server, Factorio needs to be given some more information than just the save file location. These information are provided in a server settings file. To create a server settings file, look at the example file located in data/server-settings.example.json in the Factorio Application directory. The recommended way is to make a copy of this example file and edit the copy. The following values can be changed:
(There are additional values in v0.14 of factorio.) Technical Implementation DetailsNotes about some technical details surrounding multiplayer have been published by the development team in several Friday Facts blog posts: DNS SRV RecordsFactorio supports DNS SRV records since 1.1.67. The Nintendo Switch version does not support DNS SRV records. This makes it easier to have multiple Factorio servers on a single host and allow users to connect to them with distinct subdomains instead of having to enter port numbers. The service name is Example: Domain: subdomain.domain.tld IP: 192.0.2.2 Port: 10002 DNS records: subdomain.domain.tld IN A 192.0.2.2 _factorio._udp.subomain.domain.tld IN SRV 0 0 10002 subomain.domain.tld. Now a Factorio client connecting to Example screenshot of config in Cloud Flare: Log Entries:
Miscellaneous Tips
/color r g b r, g and b are for red, green and blue respectively (possible values are between 0 and 1, use this site to convert colors to rgb numbers).
This file will be created if you promote a player through the console. Joining a Multiplayer gameAs of version 0.13, players no longer necessarily have to port-forward to play with others. Players may join each other through Steam, or by just the port-forwarded host. Players wishing to join a game may do so in multiple ways:
Joining by IPTo join a multiplayer game by IP, you will need to know the public IP of a valid server. You can find this through social media, websites, or by word of mouth. After acquiring the IP and port, simply go to play -> Multiplayer -> Connect to server, and provide all the information it asks for. If the server has been set up correctly to accept public connections, you should be able to join the game. Joining via server listFactorio's devs keep a list of all public servers that declare themselves to the service, allowing players to join directly through Factorio. Most of these servers will be password-requiring, but many completely public servers can be connected to. To join via server list, go to Play -> Multiplayer -> Browse public games. Provide your Factorio.com login if asked, and a list of public servers will appear. Simply select one. Joining through SteamSteam provides a "game invite" system, simply use that to join. You can find more info about how to use steam in it's documentation. This is the most recommended way for the average player to use multiplayer with their friends, as it allows Steam to handle everything. Joining a local LAN gameIf you have some friends on the same internet connection as you (in the same building or network), you may play a LAN game. Simply go to Play -> Multiplayer -> Play on LAN. Connecting to a Server Behind NATFactorio requires that the server (in client-server mode) have a publicly accessible IP address or that all players are on the same LAN. If you are behind NAT, you must set up port forwarding (see above for port number) or use virtual LAN software such as Hamachi. Multiplayer games will be launched in client-server mode (also multiplayer forwarding mode). In this mode, all clients send their network traffic to the server and the server forwards the traffic to the other clients. The advantage of this is that it allows games where some players are inside a LAN and others are outside. The disadvantage may be slightly more lag as packets must travel an extra hop (through the server). PvPIn PvP mode, players can be on different forces. Each force can have one (free-for-all) or more players (teams). Each force has its own independent research progression. Additionally, each force's Military units and structures will attack other players as enemies, unless a cease fire is set. Note that, depending on the scenario, cease fires may be unidirectional — setting a cease fire with an opposing force does not guarantee a cease fire from them in return. To start a PvP game, you can select the 'PvP' scenario from the 'Play' menu, or download a custom scenario which also supports PvP. After downloading a PvP scenario, you need to move it to your application directory, and create the multiplayer game using the scenario.
ForcesForces can be manually created via the console. This allows any map/scenario to be used for PvP. This may not be as convenient as a pre-made PvP scenario, as there will be no way for players to turn on/off cease fires other than through the console. Each created force has its own research progression and different forces may attack each other. The console commands for setting up and controlling forces are below: game.create_force("Name")
--Creates the force "Name"
game.players["Player_name"].force = game.forces["Name"]
--Sets this player to the new force
game.forces["Name"].set_cease_fire("Other_force_name", true)
--Sets the new force ceasefire to the "other force"
game.forces["Name"].set_spawn_position({x = 10, y = 20}, game.surfaces[1])
--Sets the spawn position of the force
game.print(#game.forces)
--Prints the number of forces
for name, force in pairs (game.forces) do
game.print(name)
end
--Prints the name of all the forces
The ability of players and entities belonging to one force to interact with structures belonging to another, non-friendly force is limited. However, some types of interactions are still possible:
HistoryNarrative historyBecause of the potentially immense amount of activity on a map, the game engine utilizes a lock step architecture. All instances of the game run full simulations of the entire world and only player actions are transferred across the network. Multiplayer games were introduced to Factorio with version 0.11.0. The only connection method available was peer-to-peer mode which meant every player had to be able to directly communicate with every other player. In version 0.12.4, a client-server mode of communication was introduced in which the server (either a dedicated one or the player who hosted the game) relays messages to all peers. This means that direct connection between all players is no longer necessary. As of version 0.13, P2P connecting is completely removed. As of version 0.12.0, the game features "latency hiding" mechanics where the game simulates some of the player's actions locally to make some common interactions (such as moving the player's character) more fluid. Not every action is a part of latency hiding – most notably, car or train driving and shooting are not a part of it. Version historyMaintainer note: The following history may not be fully up to date, or comprehensive. Factorio's multiplayer has undergone a great deal of small changes since its inception, however this history will provide a rough overview.
Retrieved from "https://wiki.factorio.com/index.php?title=Multiplayer&oldid=217941" |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |