Dedicated Server (Killing Floor 2)

From Tripwire Interactive Wiki
Revision as of 23:23, 21 April 2015 by Harry (talk | contribs) (KF2 dedicated server is NOT part of subscription for KF2. thus people should use anonymous login!)
Jump to navigation Jump to search

Creating Dedicated Server (Killing Floor 2)

Downloading and Running the SteamCMD Update Tool

  1. Download the SteamCMD Update Tool:
  2. Extract the contents to a directory (Windows example: C:\SteamCmd\).
    Do not extract the contents of the updater tool to the regular Steam Client folder or to a folder that has the older HLDSUpdateTool program.
  3. Launch SteamCmd (NOTE: To automate this process for future updates, see #Automating SteamCmd).
  4. Open a command prompt in that directory and start SteamCmd. On Windows, type steamcmd. The program will automatically update and enter you in to a Steam> prompt. Type help for more information.
  5. Log in with the username "anonymous", by typing: "login anonymous"
  6. You should see a message stating that you have successfully logged in anonymously.

Downloading the Killing Floor 2 Server

This describes the process of updating the KF2 dedicated server application. These steps are required every time the game is updated. To automate this process for future updates, see #Automating SteamCmd.
1. If you aren't proceeding from the previous set of instructions, first launch SteamCmd.
2. At the Steam> prompt, set your KF2 Dedicated Server install directory.
Examples:
Absolute Path:
force_install_dir c:\KF2Server\
Up one folder:
force_install_dir ..\KF2Server\
In the Steam Command folder:
force_install_dir .\KF2Server\
3. Install or Update KF2.
If this is your first time installing or if you are trying to verify the integrity of the server files:
app_update 232130 validate
If this is simply an update to an existing KF2 dedicated server:
app_update 232130
If Tripwire is currently running a beta update of the dedicated server files:
app_update 232130 -beta "branch name"

Where "branch name" is the current beta branch. Currently there is not a live dedicated server beta branch.

4. Once finished, type quit at the Steam> prompt to properly log off of the Steam servers.

Automating SteamCmd

There are two ways to automate SteamCmd.

1. Add commands to the command line. Example:
SteamCmd +login anonymous +force_install_dir ./kf2_ds +app_update 232130 validate
2. Create a script.
a. Put your SteamCmd commands in a text file. Example:
// update_kf2_ds.txt
//
login anonymous
force_install_dir ./kf2server
app_update 232130 validate
exit
b. Run SteamCmd with the +runscript option. Example:
SteamCmd +runscript kf2_ds.txt

Starting the Server

Use the batch file downloaded with the server or create your own. To launch a server with default settings on Survival Biotics Lab use the following batch script:

start .\Binaries\win64\kfserver kf-bioticslab

Pre-Requisites

Currently the server has several dependencies. As such we have shipped the UE3Redist.exe with the server files and it can be found in the "\Binaries\Redist" sub folder of where you have installed the server from SteamCMD.

Ports

By default the server will use the following ports:

Port Default What this option controls
Game Port 7777 This is the main port the game will send connections over
Query Port 27015 This port is used to communicate with the Steam Master Server
Web Admin 8080 This port is used to connect to your servers web admin page (if turned on)
Steam Port 20560

Advanced Configuration

Configuring your new Killing Floor 2 server will be very similar to those who have set up any Unreal Engine 3 server (such as UT 3). However to those who are from other engines such as IdTech and Source there are many differences, which we'll cover here. Those who are also looking for specific sever config settings will likely find what they are looking for below.

Please note: You will need to launch your server once for it to generate config files (based of the default config files that come with the install. It is strongly recommended you do NOT ever edit one of the default config files).

Command Line Launch Options

You can use several command line launch options to help quickly launch a server. These include url arguments attached to the command line itself (example ...bioticslab?optionhere=x?option2here=x) as well as switches which are included after the main line (example ...bioticslab -switchhere -switch2here)

Url Arguments Valid Entries What this option controls
AdminName= Alpha numeric character combinations. Example: Admin This is the admin username for WebAdmin if youre configuring WebAdmin via Commandline
AdminPassword= Alpha numeric character combinations. Example: Abd32Sdn53 This is the master server administrator password
MaxPlayers= Alpha numeric character combinations. Example: 6 This is how many maximum players the server is set to support
GameDifficulty= Numeric characters 0-3 This sets the server difficulty. 0 = Normal, 1 = Hard, 2 = Suicidal, 3 = Hell on Earth
Switches Valid Entries What this option controls
Port= Alpha numeric character combinations. Example: 7787 This is the game port. Changing this without changing the query port will automatically change the query port as well (up/down the same number from the default game port)
QueryPort= Alpha numeric character combinations. Example: 27015 This is the query port. Changing this will change the port the server uses to communicate with Steam. Default is 27015. Change this in your launch will make it different from the automatic change that happens if you change the default port.
WebAdminPort= Alpha numeric character combinations. Example: 8080 This is the web admin port. Changing this will change the port used to connect to the servers webadmin panel if that functionality is turned on. This switch is still in Beta, use at your own risk.
Multihome= An IP that can resolve to the server machine. Example: 192.168.0.1 If a server machine can resolve to multiple IP's, this command can tie a server to a specific IP on that machine.
PREFERPROCESSOR= Numeric characters. Example: 2 This will tie a server process to a single core/thread on the hosting machine.
ConfigSubDir= Alpha numeric character combinations. Example: KF2Server-Normal-Long1 Creates and reads settings from a sub directory under ./KFGame/Config which allows you to configure .INI settings on a per server basis.

PCServer-KFGame.ini

The PCServer-KFGame.ini file can be found under \KFGame\Config\

This file controls all the various game elements that can be configured by admins in Killing Floor2. From game modes to spectating options and more, everything can be set up to the admins liking from this file.

First admins will want to configure this file to update the WebAdmin, server password and other settings that you do have access to. Here is an example of a very simple PCServer-KFGame.ini settings admins will want to change first:

Server Passwords

[Engine.AccessControl] in PCServer-KFGame.ini:
Option Name Valid Entries What this option controls
AdminPassword Alpha numeric character combinations. Example: Abd32Sdn53 This is the master server administrator password
GamePassword Alpha numeric character combinations. Example: cl4ng4m3 This sets a password players will need to enter to join the server

Server Name and Admin Contact

[Engine.GameReplicationInfo] in PCServer-KFGame.ini:
Option Name Valid Entries What this option controls
ServerName Alpha numeric character combinations. Example: Yoshi's House of 32 Compressed Pancakes This is the displayed server name to all players in the server and the server browser
AdminContact Alpha numeric character combinations. Example: [email protected] This is the displayed admin contact in the server browser


Maps

bUseMapList=True - This sets the server to use a custom map list you specify instead of the entire default map list.

Maps can be set to run by gametype and amount of rounds played. The following is an example map list that can be put in your rogame.ini:

Game Map Cycle
GameMapCycles=(Maps=("KF-BurningParis","KF-Bioticslab","KF-Outpost"))

The first part specifies the exact maps and their game types.

PCServer-KFEngine.ini

The Engine.ini is where most port related changes can be made to a server, including the game port and query port.

Setting Up Web Admin

To enable webadmin: Open KFWeb.ini. In the [IpDrv.WebServer] section set

bEnabled=true

By default webadmin will listen on port 8080 on the IP of the game server using, but you'll want to customize this port for multiple servers on the same IP. To change this, open KFweb.ini and modify the following line:

ListenPort=8080

Admins will now be able to log into their servers web admin panel. They can do by either connecting via a local address (if the server is local) or web address (the servers IP) followed by the port. They can use any of their favorite modern internet browsers such as Chrome, Firefox, and IE. An example of what to put in the address bar of the browser is:

192.168.0.100:8080

They will be presented with a login screen. The default user is: Admin. The password will be whatever was set as the admin pass in PCServer-KFGame.ini. If no admin pass was set, the admin will not be able to log in.


Setting up multiple web admins

Open KFWebAdmin.ini and add the following under [WebAdmin.WebAdmin]:

AuthenticationClass=WebAdmin.MultiWebAdminAuth

Start the server once to generate a new MultiAdmin.ini. Now you can either add new admin names and passwords from within the Web Admin itself, or you can add them manually in the file. To do so add the following information for each admin under [Admin MultiAdminData] in MultiAdmin.ini

DisplayName=			"AdminNameHere" // Punctuation does matter for these names
Password=			"123" // Any alpha numeric set of characters will work here
Order=				"DenyAllow"
bEnabled=			"True" // This enables this admin

How To Use Web Admin

Go to web admin to find out more details on how to use the system.

Setting Up Redirect

To enable redirect for third party custom maps to be able to run on their server, admins needs to install the "cooked server" files in their "\KFGame\CookedPCServer" directory on the dedicated server.

Now unless users already have the cooked client map files installed manually or previously downloaded in their clients cache, the server will need to be set up to redirect clients without the map to download it from a redirect server. To enable this, the admin must open the PCServer-KFEngine.ini file and add a new section near the bottom of the file. The section is called [IpDrv.HTTPDownload] and should look like this:

[IpDrv.HTTPDownload]
RedirectToURL=http://redirect.tripwireinteractive.com/kf2/

Where the RedirectToURL is a web location that is a repository of the client map files. The example above is the location of Tripwire's public redirect server which will host several near complete and complete custom maps. The client map file (.roe and not any supporting .upk packages) must be renamed as a .upk file. Thus RedirectTestMap.ROE should be renamed to redirecttestmap.upk on the redirect.

Get Custom Maps To Show In Web Admin

To get custom maps to show up in the change level section of web admin, admins will need to add a data store for the game in PCServer-KFGame.ini. A data store looks like the following example:

[KF-Default KFMapSummary] MapName=KF-Default ScreenshotPathName=UI_MapPreview_TEX.UI_MapPreview_Placeholder

Please note the use of lowercase in the map name and read the Known Issues to Avoid section for more information on the topic. This holds true for the mapcycle as well.

Known Issues to Avoid

  • Linux Redirect

As a redirect server can be a Linux machine, it is very important admins have the closing forward slash in the URL as well as spell all map names in lowercase. Failure to do so will result in a broken redirect and clients will only obtain a 1kb file of the proper name but not the actual files. Also take care when adding the map data store to the PCServer-KFGame.ini to use lowercase as well as the server will use those file names over any typed in as an admin.

  • Traveling from a custom map to a custom map

When a server goes from a custom map to a custom map, clients will download the second custom map, however there is a bug where the client will just see the "connecting" screen without any updated information about downloading the custom map until it is downloaded and begins to load.

A redirect server needs fast speeds and as much bandwidth as possible, but little else.