Setup Painkiller Black Edition Linux Multiplayer Dedicated Server
Warning
This setup was tested on Ubuntu 22.04 and Debian 12. Some 32-bit packages were removed from Ubuntu 24.04 repositories so you'll need to download and install them manually but it's not within the scope of this guide.
A short remark for a beginner. A server is a computer (host) that provides information to other computers called clients. So when you create a game, your PC is a "server" and those who join it are the "clients".
This guide implies that you are familiar with Linux OS.
The People Can Fly videogame company provided an official Linux server for Painkiller. It's more stable than the Windows server and it's much cheaper to host, that's why all the dedicated servers are mostly on Linux. However, this binary is 32-bit and has its own drawbacks which we'll discuss below.
The official packages for the Linux server are Painkiller Linux Server 1.62 and its patch Painkiller Linux Server 1.64 Update provided as separate TAR archives. The pkserver binary was integrated with the outdated GameSpy server discovery network.
It's not convenient to work with those official packages so I made a combined pack based on the official ones.
Prerequisites
Your Linux OS should support 32-bit applications.
-
Log in to your server.
-
Prepare Ubuntu 22.04 server to accept 32-bit architecture since
pkserver
was compiled for 32-bit systems. You may need to run this command as a root withsudo
: -
Install additional 32-bit packages. You may need to run the commands as a root with
sudo
:
Installation
-
Download the Painkiller Linux server package here. This pack already has a modified
pkserver
binary by XDavidXtreme with the following features:- gamespy.com was replaced with openspy.net.
- Fixed the "%s" symbols vulnerability that could crash the server.
- "+map" (sets the initial map) and "+port" options now correcly override config.ini parameters.
- Added "-cfg" option like in the "Painkiller.exe" Windows binary to indicate a custom config.ini file.
- Added "-lscripts" option like in the "Painkiller.exe" Windows binary to indicate a custom LScripts.pak.
- Cfg.ServerMaps now update properly during the server initiation (Cfg:Load and Tweak:Load were removed from the binary). You no longer need to indicate a maplist in both Cfg.ServerMaps{Gamemode} (for example, Cfg.ServerMapsCTF) and Cfg.ServerMaps. Only indicating maplist in Cfg.ServerMaps{Gamemode} will be enough.
Note
The binary accepts the "+" plus and the "-" minus options. The order of options is important.
The "+" plus options can be in any order but before the "-" minus options.
The "-" minus options depend on the order which Linux server reads them and they have to be in specific order.
"-lscripts" is the first one read, so it is always at the end.
Example:
Note
If you want to use clean official packages (not recommended), they can be downloaded here. In this case, you'll need an extra step of replacing all the GameSpy instances in a binary or modifying an
/etc/hosts
file which is described in the GameSpy to OpenSpy guide. -
Connect to your server and upload the archive with an FTP program like Total Commander or
scp
to a Linux directory, for example,/opt
. -
Go to your
/opt
directory: -
Unpack the files:
-
You'll get the
pkserver
directory. Remove the archive: -
Examine the
pkserver
directory. Pay attention that Linux is case-sensitive, unlike Windows.bin
is linked toBin
anddata
is linked toData
. It was done this way so you can easily navigate and feel it like in Windows:[login@shell opt]$ cd pkserver [login@shell pkserver]$ ls -al total 20 drwxr-xr-x 5 painkiller painkiller 4096 Jun 12 06:38 . drwxrwxr-x 4 painkiller painkiller 4096 Jun 12 06:50 .. lrwxrwxrwx 1 painkiller painkiller 3 Feb 4 2005 bin -> Bin drwxr-xr-x 2 painkiller painkiller 4096 Jun 11 14:05 Bin lrwxrwxrwx 1 painkiller painkiller 4 Mar 25 2005 data -> Data drwxr-xr-x 7 painkiller painkiller 4096 Jun 11 14:05 Data drwxr-xr-x 2 100999 100999 4096 Jun 12 06:38 pkserver
-
Enter the
Bin
directory withcd
: -
Run
ls
to see two files:config.ini
– the server settings,pkserver
– executable file. -
Find out which network interface in your server has access to the Internet:
$ ip --brief address show lo UNKNOWN 127.0.0.1/8 ::1/128 enp0s3 UP 192.168.0.106/24 fe80::91ee:4f1b:1582:d667/64
Note
If your server is behind NAT, like in this example, forward the necessary port (the default port in Painkiller is
3455
) like it's described in this guide. -
Make sure you don't have any firewall rules preventing a client from connecting to your server and so that the game port is not occupied:
Also, make sure that your provider is not blocking certain IP ranges.
-
Start
pkserver
with the+interface
parameter (the corresponding parameter in theconfig.ini
file isCfg.NetworkInterface
). Enter the IP address of the network interface that has access to the Internet:Note
It is possible to run
pkserver
without the+interface
parameter; however, in this case, you'll need to replace all your localhosts in your/etc/hosts
file with your interface192.168.0.106
. This is not recommended. Example: -
Connect to your server either via the local IP (if there is a NAT configuration) or the public IP. The port can be omitted if it is default 3455:
Note
The connect port:ip console command does not accept port in the original Painkiller v1.64. It's a bug and was fixed in PK Extra Plus. If you use the original Painkiller and you run on a custom port, join your server via
Multiplayer
->Join Game
->Enter IP
. -
To stop the server enter the command
/exit
: -
To change the port your server runs on, go to
config.ini
and modify theCfg.ServerPort
line.
Install PK++ (Painkiller competition mod)
-
Download the latest PK++.
-
You can run
pkserver
binary using the-lscripts
parameter or you can replaceLScripts.pak
with the renamedPKPlus.pak
from PK Extra Plus.Since `pkserver` binary does not accept the `-lscripts` parameter, you have to replace `LScripts.pak` with the renamed `PKPlus.pak` from PK++. Hacking `pkserver` binary is also possible but it's out of the scope of this guide. Download the PK++ `PKPlus.pak`, rename it and replace the original `LScripts.pak` with it in the `pkserver/Data` directory. It can be done with one command in Linux: `mv PKPlus.pak /opt/pkserver/Data/LScripts.pak`
-
Start the server and you'll see bots:
Configure RCON
RCON (remote console) is a remote administration tool and a protocol to manage a game server.
Note
It is a feature of PK++. This command does not work with the original Painkiller. It'll only work if both the server and the client have the PK++ mod installed.
With this tool, you can run all server commands as admin, with no voting required. All the commands can be either issued in the server console or directly in the client console.
In the configuration file config.ini
that's on the server and in config.ini
that's on your PC, configure the same password in Cfg.RconPass
to have admin privileges. Type in /rcon
in the console to use it, examples:
Notes
You can also set the rcon
client password directly in the game console with:
It'll add a password to Cfg.RconPass
in your local config.ini
. The password should match the one set on the server.
change a map
restart a map
kick a player