Q3F 2.0 Advanced Server Configuration & Scripting (2002/04/06)

a.) Basics

Q3F 2.0 uses a new kind of configs which offers server administrators much more abilities than the previous Q3F Beta 1(h). Let me tell you first some basics about the config structure:

The configs are build modular. The server uses an initial server config (like q3f_server.cfg from Beta 1h) and the schedule config called server.cfg in the sub-directory config of your Q3F directory. Don't worry, maybe it looks a little bit difficult at the moment but shouldn't be the case when you are setting up a normal server. You can even skip the rest of the explainations then and just use the example config files with minor adjustments (check directory examples/server_configs/simple/ in your q3f directory and read readme.txt).

Directory structure (with essential config files):
quake3
|- baseq3
'- q3f
   |- config
   |  |- config.cfg <=
   |  '- mapconfigs
   |     |- default
   |     |  |- q3f_forts.cfg <=
   |     |  '- ...
   |     |- another_config
   |     '- ...
   '- q3f_server.cfg <=

The initial server config q3f_server.cfg is a usual config you know from a common q3 server. The second important config is server.cfg in the config directory. In this file the server will look for schedules entries to be able to use different time dependend configurations.

A simple server.cfg looks like this:


schedule "All"          default;

setting default {
        g_motd "Server script test";
        map_config              "config/mapconfigs/default";
        map_filter              player,history;
        map_historyunit         5;
        map_historylimit        8;
        map_include             all_maps;
        map_select              vote,
}

maplist all_maps {
        "q3f_*+*";
}


All 3 parts (schedule, setting, maplist) are required.

b.) schedules, maplists and settings

schedule:
This keyword enables you writing time dependend server configs.
Syntax:
schedule time setting;

time: period in which this setting is valid (24 hour format)
setting: a setting

Examples:
schedule "Sat-Sun 11:59" Friendly_Fire;
Use setting 'Friendly_Fire' between Saturday 11:59 and Sunday 11:59

schedule "Sun 12:00-Sun 23:59" Custom_Maps;
Use setting 'Custom_Maps' between Sunday 12:00 and Sunday 23:59

schedule "All" Standard;
Use setting 'Standard' for the remaining time. Would be here from Monday 0:00 until Saturday 11:58


maplist:

The maplist command is used to create maplists. By being able to use wildcards it's a very flexible and comfortable method to create maplists.
Syntax:

maplist name {
	map1+gameindex;
	map2+gameindex;
	...
}
Example:
maplist foobar {
	"q3f_muon+2";	// add q3f_muon, gameindex 2 only (+2)
	"q3f_forts+*";	// add q3f_forts, all gameindices (+*)
}
setting:

With 'setting' you can build different settings for your server. It accepts common q3/q3f cvars or Q3F's special map-cvars (see below for explaination). The setting 'default' is mandatory and must be in every server.cfg. If you plan to use schedules for the server you need several 'setting's.
Syntax:
setting name {
	cvar1;
	cvar2;
	...
}
Available map cvars:

map_config "Path to map configuration files" Set the path of the map configuration files.

map_include Maplist
This is the initial maplist which the server will use. Required! Only set one map_include in a setting.

map_exclude Maplist
This(These) maplist(s) will be removed from the maplist the server received by map_include. You can use several map_exclude's to create a final server maplist.

map_select vote/random
The method how the next map will be chosen. When using 'vote' the players may vote the map they want to play. Second method is 'random' - the server will choose a map from the map pool then.

map_historyunit
This value will be added to a map's history when it has been selected to play.

map_historylimit
The maximum value a map's history may have before it's filtered out of the server's maplist.

map_filter player, history
With Q3F 2.0 the server is able to adjust its maplist by reacting on the amount of players and the recently played map. By setting 'player' the server filters maps out of its list which don't meet the defined min- & maxplayers setting in the mapinfo file. History checks which maps have been played recently and will remove them from the maplist for a certain time. If the server should run out of maps due a small maplist and too many filtered out maps this setting will be overridden.

Ok, ok... you want an examples? Here they are... ;-)


Examples

a) map_history*
map_historyunit 5;
map_historylimit 8;
When a map has been selected to play (by server or players) the server will add the value of map_historyunit to the map. A map's 'history value' is reduced by 1 when another map has been playeed. The server will filter the map when its 'history value' reached map_historylimit.
So when q3f_forts would have been played twice in a row the map would have the history value of 2 x 5 = 10 and it wouldn't be available for the next 2 rounds.
No Map				history value of forts	voteable after round
1) q3f_forts			5 			YES
2) q3f_forts 			10			NO
3) q3f_anothermap 		9			NO
4) q3f_anothermap		8			YES

b) settings

setting example {
	g_motd "Example - Have fun with Q3F 2.0." // sets setting's motd
	map_config "config/mapconfigs/new"; // mapconfigs are in here, called 
					    // .cfg (q3f_forts.cfg)
	g_friendlyfire full; 	// setting friendlyfire/teamdamage to full 
	map_filter player, history; // playerlimits & map history are checked
	map_historyunit 5;
	map_historylimit 8;
	map_include Q3F2_Maps;	// use maplist Q3F2_Maps as base
	map_exclude Q3F1_Maps;	// remove the maps of maplist Q3F1_Maps from 
				// maplist Q3F2_Maps
	map_exclude Dont_like;	// remove the maps of maplist Dont_like from 
				// (Q3F2_Maps - Q3F1_Maps)
				// so your final server maplist would be: 					
				// Q3F2_Maps - Q3F1_Maps - Dont_like
	map_select random;	// server chooses a random map
}

configtest
With the command 'configtest' you can test if your written configs are valid. Just type configtest in the server console and if everything is fine the server will reply "Server configuration OK."

c.) additional comments

  • Please check the example directory in your q3f folder. There you will find serveral server config examples.
  • If you're running a dual cpu machine and think r_smp 1 would give you a speed advantage - it won't. ;-) Q3 uses smp only for its graphic part.