How to create a dedicated WoP server

General information about servers

First of all, this tutorial is targeted at dedicated servers, therefor the document's title. The difference between a local server, i.e. if you host a game from within your local computer and a dedicated server, i.e. you rent a server which is running 24/7, are huge. I won't go into the details, you only need to know that if you want to have a short match with your friends, it is better to do so with the ingame options WoP presents to you or to find an empty server.

Still here? Then welcome again, future server-admin, you have a great responsibility. But don't worry, if you follow this tutorial, there will be no problems. In case there are still problems after reading, ask me. I assume you know how to access your server, since I won't cover these basics in this tutorial.

Hardware

Now before we can actually start, a few final words about the hardware your server should have. The absolute minimum to run a dedicated server is a 500 MHz CPU, 256 MB RAM and about 700 MB free space for the default installation of WoP. Depending on whether you want to use bots, you should have a faster CPU. If you want to serve more clients, your server will need more bandwidth. In fact, you don't really need to worry about the bandwith, as most current servers are equipped with a 100 MBit connection, which is really enough to run a WoP server.

I ask you do obey these requirements. There are already more servers than players, so we do not need another server which is emtpy all the time. If you want your server to be well-liked, take some time to configure it properly and also watch out for how the players behave. Apply the latest patches for the game and maybe even add some good custom-maps.

Basic setup

Neccessary files

You will need a basic installation of WoP, i.e. the pk3 files (which are platform-independent), the server-executable for your OS and a configuration-file, which we will create throughout this tutorial. The pk3 files and the executable can be obtained from WoP's download page or from your OS' packet manager. Don't forget the patch and MapPack.

I advise you to create a startscript for the server. With a startscript, you can easily restart your server using cronjobs or whatever you like. In the rest of the tutorial I will asume that you are using a linux distribution and that you installed the game to /usr/local/games/WoP. Of course you can install it to any folder you like, but don't forget to adjust the path from the examples I give.

Command line switches

Let's get to the startscript. You can pass almost every command you would issue ingame to the server-executable. Take special care about that, since it will make your life much easier. I will now show you an example script, explainations follow lateron.

#!/bin/sh

cd /usr/local/games/WoP
./wopded.i386 +set dedicated 1 +set net_port 27961 +set com_hunkMegs 256 +exec server_settings.cfg

In this example I start a LAN-only server, listening on port 27960 (UDP), using 256 MB of RAM and will execute the commands in server_settings.cfg. As you can see, I set certain variables using +set and then load a configuration file using +exec. The general syntax to issue a command as a parameter to the server-executable is +command. Don't worry if you don't know where all these commands and variables come from, I'll explain them in the next section.

Set variables

Prior to explaining all the variables is setting them. There are different ways to do so. As you have seen, you can set variables on the command line. This is only used for variables which are read-only and can just be set at the server's startup. Now you might realize why we set the port and amount of RAM at startup. Both can not change while the server is running. If you want your server to listen on another port, you need to shut it down first, then restart it using the new port.

The basic snytax to set a variable is simply 'set variable value'. An example would be 'set g_gametype 0'. Be aware that you can accidently set non-existing variables if you mistype their name! If you want to set a variable to a value which consists of two or more parts, use "" for the value, i.e. 'set variable "bla1 bla2"'.

You can intentionally use this feature to provide further information to the players. If you use set to set a non-existing variable, it will be shown in your server's console, but not to the players. To set new variables which are visible to the players use sets. I ask you to do so and give some information about your server like in the following example.

sets ".Admin" "ENTE himself"
sets ".Location" "Germany"
sets ".Email" "nobody@web.net"
sets ".IRC" "padman@qnet"

I have chosen to prefix the variable names with ., so one can easily distinguish between real variables and those which are ment to be additional information. These variables won't be shown ingame, but can be seen in advanced server browsers like smiley's mighty wop-browser.

Now that you know how to set variables, let's see how we can use this command and others in a configuration file, which will hold all the settings for our server.

Configuration file

The configuration file, or short the config, is the file which holds all the settings for your server. It does nothing else but executing all the commands you write into it. That is, you could also set the gametype at your server's console every time, but the config will simplify this task for you.

You can and should add comments to your config, which explain settings and give further information for you. Comments start with //. Any line starting with // will be ignored by WoP. I will now show you a sample of a config, which would be saved as a separate textfile, which you then feed into your server in the server's startscript.

// Simple sample configuration file for a WoP server
set sv_hostname "My First WoP Server"
set sv_maxclients "10"
set pointlimit "200"
set timelimit "20"
set g_gametype "3"
set rconpassword "mysupersecretpass"
set g_log "wop_server.log"

map wop_cabin

As you can see, we are simply setting variables to certain values. Most of the variables have telling names. At the end of the file, we load a map to get things started.

In this simple example, a single map and a single gametype are good enough for testing purposes. On your server you should have rotating gametypes and maps, which I will explain in the next section.

Map and gametype rotation

A gametype or map rotation is nothing else than setting the gametype variable and loading a map. Both are commands you already know. WoP has a variable named nextmap, which will be executed when a round finished. You have heard right, you can also execute variables. That is, assign a command to a variable and then execute this command. Now this is exactly what we will do for our rotation. I will now again show you an example rotation, which you can copy and paste into your config.

// Map Rotation
set m1 "map wop_backyard; set next_map vstr m2"
set m2 "map wop_diner; set next_map vstr m3"
set m3 "map wop_cabin; set next_map vstr m4"
set m4 "map wop_kaistrashmap; set next_map vstr m5"
set m5 "map wop_padgarden; set next_map vstr m6"
set m6 "map wop_padkitchen; set next_map vstr m7"
set m7 "map wop_padlibrary; set next_map vstr m8"
set m8 "map wop_padship; set next_map vstr m9"
set m9 "map wop_padattic; set next_map vstr m10"
set m10 "map wop_huette; set next_map vstr m11"
set m11 "map wop_bath; set next_map vstr m12"
set m12 "map wop_mopans_jail; set next_map vstr m1"

// Gametype Rotation
set g1 "pointlimit 20; g_gametype 0; set next_gametype vstr g2" // FFA
set g2 "pointlimit 3; g_gametype 4; set next_gametype vstr g3" // LPS
set g3 "pointlimit 30; g_gametype 5; set next_gametype vstr g1" // TDM

// set initial values
set next_map "vstr m1"
set next_gametype "vstr g1"

// modifying nextmap
set nextmap "vstr execnextmap"
set execnextmap "vstr next_gametype; vstr next_map; set nextmap vstr execnextmap"

// load first map
vstr nextmap

I have added a few comments to explain what is going on. First of all, we set a whole bunch of new variables, i.e. m1, m2, m3 and so on. This is a list of maps we will use. You can name your variables like you want to, e.g. map_one, map_two, map_three etc. would work as well. Every variable is actually a command, which loads a map and sets next_map to the next map in our array. The gametype rotation works accordingly. Note that the last one will load the first one again, otherwise the rotation would stop at the last map or gametype.

As you can see, one can combine mutliple commands into one. Just merge them with ;.

Now for the interesting part. I have defined a new variable called execnextmap which will load the next gametype and map and then set nextmap again. As you can see, I have used a new command named vstr. This command will execute the contents of a variable as if it were a command you actually typed in. The final vstr is simply to load the first map of the array, similar to the 'map wop_cabin' in our config without rotation.

Feel free to add more maps to this template. You can also modify the timelimit depending on the gametype. Another crazy thing you can do is include the current gametype in your server's name. To do so, you will of course first need to know which variable you need to set.

Controlling the server

As I have mentioned in the introduction, I assume that you know how to access your server. Every time I mentioned the server's console, I meant the console of WoP, not your OS' shell. Of course you can open a ssh or VNC connection to your server every time you want to change a setting, but there are easier ways to do so. I will now discuss how to use the ingame options of WoP to do rcon, which is the abbreviation for remote control. If you don't want to start WoP every time, I recommend you to use a serverbrowser like XQF, which has inbuilt rcon support, so you don't even need to have WoP installed.

Rcon

Using rcon is very simple. In fact, you only need to prefix all your administration commands with rcon, i.e. 'rcon command'. But hey, before you can do so, you will first need to set a password for rcon on your server. Chose a strong one, in times of brute-force you're always at risk.

Actually this is a fetch-ahead of an upcoming chapter. In your config, add a line like the following one to set the rcon password on your server.

set rconpassword "tepRZE5xwU7k"

Don't lose this password and don't give it to anyone! What you need to do next is to set this password clientside. You can also use rcon with 'rcon password command', but since you use a strong password, it would be quite stressful to write your password all the time.

For now, start WoP on the computer you want to use for rcon. Ingame open the console via Shift+Esc. In the game's console type the following command, which will set your rcon password clientside and save it to your client's config.

seta rconPassword "tepRZE5xwU7k"

Now you can connect to your server and control it from ingame. In case your server is full and thus you can't connect to it, there is another possibility to use. Use this command, to administrate your server from within WoP without connecting to it.

set rconAddress 192.169.100.3:27060

Of course you will need to use your server's IP and port. Althoug setting variables is the most important command, you will also need other commands which will be explained in the next section.

Commands

You already know a few commands, these are set, exec, sets, map and vstr. I will now give you a list of common commands and their explainations. Please note that these are not all possible commands. To obtain a list of all available commands on your WoP server, use the command 'cmdlist', which will then output a list of commands without their functions. If you're working directly on your server, you can use the autocomplete function of the game console. Simply type the first few letters of a command or variable, press tab and the game will either show you some possibilities or autocomplete the name if there is only one possibility.

set variable value

Sets a variable to a certain value. Note that some variables are read-only or can only be set at startup. Some variables require you to load a new map.

sets variable value

Sets a variable, which will appear in a serverbrowser. Used for additional information about your server.

status

Shows a list with varios information about every player on the server, inlcuding bots.

kick user

Kicks the user with the given name. You don't need to care about colored names or capital letters. You can also use the player's number, shown by the status-command. Furthermore you can kick all users via "kick all", but I do not recommend this. Rather shut down the server as a whole. Furthermore, you can remove all bots via "kick allbots".

kicknum clientnum

Kicks the player with the given number. The number can be obtained via the status-command.

map mapname

Loads the map with the given name. Current gametype will be kept.

map_restart

Reloads the current map and keeps gametype.

addbot botname botskill team joindelay funname

Adds the bot with the character of the given name, skill, team, after a delay. Funname overrides the bot's default name.

exec configfile

Executes the given configfile. All commands and variables of this file will be used and overwrite current ones. You can use this command to separate a mod's variables from your server's settings. Simply create a single config, e.g. mymod.cfg which you load with exec mymod.cfg inside your main config.

addIP ipmask

Since the banUser and banClient command are disabled in WoP, you'll need to use IPs to ban players from your server. ipmask is the ip of the player you want to ban, which can be obtained via the status-command. You can also use wildcards, e.g. "addip 192.246.40.*".

removeIP ipmask

This command simply removes an ipmask you have added with addIP. You must use the same name you have entered, i.e. you can not remove "192.246.40.1" if you have added "192.246.40.*".

listIP

Prints the contents of g_banIPs, i.e. the banned IPs you have added.

forceteam playerid team

Forces the given player into a team. Either use playername or id. Team can be "red"/"r", "blue"/"b", "spectator"/"s", "free"/"f".

setgametype gamestring

This is an alternative to /set g_gametype. You can enter the string of the gametype, e.g. setgametype syc team.

vstr variable

Executes a variable's value as if it were a command you typed in. Used for gametype and map rotation.

Variables

And now for the variables we talked about. Since there are so many of them, this chapter is subdivided into sections. You should use set to set variables. Use the autocomplete function of the game console or the command cvarlist, which will print a list of all variables. Most of the variables you need are covered in the sample configs, which come with your WoP installation. They are located in /usr/local/games/WoP/wop.

If you use a mod, there might be even more variables you'll have to set. Those are usually documented in the mod's readme.

Gameplay

pointlimit

The pointlimit for the current game. You should change this within you map-rotation according to the gametype. If set to 0 there will be no limit and rounds will only be limited by timelimit. If you set point- and timelimit to 0, you should enable votes so players can change the map themselves.

timelimit

The timelimit for the current game. If set to 0 there will be no limit.

g_friendlyFire

Defines whether you can harm your teammates or not. Better leave this off, since WoP is more of a fun game and most players are not really able to do teamplay.

g_LPS_startlives

Number if lifes to start with in gametype LPS.

g_LPS_flags

This defines some of the gameplay-rules for LPS. Add up one or more of the following values, i.e. for Multipoint and no Arrows set to 2+4, i.e. 6.

g_gametype

The gametype being played. You probably like to change this using map-rotation.

g_allowvote

If set to 1, players can issue votes. Be aware that this sometimes involves voting for non-existing gametypes or maps, kicking unaware PadPlayers, vote-spam in general and could even break your carefully planned mapcycling.

g_doWarmup, g_warmupReady, g_warmup

Whether to do warmup, how many percent of the players need to be ready for the game to start, how long the warmup should last.

g_knockback

Defines how strong players should be knocked back if being damaged. The default-value is 1000.

g_teamAutoJoin, g_teamForceBalance

Whether players will automatically join a team once connected. Note that players will still stay in their team on new games. If forceBalance is set, one can't join a team if it has more players than the other one. You should really consider to set these two variables in order to have fair and balanced teamplay on your server.

g_weaponRespawn, g_weaponTeamRespawn

Time in seconds until weapons will be respawned after being picked up. Use teamRespawn to define a seperate time for team-based games which should be higher than the ffa-one.

g_speed

How fast players will walk. With the v1.2 Patch, this was reduced to 280, the previous value was 320. Don't set this to high as it makes the game unplayable.

g_gravity

How strong you'll be sucked to the ground. The higher the value, the stronger the gravity.

g_quadfactor

How much stronger you'll be using quad aka PadPower. A value greater than one makes you hand out more damage.

g_forceSpawn

Can either be 0/1. If set, players will be respawned after a certain time. This is usefull to reduce those who don't respawn in order to camp for powerups.

g_KillerduckHealth

The health a single killerduck has. If you set this to -1, killerducks can't be killed.

disable_

You can actually disable items without using a mod! To do so, set a cvar which is called disable_classname, e.g.

set disable_weapon_imperius "1"
set disable_ammo_imperius "1"

dmflags

Clients

sv_maxclients

Maximum number of clients on the server. This includes bots.

g_maxGameClients

The number of clients that are allowed to play. If set to 0 all clients can play, otherwise some have to spectate.

sv_privateClients

Number of private clients. Usually used to reserve some space for admins or VIPs. They need to have the correct password.

g_inactivity

After this amount of seconds an inactive client will be kicked. Inactive means, no movement, chatting or looking-around at all. You shouldn't set this too low, otherwise you might annoy players that are only away from keyboard for a short time. In general it is a good idea to set this variable, as inactive players only suck bandwidth or will be fragged by unfair players. Inactive players will be warned 10s before they are kicked.

sv_zombietime

If the server doesn't recieve a command from a client within this time in minutes, the client will be dropped. This might happen if the connection hangs, i.e. lags for a longer period.

Server

g_log, g_logsync

The filname of the server's log. g_logsync specifies how to write the log; 0 is only when the internal buffer is full, 1 is everytime a new message for the log arrives.

sv_allowdownload, sv_dlURL

You can allow clients to download any custom maps and mods running on your server. Files can either be server by your server, or from an external server via ftp/http. In the latter case you'll need to set sv_dlURL as described lateron. It is usually a good idea to use an external server, since otherwise the downloads would get subtracted from your gaming server's bandwith which might cause lags.

sv_masterX

A list of the masterservers. Ususally you should need to set any of them.

g_filterban

If set to 0, only allow players from the IP-list you have created with addIP to play. If set to 1, permit players from the list from entering the server.

sv_hostname

The Server's name that will be displayed in your serverbrowser. May contain colorcodes aswell.

g_motd

"Message of the day" which will only be displayed in either your serverbrowser or in-game if you display serverinfos (default toggle with K). Doesn't have a real use.

rconpassword, sv_privatePassword, g_password

rconpassword is for remote-control of the server. If none is set, you can only use the server's commandline to issue commands. privatePassword for private clients. Their places are reserved on the server. Private clients need to type password blabla in console to join. g_Password for any client that wants to join. If it is set, clients need to write password blabla in console.

sv_pure

Always set this to 1. Otherwise player could use modified pk3s, i.e. cheat.

dedicated

You need to set this variable on server startup. It controls whether your server sends heartbeats to the masterservers, i.e. if it will be listed ingame. If set to 2, the server will send heartbeats. If set to 1, it won't, although people can still join if they know IP and port. Don't forget that in order for the server to be listed you must open the port in every firewall between your server and the internet.

net_port

The UDP port the server will listen on. This is the port you need to open in your firewall. If you want to host more than one server on one IP, each instance has to use a different port.

com_hunkmegs

This is the maximum amount of RAM the server will use. The more it uses, the faster it usally loads maps as they will be cached.

fs_game

Specifies the folder the engine will search for files. This is used for mods, as discussed lateron. The WoP engine will look for files inside /usr/local/games/WoP/wop, ~/.WoPadman/wop and in, for example, /usr/local/games/WoP/mymod and ~/.WoPadman/mymod.

Bots

bot_enable, bot_minplayers, bot_nochat, g_spSkill

Wheter bots are enabled. If so, they fill up to bot_minplayers slots but leave, if human players join. bot_nochat disables the annoying slogans the bots like to say. If you use bot_minplayers, this number of bots will be added using g_spSkill, which can be 1-5.

Netsettings

sv_minRate, sv_maxRate

Maximum Datarate for a single client to the server. If your server doesn't have a fast and reliable connection you shouldn't set this above 25000. If a client has specified a lower datarate then sv_minRate, he will be rejecten while connecting.

sv_minPing, sv_maxPing

The server checks for the players' ping while connecting, if it is below sv_minPing or above sv_maxPing, the player will be rejected.

sv_fps

Yes, even a server has a fps-setting! If you set this higher than default, the server will need more bandwith but clients might encounter a more fluent gameplay. It might also cause some bugs in gameplay. If you find any bugs, use WoP's Bugtracker.

Mods

Modifications, or in short Mods, modify the gameplay. Sometimes they add new gametypes, sometimes they replace playermodels and weapons.

There are two kinds of mods. Serverside ones and those that have some clientside code aswell. The first type is easier to setup, since clients do not need to download the mod. The second sort needs to exist on the player's computer, either since he downloaded it separately or from your server.

In both cases you should create a separate folder for your mod which will include its files and server config. To do so, simply create a folder inside either /usr/local/games/WoP or ~/.WoPadman. If you named your folder mymod, it will appear as mymod ingame. To tell the server that you want to use a mod, you'll need to specify +set fs_game mymod in your startscript.

Serverside Mods

A serverside mod usually consists of a file called qagame.qvm. QVM stands for Quake Virtual Machine, it is thus platform independant. Inside your mod's folder, create a subfolder called vm and copy the qagame.qvm inside vm. Read the mod's documentation and don't forget to set the mod's variables in your server config.

Clientside Mods

Clientside mods may include a serverside mod. Any new game content can be seen as a mod. If you have a pure server, i.e. sv_pure 1, every client will need to have exactly the same files as the server uses. Therefor you need to distribute the download in some way. The most comfortable way for players is to enable autodownload on your server.

To do so copy the mod's pk3s inside ~/.WoPadman/mymod or /usr/local/games/WoP/mymod and then upload them somewhere. Set sv_allowdownload 1 and point sv_dlURL to your upload folder. The URL can either be http or ftp. You need to follow a certain sheme. Let's assume you set sv_dlURL to http://mysite.com/downloads/maps/ then you'll need to put your pk3s inside mysite.com/downloads/maps/mymod. A client will automatically append your mod's name (to be more correct; fs_game) to sv_dlURL. The files must be accessible with anonymous ftp or as a direct http download.

Again, don't forget to include the mod's variables in your config. Of course you'll also have to look for updates of the mod and replace the files on your server and upload accordingly.