Difficulties With Setting Up Headless/Dedicated Server (W10)

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
TechTon
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jul 25, 2016 1:38 am
Contact:

Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by TechTon »

I'm having a lot of difficulties setting up a headless/dedicated server on Windows 10.
I have to move on from in-game multiplayer because most of my friends who are playing with me are lagging 95% of the time, basically making the entire game unplayable for them.

I can't find any up-to-date, reliable guides on how to do it, and the farthest I've gotten was setting up a server-settings.json file. I haven't been able to get into my own server because Steam won't let me, saying that an instance of the game is already running, which I'm pretty aware of, how we can't get in our own servers through using the same computer. (which I find kind of dumb)
I still have no clue how to set an IP address or specific port for the server. I port forwarded Factorio's default port and set it to UDP, and I still don't know if the server itself even works since I can't join it.
I believe I have all the folders and json's in the right place, but I have a lot of questions and roadblocks in my way and I need some help, please.
A full, informational, up-to-date, 0.15 dedicated server setup guide for Windows would be plausible, and very helpful. So if anyone has one or knows of one, then please tell me.

Thank you.

Loewchen
Global Moderator
Global Moderator
Posts: 8308
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by Loewchen »

If you intent to run a headless server on the same machine you are also playing on, you are not going to succeed, simply performance wise.
If you want to run a headless server on a dedicated machine see here for instructions: https://wiki.factorio.com/index.php?tit ... ess_server
If you have specific question, explain beforehand exactly your setup and what is not working.

TechTon
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jul 25, 2016 1:38 am
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by TechTon »

Loewchen wrote:If you intent to run a headless server on the same machine you are also playing on, you are not going to succeed, simply performance wise.
If you want to run a headless server on a dedicated machine see here for instructions: https://wiki.factorio.com/index.php?tit ... ess_server
If you have specific question, explain beforehand exactly your setup and what is not working.
So that's it. I can't run a server without a second computer?
I guess Factorio becomes singleplayer-only when your base is late-game and too memory-heavy on the in-game multiplayer unless you spend $800 on a second computer.
I'm probably going to request this to the devs. Doesn't make sense why I can't play and host at the same time.

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by impetus maximus »

i run a dedicated headless server (Win7) and run a client on the same machine. no second PC needed.
you would be able to make a more complex CPU heavy server if you have a dedicated machine.
but it's not needed.

i would download the package version of the game and run the server from that. easier to manage saves/config/json files etc.
also not sure how steam would like you running more than one instance (run as admin should let you). but again i STRONGLY suggest using the package.

change the listening port on the steam version other than default so they won't conflict with each other.
i suggest setting the affinity to cores 2+3 for the server, affinity 0+1 for the client. that is assuming you have 4 cores.
Last edited by impetus maximus on Sun Oct 08, 2017 1:11 am, edited 1 time in total.

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by Jap2.0 »

TechTon wrote:
Loewchen wrote:If you intent to run a headless server on the same machine you are also playing on, you are not going to succeed, simply performance wise.
If you want to run a headless server on a dedicated machine see here for instructions: https://wiki.factorio.com/index.php?tit ... ess_server
If you have specific question, explain beforehand exactly your setup and what is not working.
So that's it. I can't run a server without a second computer?
I guess Factorio becomes singleplayer-only when your base is late-game and too memory-heavy on the in-game multiplayer unless you spend $800 on a second computer.
I'm probably going to request this to the devs. Doesn't make sense why I can't play and host at the same time.
You can play and host at the same time, just not host on a dedicated server while playing without performance issues. Dedicated server implies that it is a server and it is dedicated to hosting Factorio.
There are 10 types of people: those who get this joke and those who don't.

tazdu29
Inserter
Inserter
Posts: 24
Joined: Sat Sep 30, 2017 3:19 pm
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by tazdu29 »

TechTon wrote:I'm having a lot of difficulties setting up a headless/dedicated server on Windows 10.
FIrst of all, a headless server is only possible under GNU/Linux or any *nix like OS. The ubuntu shell integrated in windows 10 doesn't count as a linux OS.
TechTon wrote:I have to move on from in-game multiplayer because most of my friends who are playing with me are lagging 95% of the time, basically making the entire game unplayable for them.
Before saying it's your computer, have you checked that you have the network speed and stability available for doing so? If you've crappy internet connection, even a $10K server won't help.
TechTon wrote:I haven't been able to get into my own server because Steam won't let me, saying that an instance of the game is already running, which I'm pretty aware of[...]
To use multiplayer on steam, launch your game, go to "multiplayer" and load the save you want to pay on. then, play!
And to invite friends, just open the Steam overvlay (shift + tab, by default), open your friend list and on the desired friends, right click and press "invite to game".

EDIT : never tried myself, but if you *still* want to use another copy of the game as the server, use the DRM-free version, and rename the factorio.exe file located in factorio/bin/x64/ to factorio2.exe e.g. That way, Steam won't annoy you because factorio.exe is already running.
TechTon wrote:I still have no clue how to set an IP address or specific port for the server. I port forwarded Factorio's default port and set it to UDP, and I still don't know if the server itself even works since I can't join it.
If you have a headless server running on the same machine, the host to join would be "localhost". If the server is on another computer, then fill the "host" field with this PC's IP address.
I guess you forwarded factorio's port to your actual PC in your router, right? because you say other people are lagging (so they indeed successfully joined your server).

Hope it helped !

TechTon
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jul 25, 2016 1:38 am
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by TechTon »

TechTon wrote:I have to move on from in-game multiplayer because most of my friends who are playing with me are lagging 95% of the time, basically making the entire game unplayable for them.
Before saying it's your computer, have you checked that you have the network speed and stability available for doing so? If you've crappy internet connection, even a $10K server won't help.
Yes. 119 Mbs download speed, 9 upload speed, & a latency of 11. I've hosted servers in Garry's Mod and Terraria that are much more resource-intensive, much less than Factorio.
tazdu29 wrote:
TechTon wrote:I'm having a lot of difficulties setting up a headless/dedicated server on Windows 10.
TechTon wrote:I haven't been able to get into my own server because Steam won't let me, saying that an instance of the game is already running, which I'm pretty aware of[...]
To use multiplayer on steam, launch your game, go to "multiplayer" and load the save you want to pay on. then, play!
And to invite friends, just open the Steam overvlay (shift + tab, by default), open your friend list and on the desired friends, right click and press "invite to game".
I know how to do this. It's what I'm trying to move away from. I've been using multiplayer on Steam all this time, and it's getting too memory-demanding for Steam to handle. I get absolutely no lag, but my friend can't play or move at all whatsoever. I'm talking about a dedicated server. You know, running the server.bat, along with the server-settings.json?

I think you got things a little mixed up. I'll try some things you said. Thank you.

TechTon
Burner Inserter
Burner Inserter
Posts: 5
Joined: Mon Jul 25, 2016 1:38 am
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by TechTon »

I give up.

Nothing is working. Still can't get into my own server because I can't run 2 instances of Factorio, even though I'm really not. Steam doesn't even say I'm running it, but when I try to get in the game itself, whether that be through the package or through Steam, it'll say theirs still another instance running.

I'm sorry, I'm just fucking done. Lock this thread, please.

Zavian
Smart Inserter
Smart Inserter
Posts: 1641
Joined: Thu Mar 02, 2017 2:57 am
Contact:

Re: Difficulties With Setting Up Headless/Dedicated Server (W10)

Post by Zavian »

I can run 2 copies of factorio on Windows 10 just fine (although doing so with large bases means both will run with reduced performance compared to just running one).

Make sure that you have 2 entire copies of the game setup that don't share any files, and that aren't attempting to share the same directory for saving logfiles etc. The easiest way to do that is to use use one copy of the .zip version of factorio and the second can be the steam version. (Alternatively extract 2 copies of the .zip version to 2 different directories). (I also strongly suggested getting everything working in windowed mode before trying fullscreen on the client, and possibly reducing graphics/sprite resolution to normal).

I've not tried to host multiplayer this way, but when you attempt to connect to the other factorio server running on your computer you might need to use the "connect to server" option with the loopback address of

Code: Select all

127.0.0.1:<port number of your server>
Not all routers can route packets from a computer attempting to connect to itself.

If that doesn't work then please provide the logs of both the server and the client and the server's config/json files.

Also the most likely reason for your friends lagging as you reported in the OP is their computer being slower than yours, and they are no longer able to keep-up with the server. This is the main cause of multi-player situations where the client experiences unplayable lag. This is normally addressed by slowing the game down for everybody by using

Code: Select all

/c game.speed = 0.5
(You may need to issue that command twice, and it will disable achievements). If that command solves the problems for your friends then it is likely that this was the cause of your friends lagging. If you want to confirm this is the problem prior to slowing down the game then please ask one of your friends to provide a logfile and a screenshot (with the debug options show-fps, show-time-usage, show-multiplayer-waiting-icon, show-multiplayer-statistics active) as mentioned in viewtopic.php?f=7&t=51319 .

Post Reply

Return to “Technical Help”