Dedicated Server Guide on Windows

Find multiplayer games.
Tools/scripts to run a dedicated server.
maisel16
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Sep 06, 2015 4:52 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by maisel16 »

Can i run more headless Windows Servers?

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

Re: Dedicated Server Guide on Windows

Post by daniel34 »

maisel16 wrote:Can i run more headless Windows Servers?
Yes you can, if you set a different port in the config.ini for each instance. The players then have to connect on that port aswell.
quick links: log file | graphical issues | wiki

maisel16
Burner Inserter
Burner Inserter
Posts: 14
Joined: Sun Sep 06, 2015 4:52 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by maisel16 »

daniel34 ich kann deutsch :D. Kannst du mir das ein bisschen genauer erklären? Wäre wirklich sehr nett!

Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Dedicated Server Guide on Windows

Post by Oxyd »

daniel34 wrote:
maisel16 wrote:Can i run more headless Windows Servers?
Yes you can, if you set a different port in the config.ini for each instance. The players then have to connect on that port aswell.
Also different write-data.

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

Re: Dedicated Server Guide on Windows

Post by daniel34 »

maisel16 wrote:daniel34 ich kann deutsch :D. Kannst du mir das ein bisschen genauer erklären? Wäre wirklich sehr nett!
DE:
Am einfachsten ist es, sich die zip-Version zu besorgen und dann für jede einzelne Instanz in einen eigenen Ordner zu entpacken, da diese dann separat sind und sich nicht gegenseitig beeinflussen können. Dann öffnest du bei jeder Instanz im Ordner config die config.ini und ersetzt den Port (normalerweise 34197) durch einen neuen (34198, 34199, ...). Jede Instanz muss einen anderen Port haben.

EN:
The easiest way is to get the zip-version and extract it to a different folder for each instance so they can't interfere with each other. Then you open the config.ini file in the config folder and change the port (default 34197) to a new one (34198, 34199, ...). Every instance has to have a different port.
Oxyd wrote:Also different write-data.
With the method i just mentioned the write-data is always in a different folder (always inside the extracted location). It also makes it easy to manage the mods and update the game version separately.
quick links: log file | graphical issues | wiki

xBlizzDevious
Fast Inserter
Fast Inserter
Posts: 108
Joined: Mon Feb 02, 2015 10:15 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by xBlizzDevious »

Is there a way to gracefully exit the server or do you just have to hope it auto-saved just before you exit? And then exit, obviously...

I've not tested it yet, but will the server automatically reload the newest autosave when restarting or will it load the version that it started on - ie. completely not updated save. If it's the latter, how do you fix that issue?


Edit: I just read the wiki instead of using this thread and the information I requested is in there.
Answers:
To exit the server gracefully, press Ctrl + C with the cmd window active. This will automatically save thus negating my second question.

lazyorc
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Feb 28, 2016 8:34 am
Contact:

Re: Dedicated Server Guide on Windows

Post by lazyorc »

Anyway to get around running two instances in steam?

It seems people can get around running the dedicated in windows and joining their server on the same machine by changing the port. I can't seem to get two instances running with steam though.

Also what about the /wait command in the batch, when I get the dedicated server going I still don't get a console as others seem to get.

Thanks,

uschigras
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Mar 11, 2016 6:04 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by uschigras »

in Engl with Google

Hi: Who can help me
I want to start Factorio as Dedicated Server. But if I start it
Here the command,

Code: Select all

start /wait E:\Spiele\Steam\SteamApps\common\Factorio\bin\x64\Factorio.exe --start-server save.zip
Unbenannt.JPG
Unbenannt.JPG (9.56 KiB) Viewed 16920 times

I get this message

Code: Select all

  ...   0.043 Loading mod base 0.12.26 (data.lua)
   0.378 Factorio initialised
   0.382 Info Router.cpp:556: Router peerID(65535) shutting down.
   0.384 Info Router.cpp:582: Router state -> Disconnected
   0.385 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(Ready) to(PreparedToHostGame)
   0.392 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(PreparedToHostGame) to(CreatingGame)
   0.395 Loading map C:/Users\lingr\AppData\Roaming\Factorio\saves\save
   0.416 Error MultiplayerManager.cpp:110: MultiplayerManager failed: "Opening zip C:/Users/lingr/AppData/Roaming/Factorio/saves/save failed"
   0.420 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(CreatingGame) to(InitializationFailed)
   0.427 Error Main.cpp:328: Couldn't load the game for MP: Opening zip C:/Users/lingr/AppData/Roaming/Factorio/saves/save failed
Thank You

Uschi...





Hier in Deutsch :)

Hallo: Wer kann mit helfen
Ich möche Factorio als Dedicated Server starten. Wenn ich ihn aber starte
hier der Befehl,

Code: Select all

start /wait E:\Spiele\Steam\SteamApps\common\Factorio\bin\x64\Factorio.exe --start-server save.zip
Unbenannt.JPG
Unbenannt.JPG (9.56 KiB) Viewed 16920 times
bekomme ich diese Meldung

Code: Select all

  ...   0.043 Loading mod base 0.12.26 (data.lua)
   0.378 Factorio initialised
   0.382 Info Router.cpp:556: Router peerID(65535) shutting down.
   0.384 Info Router.cpp:582: Router state -> Disconnected
   0.385 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(Ready) to(PreparedToHostGame)
   0.392 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(PreparedToHostGame) to(CreatingGame)
   0.395 Loading map C:/Users\lingr\AppData\Roaming\Factorio\saves\save
   0.416 Error MultiplayerManager.cpp:110: MultiplayerManager failed: "Opening zip C:/Users/lingr/AppData/Roaming/Factorio/saves/save failed"
   0.420 Info MultiplayerManager.cpp:906: networkTick(0) mapTick(-1) changing state from(CreatingGame) to(InitializationFailed)
   0.427 Error Main.cpp:328: Couldn't load the game for MP: Opening zip C:/Users/lingr/AppData/Roaming/Factorio/saves/save failed
Was kann das sein. Mir würde auch reichen das der Factorio Server mit einer neuen Map startet.
Danke

Gruß Uschi

uschigras
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Mar 11, 2016 6:04 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by uschigras »

Yeah, I have found the error

the savegame must not mean save.zip. grrr
with a different name, it works.

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

Re: Dedicated Server Guide on Windows

Post by daniel34 »

The problem here isn't the name of the savegame, but the upper/lowercase.
The save is named Save.zip but you are trying to launch it as save.zip

Das Problem hier ist nicht der Name sondern die Groß-/Kleinschreibung:
Der Spielstand heißt Save.zip aber du versuchst save.zip zu laden.
quick links: log file | graphical issues | wiki

sasaa_86
Manual Inserter
Manual Inserter
Posts: 4
Joined: Mon Apr 11, 2016 3:28 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by sasaa_86 »

found this (maybe helpfull to put on the wiki)

General options:
-h [ --help ] display help
--version show version information
-c [ --config ] PATH config file to use

Running options:
-s [ --map2scenario ] arg map to scenario conversion
--apply-update arg immediately apply update package
--create SAVE create a new map
--start-server SAVE start a multiplayer server

Server options:
--latency N multiplayer server latency, in ticks
--latency-ms N multiplayer server latency, in milliseconds
--autosave-interval N (=2) server autosave interval, in minutes
--autosave-slots N (=3) server autosave slots
--disallow-commands disallow use of the command console
--peer-to-peer use peer-to-peer communication
--no-auto-pause don't automatically pause when no players are
connected
--port N network port to use

I just taken it from the linux version of facorio headless server but i guess it would work on any server instance
checked its the same on windows.

I use (linux)

Code: Select all

sudo ./factorio --autosave-interval 5 --latency 12 --disallow-commands --start-server server.zip
for windows you should use a *.bat file or *.cmd and put this in

Code: Select all

@echo off
:start
START /WAIT /HIGH factorio.exe --autosave-interval 5 --latency 12 --disallow-commands --start-server server.zip
Echo.
Echo Crashed @ %time% - %date%
echo Restarting in 10 seconds...
timeout /t 10
goto start
I'm currently setting up a MP server will let you know when its done.
Just one question about shutting the server down and restarting it. what zip file should i use to startup?


I'm dutch btw greets

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by Bisa »

sasaa_86 wrote: Just one question about shutting the server down and restarting it. what zip file should i use to startup?[/b]

I'm dutch btw greets
There's a bug in 0.12.30 preventing the server from saving on clean exit - until then ensure you have autosaves enabled, as for starting a factorio server on linux: Try this ;)
Hosting a factorio server? Take a look at this || init script ||.

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by binbinhfr »

Under Windows 7, with a steam install, is it possible to run a server AND a client on the same machine ? I cannot manage how to do it, there is always an error "the process can not access..." .
Even if I try to duplicate and rename factorio.exe, to have 2 separate programs running (factorio2.exe for the server)
My mods on the Factorio Mod Portal :geek:

Cr4zy
Burner Inserter
Burner Inserter
Posts: 10
Joined: Sun Apr 17, 2016 4:49 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by Cr4zy »

Yes it's possible I run both my client and server from the steam install. Could be you haven't set configs up for the server? Servers require different write data paths which can only be provided though another config.

script in my sig might help you out if you can't solve it.
Factorio Server Tool - Setup wizard and managing script for running a Factorio server on Windows

User avatar
binbinhfr
Smart Inserter
Smart Inserter
Posts: 1524
Joined: Sat Feb 27, 2016 7:37 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by binbinhfr »

Wow that's a BATCH file !!! ;)
I'll have a look at it to understand this config file and path thing.
For the moment, I have a headless server on a contiguous machine.
My mods on the Factorio Mod Portal :geek:

cassie112
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon May 02, 2016 10:06 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by cassie112 »

Hi,

i've tried to use this server.bat file, but everytime i execute it, it opens the commandprompt but not factorio itself, but when i try to open factorio it says "it is already in use by something else".
i wont upload what is on the commandprompt, because i dont know if there is any private info on it.
thanks,

C.
Attachments
the line i have
the line i have
serverFile.PNG (5.09 KiB) Viewed 13922 times

Bisa
Filter Inserter
Filter Inserter
Posts: 450
Joined: Fri Jul 17, 2015 3:22 pm
Contact:

Re: Dedicated Server Guide on Windows

Post by Bisa »

cassie112 wrote:Hi,

i've tried to use this server.bat file, but everytime i execute it, it opens the commandprompt but not factorio itself, but when i try to open factorio it says "it is already in use by something else".
i wont upload what is on the commandprompt, because i dont know if there is any private info on it.
thanks,

C.
I'm afraid without the command prompt output its a bit tricky to guess what is happening - perhaps try this: viewtopic.php?f=133&t=23838
Hosting a factorio server? Take a look at this || init script ||.

Brewcmas
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Dec 29, 2017 6:38 pm

Null

Post by Brewcmas »

Deleted Post
Last edited by Brewcmas on Mon Dec 23, 2019 12:40 am, edited 1 time in total.

Null8fuenf10
Manual Inserter
Manual Inserter
Posts: 1
Joined: Mon Aug 20, 2018 11:36 am
Contact:

Re: Dedicated Server Guide on Windows

Post by Null8fuenf10 »

Brewcmas wrote:I have the server up and running with no issue, but it seems to crash every time the server is inactive for a period of time (no one logged on, just running in paused state).

Any ideas how to fix this?

You can set it to false in the server-settings.json file under "auto_pause".
If You don't have the file, You can unpack and copy the file from an Linux headless build to You Factorio installation folder (where the folders 'bin', 'data', etc are).
You'll need to fill in all Your server data tho (server name, player count, Your login data, etc.)

NMSquirrel
Burner Inserter
Burner Inserter
Posts: 13
Joined: Fri Jan 13, 2017 1:20 am
Contact:

Re: Dedicated Server Guide on Windows

Post by NMSquirrel »

ok WTH?
it starts then hangs here...
the program stops running at that line every time..

any idea what is going on?
i have checked task manager and there is no factorio running.
northbrook cement.jpg
northbrook cement.jpg (193.75 KiB) Viewed 9188 times

Post Reply

Return to “Multiplayer / Dedicated Server”