Server setup

Quick Q4max server setup (for special game hosting).

Config.

I recommend to use all stuff from default Q4max config called “example-server.cfg”.

You should specify referee and rcon passwords, name of the server, motd and additional information like location, admin’s nickname, website, etc.

Network settings.

seta net_serverSnapshotDelay “10” gives ultra-low latency between server and player, but requires a fast and stable connection, so I recommend to use vaule “25”. With the snapshot delay “10” player can’t set his net_clientPrediction less than zero (or, maybe -2), cause server just don’t have additional milliseconds to predict players positions. I don’t know exactly what snapshot delay is better – 10 or, for example, default 30. You can try different values to find better one.

seta net_serverMaxClientRate should be “25600”, it’s a maximum available client rate in Quake 4.

Downloads.

Specify those vars to enable file downloads on your server:

set net_serverDownload 2
set net_serverDlBaseURL “http://urltoyourfiles.com”

Download database can be accessible with ftp or http, so specify your protocol in url. Download database must have the same directories structure as your server’s game folder – all maps should be in q4base folder. If you want to use WwW Database, please leave your request here.

Modes.

Q4max has a custom game modes feature. We can’t live without custom modes – they needed to setup custom-fps server (fps = tickrate). Modes can be specified in q4max/modes folder using *.cfg configs. For quick setup I suggest to set 5 modes: Duel, TDM, CTF, FFA, CA. Every mode setting is a setting from in-game vote (or admin) menu – like timelimit, fraglimit, etc.

Duel:

tickrate 240
GameType 7

TDM:

tickrate 240
GameType 2

CTF:

tickrate 240
GameType 3

FFA:

tickrate 240
GameType 0

To create and set up the Clan Arena custom mode, I had to write out each variable, so now it’s the full mode config:

tickrate 240
armor 150
armordecay 1
armorsystem 0
autobalance 0
autothaw 90
buymode 0
caplimit 0
controltime 120
countdown 10
droppowerups 1
dropweapons 0
enemyspec 1
falldamage 0
footsteps 1
fragLimit 5
GameType 5
health 100
modelsounds 1
mutespecs 0
overTime 0
poweruprespawn -1
selfdamage 0
shuffleteams 0
startfreeze 0
startrespawn 0
startammomg 100
startammosg 20
startammohb 50
startammogl 10
startammong 50
startammorl 50
startammorg 50
startammolg 120
startammodmg 0
startammonpg 10
startweapons 1535
teamdamage 0
thawtime 3
thawwherekilled 0
timeLimit 0
tourneylimit 3
warmup 1
weaponrespawn -1

You should separate the modes in list by spacebar exactly like this (every mode name is your mode *.cfg file name, so it can be “duel240.cfg” for example):

seta si_mode "DUEL240"
seta si_modes "FFA240 CTF240 TDM240 DUEL240 CA240"

Maps.

You can download the maps from Downloads page and put *.pk4 files in q4base folder.

Advanced server setup (for VPS or other dedicated systems).

All files can be downloaded from Downloads tab.

You can setup a server with Windows, Linux or macOS versions of Quake 4. But I recommend to use Linux or macOS, here is a guide for Linux (all commands can be entered through ssh, so log in before!)

First you need is install 32-bit apps support (for Ubuntu 20.04 LTS):

sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libc6:i386

Also you need zlib1g:

sudo apt-get install zlib1g:i386

Install Quake 4:

  • Download Quake 4 1.4.2 native *.run installer
  • Copy it to your server in any folder (your user home folder, for example) and install using this command (from folder you placed the *.run file):
sudo ./quake4_linux_1.4.2.x86.run

If doesn’t work, try to make it executable:

sudo chmod +x quake4_linux_1.4.2.x86.run

It will be installed in /usr/local/games/quake4! And yes, you’ll need to scroll all of long license agreement text in terminal:D

You should also give /usr/local/games write permissions so you don’t have to use “sudo” every time, and to allow Quake 4 to write “quake4key” file:

sudo chmod -R 777 /usr/local/games

So, next

  • Install unzip if you don’t have it yet:
sudo apt-get unzip
  • Download and place pak001-012.zip into /usr/local/games/quake4/q4base and unzip it to same folder:
unzip pak001-012.zip
  • Download and place additional language paks to q4base folder if you want, also you need to delete *.pk4.off inactive lang packs!
  • Place your example-server.cfg from q4max/cfg to just q4max and rename it to server.cfg
  • Configure (read about this above) and start your server:

quake4-dedicated – is a dedicated server startup executable file. It should be launched with command line:

+set net_serverDedicated 1 +set net_port 28004 +set fs_savepath /usr/local/games/quake4 +set fs_basepath /usr/local/games/quake4/ +set fs_game q4max +exec server.cfg

You can rename server.cfg, change port and mod, also any config variables can be specified in the command line with +set prefix (command line variables will override cvars set in server config). Command line should be written in terminal like that:

./quake4-dedicated +set net_serverDedicated 1 +set net_port 28004 +set fs_savepath /usr/local/games/quake4 +set fs_basepath /usr/local/games/quake4/ +set fs_game q4max +exec server.cfg

A few tricks:

On Unix-based systems we have pretty useful nano text editor. You can use it to edit your *.cfg’s directly through ssh without copying any files from-host-to-host. Just write this from your q4max folder (navigate to it before):

nano server.cfg

Then, after you finished, press control+x, “y” and press enter to save changes.

You can control the server over ssh. To keep process alive after closing the session, start it under the “screen”:

screen
./quake4-dedicated +set net_serverDedicated 1 +set net_port 28004 +set fs_savepath /usr/local/games/quake4 +set fs_basepath /usr/local/games/quake4/ +set fs_game q4max +exec server.cfg

And press ctrl+a+d to exit screen. You can always back to server log monitoring with:

screen -r *your id*

*Your id* will appear if you type “screen -r”. This is how it looks on my server:

Congratulations! If you see this, your server is running <3 (don’t worry about “connecting with *wtf ping*”, it’s normal, ping should be so huge at the client connection moment)

sorry for red rectangles. just someone’s IPs.