
Map Rotation:

Matador has a map rotation feature built in that allows the server to choose maps based on the number of players currently connected. In addition, the list of maps can be configured so that some maps come up more or less often than others. There are two components to this, the server variables defined in server.cfg (or another config file) and the hard-coded map lists in the Quake-C file map.qc.

These features are not enabled unless you set the 'mapsize' variable in the server console to something. If it's left blank, the server will rotate through maps normally. If it's set to something other than a map size, the server will just set it to 'small' and go from there.

Server variables:

The following server variables control the map rotation features:

mapsize 	[small/medium/large/ex_large]	current map size
small		[#]				current 'small' map (set by server)
medium		[#]				current 'medium' map (set by server)
large		[#]				current 'large' map (set by server)
extra_large	[#]				current 'extra-large' map
small_start	[#]				starting point in map list for 'small' maps
small_end	[#]				ending point in map list for 'small' maps
medium_start	[#]				starting point for 'medium' maps
medium_end	[#]				ending point for 'medium' maps
large_start	[#]				starting point for 'large' maps
large_end	[#]				ending point for 'large' maps
ex_large_start	[#]				starting point for 'extra-large' maps
ex_large_end	[#]				ending point for 'extra-large' maps
custom		[0/1]				whether or not current map is 'custom' (set by server)

The 'start' and 'end' variables refer to numbers which are set in the map.qc file in the function GetMapName. The server selects a mapsize based on the number of players, then checks the variable that corresponds to that mapsize. That variable contains a number, which is the next map to run in the rotation. It selects the map for that number, increments the number, and starts the next map. For example, if your rotation list was:

small maps:
1	dm2
2	e1m2
3 	dm4 

medium maps:
4	dm3
5	e1m5
6	dm6

large maps:
7	e4m3
8	e4m7

extra-large maps:
9	death32c
10 	base32b

You would change the code in map.qc appropriately, and set your server variables to:

small_start 1
small_end 3
medium_start 4
medium_end 6
large_start 7
large_end 8
ex_large_start 9
ex_large_end 10
small 1
medium 4
large 7
ex_large 9

NOTE: although the small, medium, large, and ex_large variables are set by the server automatically, they MUST contain initial starting values! Otherwise the server won't have a place to 'start' in that portion of the rotation.

Map Sizes:

The map sizes are currently hard-coded into the SelectMap function, but this will probably be changed to a server variable sometime in the future. Currently the values are:

Small map:		1-5 players
Medium map:		6-10 players
Large map:		11-16 players
Extra-large map:	17+ players

Custom Maps:

You can designate certain maps as 'custom' maps in the CheckMapName function. This is useful if you have downloadable maps on your server, but don't want two custom maps in a row being played (and thus people spending a lot of time downloading). If you don't want any maps designated as 'custom', just have this function return 0.
