* Play Levels in random order *

Filename : randmap.zip
Version  : 1.0
Date     : 07.01.1997
Author   : Stefan Schwoon
Email    : ssch0098@rz.uni-hildesheim.de
Credits  : id

Type of Mod
-----------
QuakeC   : yes
Sound    : no
MDL      : no

Format of QuakeC
----------------
Unified diff


Description of the Modification
-------------------------------
This patch allows you to specify a set of levels to be played in ran-
dom order. This is especially useful for deathmatch sessions: list your
favourite deathmatch levels, and Quake will play them in random order
without need of further intervention. When all of them have been used,
the process will start over. Best thing about this is that it also works
with add-on levels; when timelimit or fraglimit is reached, those levels
will no longer default to the "start" map. Finally, you can set up all
your favourite deathmatch maps and play them through, without hassle!
Since maps are selected in random order, there is a bit of a surprise
each time a new level is started.

In order for this patch to work, set the server's "samelevel" console
variable to something negative, e.g. "samelevel -1". Values of 0 and 1
for this variable will work as before. Each time the timelimit or the
fraglimit have expired, the patch will choose one of those maps that
have not yet been played to be the next level. Important: Touching
exits will continue to work normally, so it might be advisable to set
"noexit" to 1. However, most deathmatch maps do not have exits.


How to Install the Modification
-------------------------------
Create subdirectories named randmap and randmap\progs in your Quake
directory and copy id's QuakeC source files into randmap\progs, along
with randmap.dif. Then, run "patch < randmap.dif". If you don't have
the "patch" utility, see howpatch.txt on ftp.cdrom.com for where to
get it.

Next, edit maplist.qc to specify which levels to play.
For each map, insert one "AddLevel" command into the CreateSet1 procedure.
For up to 24 maps, this will do just fine.

If you have more than 24 maps, you will have to group them into several
sets. Change the NUMSETS constant to reflect this, create new procedures
called CreateSet2 (3,4,...), and change CreateSet accordingly. If this
sounds complicated, take a look into maplist.qc. It should be self-ex-
planatory. Sorry for this hassle; the reasons are explained below.

Now, run qcc over the source and start quake with "quake -game randmap"
(plus any additional parameters needed for establishing a server).
The patch need not be installed on the clients.


Technical Details
-----------------
The patch uses some of the global parm* variables. Look out for this if
you want to incorporate it this patch with others.

You can create 24 sets of 24 maps each, for a total of 576 levels (this
should be enough for most purposes ;). If there is more than one set
then all levels in one set will be completed before Quake moves on to
the next set of levels.  Why the "24" barrier?  I use a float to flag
those levels that have already been played, and apparently QuakeC's
float arithmetics choke on numbers greater than 2^24.

Comments and suggestions to the patch are welcome (see email address above).
If you run a server with this patch I'd appreciate if you let me know.


Future ideas
------------
I might add a way to specify minimum and maximum number of clients for
levels (so levels can be chosen according to the server's current popu-
lation). I would also like to specify maps without editing and recom-
piling the QuakeC source (also eliminating the need to take the server
down to add new maps) but I haven't come up with a good idea to do this.
However, changes will only be made according to requirement, so tell me
if you think additional features might be useful.


Author Information
------------------
I'm a student at Hildesheim University whose computer science department
is sadly going to be closed down by 1998.
I also wrote the Backpack patch (see backpack.zip), a patch that allows you
to drop backpacks in order to share resources with teammates in teamplay.


Copyright and Distribution Permissions
--------------------------------------
Authors MAY use these modifications as a basis for other publically 
available work. Please give appropriate credit when doing so.

You may distribute this Quake modification in any electronic format as 
long as this description file remains intact and unmodified and is 
retained along with all of the files in the archive.


Availability
------------
ftp.cdrom.com://pub/idgames2/quakec/server and mirrors