1. This forum is obsolete and read-only. Feel free to contact us at support.keenswh.com

[Tutorial] Setting up a Dedicated Server start to finish [Windows]

Discussion in 'Groups & Dedicated Servers' started by Kielm, May 30, 2014.

Thread Status:
This last post in this thread was made more than 31 days old.
  1. Kielm

    Kielm Junior Engineer

    Messages:
    508
    Well it's taken the best part of a day but I've finally managed to get a server running, so here's my guide.

    Follow the relevant sections for you.

    A. One machine running dedicated server and the game.
    B. Two machines - one dedicated server, one on the game, both at home
    C. Remote dedicated/virtual server provided by a third party specifically for web applications or game hosting

    X. IT DIDN'T WORK!
    Y. I want to load a saved game on my server
    Z. My world closes after a while complaining that the host has left


    Things that will not be covered
    Friends only access - you need to set up a steam group to do this.

    -----
    The most important step is this.

    The configuration file that is generated when you start a server does not seem to save any settings you enter into the UI. You must generate a sample file by starting and stopping the server, locate the file and edit it yourself.

    The file can normally be found in your C:\Users\<username>\AppData\Roaming\SpaceEngineersDedicated\<Instance> or C:\ProgramData\SpaceEngineersDedicated\<Instance> folder and is called SpaceEngineers-Dedicated.cfg, where <username> is your username (!) and <Instance> is the name of your instance (e.g. Default). All the game settings are in here, the most important line is

    <OnlineMode>PUBLIC</OnlineMode>

    which MUST be set to PUBLIC to be publicly visible.

    * or

    This setting defaults to OFFLINE when the file is generated which is why your server WILL NOT be visible unless you edit this file.
    -----



    A. I Have a single PC that I'll be using the Dedicated Server on, and running Space Engineers on it as well.


    There's little point in doing this as you won't get much benefit. Host a game via the traditional method.


    B. I have a separate PC that I'll use for the server, on a home network or the same network as the PC I'll use to run the game.

    The only reason to do this is if you have an exceptional Internet connection. Most upload speeds are a fraction of what your ISP tells you your connection speed is. A 20Mbit connection, for example, may have a maximum download of about 2 Megabytes/sec, but usually an upload of about 512kbit-1Mbit (50kb - 100kb) per second. This is not really adequate for more than around 4-5 players (working on a 25kb/player average).

    If you still want to do it, follow ALL the steps below. Your experience may vary and is heavily dependent upon your firewall and router having the correct configuration to allow the connections in and out.


    C. I have a remote server with a dedicated fast connection

    You probably have your server running already, but here it is anyway.



    1. Log into your remote server.

    2. Start up your dedicated space engineers server, wait a few minutes for it to finish configuring itself and then shut it down again.

    3. Locate the server settings in one of the following folders:

    C:\Users\<Username>\AppData\Roaming\SpaceEngineersDedicated\<Instance name>\SpaceEngineers-Dedicated.cfg. (windows 7)

    C:\ProgramData\SpaceEngineersDedicated\<Instance name>\SpaceEngineers-Dedicated.cfg. (windows Server 2008)

    4. Edit the settings as as you see fit - most of these are self-explanatory and dictate the type of game that will be run (e.g. survival/creative, player limit, object limit etc).

    MOST IMPORTANT!

    <OnlineMode>PUBLIC</OnlineMode> - THIS MUST BE SET TO PUBLIC TO BE PUBLICLY ACCESSIBLE

    4. Start up your dedicated server again. Most of the settings in the UI seem to make little difference to what is in the config file, but I set mine to match just to be sure. The exception seems to be 'server admins' which does however seem to work :confused:

    5. If you haven't already, add rules to windows firewall to allow the SpaceEngineers dedicated executable incoming and outgoing connections. (You may need to stop and start the server again after this).

    The dedicated server executable seems to take a lot longer to start up my server so give it a few minutes, checking the log file to make sure it's finished before you check and test. Patience! :)

    For those following section B (hosting at home)

    6. You may have to set up port forwarding on your hardware router/firewall to allow the connections into and out of your network. There are literally thousands of different routers and firewall combinations with their own configuration process, so I'm afraid you're on your own for this step. If you miss this step, you will probably see your connection in steam (LAN) servers, but nobody else will be able to join.


    X. IT DIDN'T WORK!

    Did you follow all the steps or just skip to this from the start? Follow the steps! :)

    If you followed all the steps, you should have a dedicated server running with all the necessary firewall rules and port forwarding set up to make it work. Post your problem below (please, a little more detail than "I tried this and it still didn't work. Help!" because I can't do anything with that). Describe what you did, the settings you changed, what difference it made (if any), what you can see and what you can't.



    Y. I want to load a saved game on my server

    Easy. Copy your saved game into the savegame folder onto the dedicated server. You should know what configuration settings to change by now to get it running. .

    Z. My world closes after a while complaining that the host has left (usually with a previously saved game that has been loaded onto a server)

    The server seems to use the host player dying/quitting/leaving as a marker to close the server.

    Put your character in an unused cockpit in a station before you save. It's a workaround, and nobody will be able to enter the cockpit once the game has loaded (object is in use).

    EDIT: Do not remove your character with SEToolBox / manually editing. I'm looking for a better workaround.

    -----

    As always, comments, corrections and additions are welcome.
     
  2. Leatherneck

    Leatherneck Apprentice Engineer

    Messages:
    336
    Okay, so does the Host have to specifically be in a station console?

    The reason is that right now, the server host is in a respawn ship (in the middle of nowhere) and we are getting the same error of the "Host has left the game".
     
  3. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    Ok, So I tried to do that all, But I got stuck with

    It seems that I can't find the files, I only have the Default > Saves folder with LastLoaded.sbl in it.
    I started the Dedicated server configurator several times with different names and saves, Edit the config with the "edit config" button, but when I changed it, it didn't work either.

    Any idea's?

    Thanks
     
  4. Kielm

    Kielm Junior Engineer

    Messages:
    508
    Once you've opened the configuration tool, you have to actually run the server as if you were going to host a game in order to create the file.

    Opening the config tool isn't enough - the server has to initialize before the file is created.

    Hope that helps
     
  5. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    I've runned it and it actually said, Service Status: Running, But it still didn't gave me the file, I even created the map and file myself, but the program does not seem to find it.

    I've looked at the file destination of the config via the configurator, it seems to save it here:
    C:\ProgramData\SpaceEngineersDedicated\24G_Creative
     
  6. Kielm

    Kielm Junior Engineer

    Messages:
    508
    How long are you waiting?

    The server I'm using can take up three or four minutes to create the files necessary.

    Few questions:

    1. What OS are you using? Win 7? Server 2008?
    2. What exact location are you looking in for the files (copy/paste from explorer address bar if possible)

    As an example, my username is Kiel, and I'm using the default instance, creating a world called UK K-Survival (on a test machine), and the folder path to the save files is

    C:\Users\Kiel\AppData\Roaming\SpaceEngineersDedicated\Default\Saves\UK K-Survival

    My config file is located at

    C:\Users\Kiel\AppData\Roaming\SpaceEngineersDedicated\Default


    Two things you could try:

    1. Turn autosave on in the options to start it up and see if the saved games are created after 5-10 minutes
    2. Copy a saved game into the folder structure I've described above and see if the config tool can load it.
     
  7. Kielm

    Kielm Junior Engineer

    Messages:
    508
    Oh okay. Is that a Windows Server 2008 or higher?
     
  8. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    Windows 8.1

    But maybe, like you said, I didn't wait that long, I'll give that a shot first, Couldn't edit the file in that location I just said, something was still running even though I closed it.

    But I'll wait for 5 minutes now and see what happens :)
     
  9. QuantaCat

    QuantaCat Trainee Engineer

    Messages:
    91
    note: I have Windows7 and it still put it in "ProgramData\SpaceEngineersDedicated\(instance)"
     
  10. Kielm

    Kielm Junior Engineer

    Messages:
    508
    Thanks for the feedback - I have amended accordingly.
     
  11. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    So this is the file than for me? C:\ProgramData\SpaceEngineersDedicated\24G_Creative
    Only can't edit it somehow, Maybe I should wait for that too till everything is done or something ( note that it's not running then, but somehow the file thinks it is? )
     
  12. QuantaCat

    QuantaCat Trainee Engineer

    Messages:
    91
    You need to save it somewhere else, then copy it over.

    or start notepad or whatever you use to edit it in admin mode.
     
  13. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    Well, I'm out of options, I tried everything...

    This is my settings:
    Code:
    <?xml version="1.0"?>
    <MyConfigDedicated xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema">
      <SessionSettings>
        <GameMode>Creative</GameMode>
        <InventorySizeMultiplier>10</InventorySizeMultiplier>
        <AssemblerSpeedMultiplier>10</AssemblerSpeedMultiplier>
        <AssemblerEfficiencyMultiplier>10</AssemblerEfficiencyMultiplier>
        <RefinerySpeedMultiplier>10</RefinerySpeedMultiplier>
        <OnlineMode>PUBLIC</OnlineMode>
        <MaxPlayers>24</MaxPlayers>
        <MaxFloatingObjects>24</MaxFloatingObjects>
        <EnvironmentHostility>SAFE</EnvironmentHostility>
        <AutoHealing>true</AutoHealing>
        <EnableCopyPaste>false</EnableCopyPaste>
        <AutoSave>true</AutoSave>
        <WeaponsEnabled>true</WeaponsEnabled>
        <ShowPlayerNamesOnHud>true</ShowPlayerNamesOnHud>
        <ThrusterDamage>true</ThrusterDamage>
        <CargoShipsEnabled>false</CargoShipsEnabled>
      </SessionSettings>
      <Scenario>
        <TypeId>ScenarioDefinition</TypeId>
        <SubtypeId>TwoPlatforms</SubtypeId>
      </Scenario>
      <LoadWorld>C:\ProgramData\SpaceEngineersDedicated\24G_Creative\Saves\Created 2014-05-30 1948</LoadWorld>
      <IP>192.168.1.3</IP>
      <SteamPort>8766</SteamPort>
      <ServerPort>20004</ServerPort>
      <AsteroidAmount>4</AsteroidAmount>
      <Administrators />
      <GroupID>0</GroupID>
      <ServerName>[24G] TuaniFur Gaming Creative CO-OP</ServerName>
    </MyConfigDedicated>
    I've configured my ports too, so it's open for that server port, I disabled firewall, and this setting is showing in the configuration panel too, but I'm still not able to find the server, not in dedicated, not in friends, no where..

    I'm really clueless.. any options? I tried the 64 bit and the 32 bit version, no succes.
     
  14. John_Adams

    John_Adams Apprentice Engineer

    Messages:
    171
    Have you configured the ports to forward to the local IP address? Most people just open the port on the router/firewall and the OS, but forget to forward it on the router. Also, make sure you're using UDP ports, not TCP ports!
     
  15. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    Yeah I did that, UPD both on my firewall and Modem with router.
    [​IMG]
    Also, My pc Ip is the IP I used, just to be sure since I didn't saw the server with the default 0.0.0.0

    [​IMG]
     
  16. Denat

    Denat Trainee Engineer

    Messages:
    16
    @Replic: Public IP vs. Private IP.

    Your config is using your IP on the network (192.168......) - Your configurator has 0.0.0.0 which is invalid.

    Look at that: https://www.whatismyip.com/

    THAT is your IP on the internet. Use that IP for your server, open the correct port in your router pointing to YOUR machine (private ip) and you're good.
     
  17. Vdragon

    Vdragon Apprentice Engineer

    Messages:
    326
    If you did read the documentation, you'd know that it's not invalid.
    It just mean that the dedicated server will use all interface possible, including the one which access the internet.
     
  18. StuffYouFear

    StuffYouFear Apprentice Engineer

    Messages:
    416
    to OP, this was just put into the change log by a new fourms member, be sure to thank him if this does indeed work

     
  19. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    0.0.0.0 is not invalid, it's a automatic search for best, but I did changed it to the 192.168 ( thought I needed that one )

    But now I changed it to the IP that is on whats my IP, the ports are set via that IP too, but when I check, I get this at "Can they see me":

    I could not see your service on 83.134.... on port (20004)

    Although the port is open in FireWall and My modem that has a router, It's somehow still not working.
     
  20. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    I changed the ports to something that canyouseeme could see, still no effect, not in the serverlist either on steam ( on lan )
    I think I give up, I've tried every possible thing now, It's not working / preventing me from creating a Public or even lan server.
     
  21. marsbear

    marsbear Trainee Engineer

    Messages:
    6
    Hey don't give up yet :) I got some more hints...

    canyouseeme
    I am not 100% sure but this won't work anyway. The server uses UDP and canyouseeme propably checks for TCP connections. That makes perfect sense as UDP per se is stateless and you can't 'establish' a connection to a UDP port like with TCP. It doesn't see my server, too.

    config location
    It is normal that you can't write into ProgramData without admin permissions. That folder is meant for apps to store their data in. The dedicated server should be able to access it's config files though. You should double check if the config file changes accordingly if you change settings in the server and save them.

    connection issues
    You said you were not able to create a lan game. Is that correct? Because that would mean that (at least your main problem) is not your router configuration. Can you confirm that you can't join your own server after creating it?

    The windows firewall shouldn't be an issue if you configured your network to be a home- or office-network (Windows asks when you connect to a network if it is home, office or public). You can double check that in the network and sharing center. This might be different if you tinkered with your firewall already or changed the security level for home- and office-networks.

    Things to try
    • Don't use the server as a service but use the local / console server for better testing (console output...) and check for errors on server start-up.
    • After the server launched and printed 'Game ready...' at the console, do a 'netstat -ap udp' and check if your computer is listening on the port you configured. Additionally check if the port 27016 is listening, as this is the default port for the dedicated server (would indicate a config issue...)
    • Check if other apps are running on your configured port with 'netstat -abp udp' (needs console with admin privileges) before you start the server.
    • If you are able to connect to your own server but still can't have other players connect to it, post a screenshot of the port forwarding rule. The screenshot you posted looked more like a firewall rule. Please do not post the forwarding rules entry in the list of forwarding rules but the configuration page for that specific rule.
    Last thoughts
    • You need more than 24 floating objects :) This is inventory stuff or little ore rocks floating in space and if you use connectors and collectors or if you are mining by hand you want at least 64 (I use 256)
    • Your save-game's name looks odd. Mine has the name like I named the world I was hosting in my game. Maybe something went wrong while copying it over?! But I'm not exactly sure as this is the only world I ever created.
    Hope that helps :/
     
  22. rEprEzEnt

    rEprEzEnt Trainee Engineer

    Messages:
    2
    No offense but this tutorial is horrible. I had my server running for a good 15minutes log out. Still no config file. Can ANYONE provide real information on where this config file is actually located? Any help would be greatly appreciated.

    My issue is that I can not get the number of players to save and the mode of gameplay. I'm able to set the name, set the map, have people play, and change the visibility mode of the game.
     
  23. marsbear

    marsbear Trainee Engineer

    Messages:
    6
    On my Win 8.1 it is located under:
    C:\Users\<youruser>\AppData\Roaming\SpaceEngineersDedicated\Default

    Same on Win 7.
    I have the Steam-Version of Space Engineers.
     
  24. AgentMN

    AgentMN Trainee Engineer

    Messages:
    16
    The file is only created at those locations if you're using a local session. If you use a Windows service server, well, I still have no idea where the values are.
     
  25. marsbear

    marsbear Trainee Engineer

    Messages:
    6
    If it is a server running as a service the config files are in this folder:
    C:\ProgramData\SpaceEngineersDedicated

    There's one sub-folder for each server instance.
     
  26. Replic TuaniOne

    Replic TuaniOne Apprentice Engineer

    Messages:
    485
    Here is a list with things I tried: https://forums.keenswh.com/post/server-not-showing-public-and-lan-6924113?pid=1283008114#post1283008114

    I'm now going to try the netstat thing and local/console

    I'm using a different port since that was the only one that came through via canyouseeme, even though you say it's not really reliable, but the port is used for my skype though, but it was the only one that could go though it (My port forwards didn't, even though I really checked everything on the ports and make it a free connection for both inbound and outbound, same with firewall, the rules are good, I've looked it up.)\

    And indeed, I can't even connect to my own server since I can't find it in my Lan when you go to Steam > View > Servers > Lan

    I tried this Ingame too, but no succes.
     
  27. Naut

    Naut Apprentice Engineer

    Messages:
    113
    Dont know if this belongs here, but i found out the following:

    I cant see my server because my ISP is giving me an ipv6 adress, using the DS-Lite technology. As far as i understood DS-Lite is something which makes an ipv6 adress compatible with the ipv4 world (which 95% of the internet still uses). It also means, that i have no real ipv4 adress for the rest of the world and that i cant forward ports in my router. (even if you are configuring your routerports, it doesnt apply)

    Short version: No portforwarding, no hosting
     
  28. marsbear

    marsbear Trainee Engineer

    Messages:
    6
    Well ReplicTuaniOne if Skype was running while you tried to start your server it is understandable that it didn't work. Skype probably occupies the udp port, too (e.g. it does with port 25809 tcp and udp on my machine).

    I don't know what your current setting for the listening ip is, but you can leave it at 0.0.0.0 which means it listens on all interfaces. If you want to provide an ip, use your lan interfaces ip. I don't know who wrote it but using your externel / routers ip won't work. If you're lucky the server detects that your external ip is not available on any of the computers interfaces and ignores the setting. But it is more likely that it just won't start up anymore.

    canyouseeme is not unreliable but the wrong tool for the task :) You found your Skype port because Skype uses tcp. I am pretty sure it can't work with udp because well, it won't make sense.

    By now I am sure your problem is not your port forwarding (yet), as your server doesn't seem to start at all (backed by the facts that you can't stop the service properly and you can't see it on the lan server list). The local servers console should easily reveal what's wrong.
     
  29. Chaveex

    Chaveex Trainee Engineer

    Messages:
    1
    Hi guys !

    I want to use a dedicated server with my friends to play together.
    I wanna keep the world where we worked a lot. So I put the saved workd into the correct directory. When I use the dedicatedServer64.exe, I have selected Local/Console, and found the saved world. Until everything is ok.
    So I save and run the server. I edit the config, I write FRIENDS into the xml balise <onlineMode>. I save it and run again the server.
    It appears in LAN, so then my friends cannot join.
    I have selected the port 27016.
    Here is my router config for the IP, but i don't know what I should put and where to get my server visible
    https://imgur.com/hG9SDJk
    Can you please help me ?
     
  30. marsbear

    marsbear Trainee Engineer

    Messages:
    6
    The external port is 27016, protocol is UDP, ip is your internal ip within your lan, internal port is 27016 aswell.

    You can figure out your ip at the terminal with:
    ipconfig /all

    It should list one or more network interfaces and some interface called roughly like 'Ethernet-Adapter LAN-Connection' should show your ip address. As your router already suggests an address starting with 192.168.0. it is very likely that your ip looks that way and ends with something between 2 and 254.
     
Thread Status:
This last post in this thread was made more than 31 days old.