FortressCraft Evolved Guide

How to Setup a Dedicated Server for FortressCraft Evolved

How to Setup a Dedicated Server

Overview

This is a Guide to get your own Dedicated Linux server running.

Requirements

Hardware:
(Min Recommendations from the Multiplayer Threat)

  • >8 GB RAM
  • 1.4Ghz CPU
  • 10GB of Disk space
  • 1-2Mbit/s per Client

A 1.4 Ghz system may provide enough processing power for 2-6 Players. With the New (Patch 13) Packet loss autokick the bandwidth is more important then before. (10% loss = warning, 25% = autokick.

If you have a decent machine, you can also Host on it and play at the same time on the same machine. DONT run the same World in Singleplayer. Join the server via the Multiplayer screen with IP 127.0.0.1:GAMEPORT.

Software:
Linux Server:

  • Ubuntu 16.04.1 Server 64-Bit (Some command knowledge is required)
  • console text editor
  • screen installed (if not “sudo apt-get install screen”)
  • SteamCMD installed and ready to work with (check [link] for installation instructions)
  • The Server is trying to open Ports by itself via UPnP (depending on youre Hardware its workign or not)
  • Open the Ports, you configure later, in youre Router/ Firewall. Ports are UDP.

Windows Server:

  • Windowsserver 64-Bit (Some command knowledge is required)
  • Way to access it remotly (Teamviewer, VNC)
  • Steamcmd installed and Ready to work with (check link above)
  • The Server is trying to open Ports by itself via UPnP (depending on youre Hardware its workign or not)
  • Open the Ports, you configure later, in youre Router/ Firewall. Ports are UDP
  • FTP server installed, configured

Adminsystem:

    Linux

  • SSH Programm (Author is using Kitty[www.fosshub.com])
    The guide is written “for” Ubuntu, other Linux distro’s may work also, but i cant guarantee that it’s exactly the same procedure.
  • As text editor this guide is using nano, it’s your choose what editor you use.
  • FTP Client

    Windows

  • Remoteconnection programm (same as used on the server)
  • FTP Client

    Both

  • RCONClient (mcRCON from Patch 19 onwards is provided in the Gamefiles. Any other Client should work (not granted though))

Explanations:
$COMMAND will show you that its a console command that you need to type in. (only the COMMAND Part)
Things Written in CAPITAL LETTERS are things that are variable. Chage it as you need it.

Linux is Casesensitive. Names and commands are too. Also try to avoid Spaces in your paths. Unity seams to get Problems from them.

Informations:
Also, For Linux the Tutorial is “tested” for Headless servers only, there may/will be differences on UI systems.

The Headless server has by default all DLC’s and Packs.
Linux servers only get an update when Mainbranch is Updated.
Bleeding Edge build servers are only aviable for Windows. (not mentioned here but work nearly the same)

By Starting your own server, im expecting you to have a basic knowledge of the game already. If you have Questions to Difficultysettings and other things, look here: FortressCraft Wikia[fortresscrafte.wikia.com]

Downloading the Server

Both In the Steam “Tools” section is also a Dedicated server tool (the same as we are getting with the method below actually. Linux has to go the the “linux_server_headless” beta as below.)
If youre on a Grpahic interface and have Steam installed you can use this method too. The Scripts below are for Graphicless systems or if you want to automate it.

After you have installed SteamCMD you need to get the FortressCraft Evolved Server it self.

Additional for easier update later, we use a Script for that.
Navigate to your steamcmd executable.

First the command then the explanations.

Linux
steamcmd.sh +login anonymous +force_install_dir INSTALLPATH +app_update 443600 -beta linux_server_headless validate +quit

Windows (Stable branch)
steamcmd +login anonymous +force_install_dir INSTALLPATH +app_update 443600 validate +quit

  • +login NAME PASSWORD will log you into the steam servers to get the data.
    Ananymous Download is aviable for the Packets, so you don’t need to write your credentials in a script you may accidently share.

  • +force_install_dir INSTALLPATH this will install your server files to a certain Path on your system. by using a relativ path, the downloader will the Files send to a subdirectory where the steamCDM.sh is located. Using a definite Path, the downloader will send them anywhere on your system.
  • +app_update 443600 will Download the Dedicated server (by default the windows one).
  • -beta linux_server_headless with the -beta is specified which beta brach you want. In this case the Linux_server_headless on. All aviable branches for this ID are listed here[steamdb.info].
  • validate Validate will obviously validate your data. when a Update is aviable, it will be Dowonloaded, if you missconfigure something or can’t get the server working (if caused by Data errors) just run the update.sh and your good (hope atleast).
  • +quit Will exit the Steamcmd executable.

Windows servers dont need the -beta step to be used as they install the default public branch.

As it’s mentioned above, it’s easier to run this thing via a Script. So lets make one.

Linux

  • $touch update.sh will genearate an empty file, named update.sh (rename if needed).
  • $nano update.sh open the script file with nano.
  • After customizing it, add this code to your script file:
    #!/bin/bash echo Serverupdate is running steamcmd.sh +login anonymous +force_install_dir INSTALLPATH +app_update 443600 -beta linux_server_headless validate +quit echo Dedicated server up to date and validated

    #!/bin/bash will define the script as executable, echo will simply print the string after the command.

    Safe the script (in nano [CTRL]+[O]).
    $sh update.sh will run it.

    Windows

  • Create a file thats called update.txt
  • fill the following lines in:
    @ShutdownOnFailedCommand 1 //set to 0 if updating multiple servers at once @NoPromptForPassword 1 login anonymous force_install_dir ../dediserver app_update 443600 validate quit

    run it with steamcmd +runscript update.txt.

    The SteamCMD will now download the Files.
    Wait for it to Complete

Configuration of the Server

Download finished and ready, you need to configure the server for you wishes.
For this task go to your installation directory and locate the firstrun.ini and serveroverrides.ini in the “/Default/Example Server Ini files/” Folder.

When your fine with the settings, copy both files one Filelevel higher, to “/Default/”.
Only there the Game will read them at startup.

The Defaults are as followed, explanations beneath.
firstrun.ini

[config] –Can be rapid / plentiful / scarce / greg Resources = greg –Can be fast / slow Conveyors = slow –Can be Plentiful or Scarce Power = scarce –Can be eternal/normal/night Day = normal RushMode = false FlatLand = false CarePackage = false Name=Dedicated Server World

serveroverride.ini

[config] RCONPort = 27015 RCONPassword = Password ;Change it ASAP ServerPort = 27012 MaxPlayers = 65 NetworkBufferSize = 2097152 ; Faster, less stable < 2097152 > Slower, more stable MinimumLatency = 200 ; Less RAM usage, more packet problems < 200 > More RAM usage, less Packet problems WorldName = Worldname ; Specific World to load by the server at startup

The firstrun.ini will be used when the server can’t find an existing world (more on using your world later)
Lets go through the settings then.

Important: The Worldsettings you choose will NOT be changable once the World is generated.

  • Rescources defines what richness your veins will have. (rapid>plentiful>scarce>greg)
  • Conveyors with the fast setting will transport stuff faster then slow ones
  • Power will be generated faster or not.
  • Day setting will influence your power generation quite a bit. Going form eternal Day with its sun permanently up. To normal with its Day/Night cycle, to Night where the sun never rises.
  • Rushmode will give you a timer to beat. To do this, kill the 4 Overminds as fast a possible.
  • Flatland will generate only a flat map for you to play on.
  • CarePackege will massively boost your progress early on.
  • Name lets you set the World name, what’s the Seed of the Terrain generation and the Listing name in the Server in the Server list.

Rushmode, Flatland, Carepackage can be true or false.

The serveroverride.ini will be read every time the server is starting up. (Ports are in UDP)

  • RCONPort is the Port from where the RCON protocol will be able to connect to the Serverconsole
  • RCONPassword This Password will be used to authenticate you for the Server console use. Its HIGHLY recommended to change it to something else then ‘Password’.
  • ServerPort This will be the Port you need to open to let other Players join over the Internet.
  • MaxPlayers should be adjusted to how many players your server/ bandwidth can handle.
  • NetworkBufferSize is outgoing buffersize in Bytes/per Client (Default 2097152 (~2 megabyte)). Decreasing this may decrease latency. Increasing it may increase reliability.
  • MinLatency time of “timeout”(in ms) for a package (Default is 200). Increasing this number may give a slower gaming experience for clients, but should reduce the resends. If you are seeing players being kicked from your server, you can try increasing this. I would not recommend going above 1,000 (what’s 1s of timeout (that’s VERY LONG)). Increasing this number may cause large amounts of RAM bloating.
  • WorldName when multiple Worlds are in the Worlds-folder, the name can be specified here.

Forward the RCON- and Serverport as needed. For hosting only in a LAN you don’t need to forward them. If you want to let Players from around the World join, just open the ServerPort.
MaxPlayers needs always to be +1 caused by the virtual host-player.

Windows Hosts Only:
For a shorter and easier Configuration there is now a UI featured Tool.
In the Tools folder is a Sub folder “DedicatedServerLauncher” and start the Executable there. The settings will be taken over from the Launcher into the Settings files (Fistrun and Serveroverride).

First Startup / Getting a custom world to the server

With the Configs ready as you wish, lets start the server for a first try.

Important

When you create a world on the server, independend of your settings, you WONT get the items you get after the Tutorial! The Virtual host gets the items, so there is no way to access them. To get around the initial breakepoint Create a world in Sinlgeplayer and follow the steps below to get it to your server. (as P16 is newest atm, Mutators cant be applied to a Server generated world also)

The Generation has sometimes Hickups and generates a Crativ world instead of Survival. As a first way, remove the world and generate a new one. As second, check the Settings, check the files. As third, Upload a custom world.

Navigate to the Installation path of the server files, locate the FC_Linux_Universal.x86(_64 for 64bit), Windows: Dedicated Server.bat
and run it.
$ FC_Linux_Universal.x86_64 -batchmode,
Windows has the -batchmode already in the *.bat included.

The Parameter -batchmode will run the executable as a commandline program.
Linux:
As the server is starting up, there will be some output of paths and after that, the comandline won’t update anymore, as long your server is running. Don’t Panic it has to be that way (may change in future).
Your server should now be starting, wait a minute or two and try to join it.

Windows:
The Comandline prompt will give you informations. You can also controlle the server via that prompt. RCON will also work for remote access. Wait for the message “Server now ready for Players to join!”. Your server is now running. (Skip the startscript step for Linux.)

Linux:
For easier starting, maintaining, i’ll show you how to do it with a script.
$nano start.sh

#!/bin/bash echo “” echo $(date) echo “” cd SERVERLOCATION FC_Linux_Universal.x86_64 -batchmode

Explanation:
#!/bin/bash marks the file as executable with $sh
echo will give you whats following as a text(“” will print a empty line)
echo $(date) will print the actual date and time (I’ve added this to see when the server was started
cd SERVERLOCATION will change the directory to where the executable is (replace the SERVERLOCATION with the absolute path where you installed the game files, it won’t work otherwise)
./FC_Linux_Universal.x86_64 -batchmode as above, will start your server.

Both:
After messing a bit around in your world, leave the server and force stop it with [CTRL] + [C]. This is a really dirty way to stop your server please only do it as a absolute last step. The world will not save the last changes to the world.
Windows: this method works for you also, but as you have the console, use “Quit” to shutdown the server cleanly.

Players who don’t want a Custom Map installed, Skip the following Step. For the others read ahead.
Create a world with your needs on your local machine and .zip it. The world can be found in the same paths as mentioned a bit further down.

Linux:
To unzip it on your server, get unzip installed ($sudo apt-get install unzip). Second you need it on your server. An FTP Client[linuxservertutorials.blogspot.ch] is on ubuntu server already installed. So you need the file somewhere accessible via ftp. (I use a NAS which is in the same LAN. There is also the option to get it via USB Storage[askubuntu.com] (Not explained cause of length) on your server.

Make sure your in your Home directory. (do cd to get there.)
Open FTP in a commandline
$ftp
connect to your Storage
open IP (can also be a public IP of a hoster (not sure if
authentificate yourself when asked for, navigate to the file
get FILENAME to download the filename to the current directory
after the Download has finished, type exit. FTP will give you a “good bye” and send you back to the directory you were in before opening FTP.
now type $ls to confirm the file is really there.

now copy it with $cp FILENAME .config/unity3d/ProjectorGames/FortressCraft/Worlds/
(the . in front of config defines it as a hidden Directory. So external FTP programms may not displayit)
To the Directory where the Worlds are being stored. Now change your cursor to this path also.
$cd .config/unity3d/ProjectorGames/FortressCraft/Worlds/.
Remove the existing world with $rm -r WORLDNAME
Unzip the Zip-File of your world. $unzip FILENAME.zip
Now run a $ls to get a listing of the current files in this Directory.
Your World should now sit there, unleashed from its Zip-File cage.

Windows:
Get a Filezillaserver[filezilla-project.org] running on your Server for FTP access.
upload the zipped world to the “C:UsersUSERNAMEAppDataLocalLowProjectorGamesFortressCraftWorlds” Directory.
Unzip it and you are good to go.

Make sure you only have this world in this Directory as the server will take the first one he gets. It now should be loaded at the next startup.

Start & Maintain your server

For Windows users is this chapter relatively boring because everything can be done via the remoteaccess. The part about Pico might be interesting.

Linux:
To have the server running even when disconnected from the SSH session, use screen as its shipped with the Ubuntu server installation (if not $sudo apt-get install screen)
To open a new Screen do:
$screen -R NAME
the -R will open a new screen, later you can use screen -r NAME to attach the already existing.Name can be a custom one (i recommend lowercase(easier typing)).

when you see the [New Screen…] press Enter once and navigate to your start.sh location. Run it and wait until your server is up (20-30 s). As soon its done booting up, hit [CTRL] + [A] + [D] to detach your current screen session. (with $screen -ls can all existing session be listed.)

To maintain your server, do reboots, updates, what ever, you need to shut it down first.
To do this, Open PicoRCON from your YOUR/INSTALL/OF/FCE/Tools. Unzip it somewere and run the PicoRCON.exe.
Type connect IP:PORT PASSWORD to get to your server. Now you can use the servercommands. (listed below).

The server still won’t reply usefull information to you but at least you get a info that your command was sucessfully run. (Should change in Patch 14).

It’s recommended to make Backups regularly (Store it somewhere else. I’m using FTP to store it back to my NAS (The one from the world upload). So its off system and can collect Dust there.

If you got Problems, retrieve the serverlog.
Can be found in
Linux: /home/USERNAME/.config/unity3d/ProjectorGames/FortressCraft/Player.log
Windows: INSTALLDIR/OF/SERVER/FC_64_Data/output_log.txt or FC_32_Data for 32 bit.

It’s normal with around 200k lines after 24-48 hrs of runtime. (will decrese as the server gets more stable (i supose)). Filesize of a few Megabyte’s are okey. Gigabytes is a problem.

Linux
As writen above, your Console output might look like

Set current directory to /home/steam/FortressCraft Found path: /home/steam/FortressCraft/FC_Linux_Universal.x86_64 Mono path[0] = ‘/home/steam/FortressCraft/FC_Linux_Universal_Data/Managed’ Mono path[1] = ‘/home/steam/FortressCraft/FC_Linux_Universal_Data/Mono’ Mono config path = ‘/home/steam/FortressCraft/FC_Linux_Universal_Data/Mono/etc’

but thats okey. GIve it time and if its not startign have a look at the Log (names Player.log and is located in /home/USERNAME/.config/unity3d/ProjectorGames/FortressCraft/Player.log). When you have Problems, check the Settings files (missspellings, Casesensitive correct?)

Getting the Permissions to Build:
(Reference to the Comands section)
Use either Autopromote to give ALL joining Players Builderpermissions or use Builderlist Add NAME to give a specivic Person Builderpermissions.

Modding the Mods

As always shutdown your server cleanly before youre toying around with the gamefiles.

The following Lines are copied (sort off) from the “FortressCraft Evolved Modding API.pdf” that can be found in the Installationdirectory fo FortressCraft in “…SteamAppscommonFortressCraft64Default” (or ..32.. when your playing in 32-Bit).
(see Chapter 3 – 4 (specialy 4.1))

First get your Mod(s) to your Computer.
Subscribe to it/them in the Workshop and wait for the Download to finish.

You will find the mods in the “…Steamsteamappsworkshopcontent254200WorkshopID” directory.

Head to the Directroy tree where the world and such is stored.
(copy from the ModAPI.pdf)
go to
Linux: /home/<user_name>/.config/unity3d/ProjectorGames/FortressCraft/
Windows: C:UsersUSERNAMEAppDataLocalProjectorGamesFortressCraft
and create the new Directory named WorkshopMods.

Now copy the files 1:1 over there with your favorite methode (i recommend zipping it, transfer with FTP and unzip it again in this folder).

Now open the local version of your world in FCE and configure which mods you want to use. Get the “modsettings.xml” from your World safe directory and upload it in the World on the server (same spot as local).
Make sure you get the modsettings.crc, modsettings.bak and modsettings.bak.crc as well on the server. FCE tries to repair a changed File (which it uses the CRC’s for). Alternativly, delete the just mentioned files on the server so you only have the modsettings.xml left.

Start your server, select the mods you activated on the world, join and have fun with your new Content.

Commands

Following is a List of known Commands that the server will accept (may Change over develepment time). Screwing up your server while Using the Commands is your fault, not mine. Descritions are also not guaranteed for correctness
The Variable NAME is Casesensitive and Symbols, punctiation are also respected.
([**^^L33T Hax00r^^!!!*] have fun with Typing)

The Commands are in P14 and before only accepted when sent via PicoRCON, The Comandlineprompt is only on Windows an option as Linux works differend for Comandline Input then Windows. Linux and Mac are Required to use PicoRCON (Or use a modified Rcon client whos missing the second Null-Termination Byte on the Send Packet Side. If the server gets two it does’nt understand the Comand and drops it (Login is’nt possible in the first hand).

Quit, Exit saves the World and shutdown of Server “the nice Way”

FCQuit for the RCON users outthere, as Pico will close on the Quit command, Exit should work though.
autopause When empty pause the world simulation

autopromote Give all joining players builder permissions Use with care

setpublic ok gets the server listed in the public list.USE FOR YOUR OWN RISK
To get Players a better idea of the game, Please Open your Server to public. Players who will visit your server cant chat, cant remove block’s. So its mostly safe to have it publicly listed.

Rate will change the segments per second sent by server. (Default is 4096) Higher number neans more Bandwith is used.

report a Report will be generated giving back valuable informations.
mobs Gives back some infos about Mobs

items gives Fedback about around laying items on ground

cache Changes how the World will be saved, and what the server will keep in cache. (Behaviour is assumed, cant tell for sure)

  • nocache Server has no Cache and writes everything to Disk asap
  • Compressduringplay Server does Compression of unused Segments during Playtime and puts them to Disk
  • compressonexit Only Compress on Exit of the Server (may cause increased Ram usage)
  • cacheonly After Startignup of the world Keep Everything in RAM what gets Loaded from Disk. Will Increase Ram usage quite sure
  • CompressWhenServerEmpty Compress and Store Segements when the Server is Empty.

Whitelist,Adminlist and Builderlist will throw an error when sent to the sever with Pico.
whitelist

  • On
  • Off
  • add NAME
  • remove NAME

adminlist Is used for gifing Players Admin-Permissions

  • add NAME,
  • remove NAME
  • list

builderlist Is used for giving Players Builder-Permissions

  • add NAME
  • remove NAME
  • list

kick NAME Kick’s Player NAME
ban NAME Ban’s Player NAME
unban NAMEUnban’s Player NAME

flushcache Flush the currently loaded world data and reload it.

Commands that do exsist but unknow behavior (server will do something)
machines
savedump
netsleep

Troubleshooting youre server

Following is a List of common Errors youre Serverlog might list. (this list is not complete, by far, coment below if you have something (Problem + Solution))

    Server is not starting up
  • DIG WARNING! USER ID IS ZERO!
  • [S_API FAIL] SteamAPI_Init() failed; SteamAPI_IsSteamRunning() failed.
    [S_API FAIL] SteamAPI_Init() failed; unable to locate a running instance of Steam, or a local steamclient.so.
    Solution:
    Are you runnign the Executable with the “-batchmode” option?

    The server is not showing up when another player tries to connect to it via IP and Port directly
  • Check youre Firewall, are the Ports forwarded?
  • Is UPNP working correctly? If not, you need port forwarding.
  • Is youre Anti Virus blocking the server cause it thinks youre DDOS’ing someone?
  • Are you trying to host over WLAN?
  • Is youre ISP allowing Hosting of servers at all? (i.e. Blocking a big amount of big packets -> DDOS Protection of youre Target)
  • Do you provide the correct IP to youre firends? VPN’s are a bad idea most times. Better use [link] or a simmilar Site to get youre Public IP.
    Players are getting kicked for Packetloss > 25%
  • Check the Hardware from youre Server to the Client all the way through. Is youre Switch/ Router old or a realy cheap one who cant keep up with the Load, is youre Landline quite bad (Ask you’re ISp if they can do a test how much loss they see over youre line)
  • WIFI? (Please don’t) (Client nor Server)
  • LTE Wireless Modem on one site? (see above)
    I get a “Delaying until Headless server check active” Message and the server isnt starting
  • Check if your Root Partition is full. The Game stores the server in your specified Directory but the World is saved in the Home Folder of the User thats running the server.
    Im not sure about this output of on my Serverconsole
  • [link]
  • This is normal. The server cant find some files, but as long as the Server starts up after a couple minutes at the configured IP, Port all is good.
SteamSolo.com