Factorio Dedicated Server questions

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
Post Reply
nsanity
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Mar 28, 2016 11:47 pm
Contact:

Factorio Dedicated Server questions

Post by nsanity »

So in the space of a little over a week, I've put about 90 hours into Factorio - including about 40-50 in multiplayer - super awesome game.

We played it on LAN (GbE and all current or n-1 gen Core i5 machines) and found that hosting and playing was absolute garbage after 3 players. So I spent ~15 mins and built a Windows Dedicated Server (didn't have a CentOS7 iso sitting around) - which worked way better.

Friends then went home - so I built a CentOS Dedicated Server at work and spun that up - using the handy Factorio-Init and Factorio-updater scripts which can be found / linked to in the wiki.

However we're still having a few issues;
  • Is there any way you can force new players to be served the map from the dedicated headless server? Its sitting on a 60Mbit/60Mbit pipe - and its down right depressing seeing Factorio pull the map from an ADSL2 client at 30-50KB/sec.
    Sub question to this - given the game is paused for everyone - if you're going to pull the map from a random client - why don't you pull the game from ALL clients?
  • If any player has latency issues (e.g flatmates watch HD youtube or whatever and max a connection) the whole game comes down - this is obviously a function of the lock-step client model. But is there anyway to identify easily from a client who is doing it? I know i can look at the dedicated server output and then reference the client number back to the player - but that is cumbersome (I don't have direct SSH to it - i have to hop through RDS to get to it).
  • The latency setting should be explained better in the wiki. My understanding (which came from factorio-init) is that you want max expected latency + 30ms. Is there any more info to this?
  • Where specifically does a client configure Autosave time period and the "use peer to peer communication" setting?
  • When should you use the p2p setting - only when you're on the same lan with direct access to the UDP ports? should it be turned off for games played over the web?
  • Is there scope to have a dedicated server push current mods (and mod versions) to the clients?
The only other thing we have is that 1 of our players has weird pause roughly every 5-10 minutes - all the other clients get a "such and such might be disconnecting" and it comes good in about 5-10 seconds. The thing is its literally like clock work (Which in combo with our last game that saved every 3 minutes or whatever - was hyper annoying).

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Factorio Dedicated Server questions

Post by daniel34 »

nsanity wrote:Is there any way you can force new players to be served the map from the dedicated headless server?
Make sure p2p is disabled (see below). In the last few months I haven't seen clients on my servers download the map from another client. Are you sure it is pulling the map from a client (check network traffic)?
nsanity wrote:If any player has latency issues (e.g flatmates watch HD youtube or whatever and max a connection) the whole game comes down - this is obviously a function of the lock-step client model. But is there anyway to identify easily from a client who is doing it?
Press F4 and enable show_multiplayer_waiting_statistics in the always tab (or enable it in the basic tab and use F5 to turn it on/off). The number displayed next to the player name should be zero, any higher number means that player is lagging, although sometimes other player's values go up too when one player lags.
nsanity wrote:The latency setting should be explained better in the wiki. My understanding (which came from factorio-init) is that you want max expected latency + 30ms.
For private servers (where you know the people and their ping beforehand) use a latency of highest ping to server + 30 or 50ms. Don't set it too high, the latency setting also influences the lag hiding.
Example: If you set the latency to 300ms then driving the car / entering/exiting vehicles / inserting/removing items from buildings will also be 300ms delayed, although running around will be instant (for you, the other players see you moving 300ms later).
The latency might be changed in 0.13 so it autoconfigures itself based on current player ping/lag (or so i've heard).
nsanity wrote:Where specifically does a client configure Autosave time period and the "use peer to peer communication" setting?
The autosave time period and p2p setting is a host/server-only setting. Only the player initiating the map can set these values and these will then be used by the clients. Which makes sense, as having all clients autosave at different intervals will pause the game each time (and also break determinism).
nsanity wrote:When should you use the p2p setting - only when you're on the same lan with direct access to the UDP ports? should it be turned off for games played over the web?
In my opinion and experience p2p should (almost) always be off.
With p2p enabled, each client sends and receives a UDP packet every tick (1/60 of a second) to every other client.
With p2p disabled, the client only sends and receives a UDP packet every tick to/from the server.
So for each additional player in the game your connection has to process an extra 120 UDP packets per second, which coupled with slow connections or poorly programmed modems/routers can cause lag very fast.
Read Friday Facts #99 - MP forwarding for an in-depth explanation, if you're interested.
nsanity wrote:Is there scope to have a dedicated server push current mods (and mod versions) to the clients?
Might come in 0.13.
nsanity wrote:We played it on LAN (GbE and all current or n-1 gen Core i5 machines) and found that hosting and playing was absolute garbage after 3 players.
I've only played on LAN (wireless at that) with 3 players (including me) and had no problems, so I cannot say why you would have problems with more than 3 players but hope the information above has helped you. On my vanilla server I once had 9 players from all across Europe, working without noticeable lag, 2 weeks before steam release:
Image
quick links: log file | graphical issues | wiki

nsanity
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Mar 28, 2016 11:47 pm
Contact:

Re: Factorio Dedicated Server questions

Post by nsanity »

thanks for the reply - my start up script is;

${BINARY} --config ${FCONF} --port ${PORT} --start-server ${SAVE_NAME} --autosave-interval ${AUTOSAVE_INTERVAL} --autosave-slots ${AUTOSAVE_SLOTS} --latency-ms ${LATENCY} ${EXTRA_BINARGS}"

Peer to peer is enabled via extra_binargs from the Factorio_Init Script. - I'll remove that. And give it a test.

Desiderius
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Mar 31, 2016 11:56 am
Contact:

Re: Factorio Dedicated Server questions

Post by Desiderius »

Hello,

i run an Factorio Server on my Server with Windows Server 2008 R2 running. Where i can find the option to disable the p2p function ?
Peer to peer is enabled via extra_binargs from the Factorio_Init Script. - I'll remove that. And give it a test.
I dont find this on my machine.

Greetings
Desiderius

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Factorio Dedicated Server questions

Post by daniel34 »

Desiderius wrote:i run an Factorio Server on my Server with Windows Server 2008 R2 running. Where i can find the option to disable the p2p function ?
Peer to peer is enabled via extra_binargs from the Factorio_Init Script. - I'll remove that. And give it a test.
I dont find this on my machine.

Greetings
Desiderius
If you are not using any init-script (and there are none for windows), then peer-to-peer is already disabled by default.
quick links: log file | graphical issues | wiki

Desiderius
Manual Inserter
Manual Inserter
Posts: 2
Joined: Thu Mar 31, 2016 11:56 am
Contact:

Re: Factorio Dedicated Server questions

Post by Desiderius »

Thx for the reply,

is that confirmed ? I save a map on my pc in single player with p2p enabled and upload it to my server. Then P2P ist automatic disabled ?

My Start.bat is:

Code: Select all

Factorio.exe --start-server xxx.zip -c %appdata%\Factorio\config\config_34197.ini
regards
Desiderius

daniel34
Global Moderator
Global Moderator
Posts: 2761
Joined: Thu Dec 25, 2014 7:30 am
Contact:

Re: Factorio Dedicated Server questions

Post by daniel34 »

Desiderius wrote:is that confirmed ? I save a map on my pc in single player with p2p enabled and upload it to my server. Then P2P ist automatic disabled ?
The p2p setting is not stored in the save, it depends on you config / server commands and defaults to off.
quick links: log file | graphical issues | wiki

HGGamers
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Apr 17, 2016 7:37 am
Contact:

Re: Factorio Dedicated Server questions

Post by HGGamers »

Hello,

Im Running a on my Server a Headless Server but i dosent create a config.ini? i dont know why but i can join the Server?
How do i change now the port?

Iwirada
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Apr 19, 2016 4:49 pm
Contact:

Re: Factorio Dedicated Server questions

Post by Iwirada »

Hello,

i am trying to set up a dedicated server (CentOS) for me and my friend. Atm I am writing a spec file to build a rpm package (https://github.com/poettler-ric/fedora- ... erver.spec).

One thing I would like to have is a separate directory for game data and changing files (e.g. saves, temp, logs) to put them on /var. I've recognized the file config-path.cfg and set:

Code: Select all

use-system-read-write-data-directories=true
When i now try to create a save file i get the following:

Code: Select all

sh-4.3$ /opt/factorio-server/bin/x64/factorio --create test
   0.000  Error Util.cpp:58: There is no package core in /usr/share/factorio
Could anyone clarify where factorio now expects what files?

Btw, does factorio need a valid shell for the user?

Kind regards
Richard Poettler

Iwirada
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Apr 19, 2016 4:49 pm
Contact:

Re: Factorio Dedicated Server questions

Post by Iwirada »

Sorry for the noise.

I took the generated ini file, changed it (https://github.com/poettler-ric/fedora- ... config.ini) and put it into my packaging process to alter read-data and write-data with sed while building the package.

One thing I don't really like are applications writing their own configuration files (imho only the admin should do that). I get the following error when shutting down the server:

Code: Select all

8.247 Error GlobalContext.cpp:954: Couldn't write /etc/factorio/config.ini: boost::filesystem::copy_file: Permission denied: "/var/lib/factorio/config.ini", "/etc/factorio/config.ini"
In my world factorio shouldn't write to /etc/factorio/config.ini, but that might be a matter of opinion.

What I've seen from the temp files and save structure: It's not possible to run multiple servers on one host (e.g. on different ports)? Is such a feature planned?

Kind regards
Richard Poettler

Chaos234
Long Handed Inserter
Long Handed Inserter
Posts: 54
Joined: Sat Jun 27, 2015 10:45 pm
Contact:

Re: Factorio Dedicated Server questions

Post by Chaos234 »

Since version 0.12.33 I can no longer connect to my dedicated linux (x64, Debian 8, headless) server.

I removed under 0.12.29 one mod and saved the map. Then I updated the headless and the windows version to 0.12.33 incl. the map.
I use the init script and my port is set to 34199 which is allowed in my iptables script, also config is also set to this value.

I also disabled kaspersky so that it no longer controlls my factorio but I only get the same message that I can't connect to the server.
Also there are NO errors logged client-side nor server-side and the port ist free on server-side.

So what can the problem be?

Post Reply

Return to “Technical Help”