Title    : Rado's DDM (detailed DeathMatch) fragtable
Filename : ddm114.zip
Version  : 1.14
Date     : Jan 8, 1998
Author   : Rado Smiljanic
Email    : rado@math.uni-hamburg.de
Credits  : Jens "Conan" Wuepper for helping debugging and making me THINK !
	MAD Marcus Dietz for design-hints
	Carten Witte for giving feedback, see
		http://www.users.comcity.de/~carsten/equake.htm
	all my pals, who playtested it with me.
======

Type of mod	: Quake C v1.06 (or should it be called Quake B+ ?)
		  QuakeWorld C v2.10
(qw)progs.dat	: yes
.qc		: yes

nothing else

In short
--------
This QuakeC-patch gives you DM-stats-output on everyone's console after every
level, which allows you to see who fragged who how often (like in Descent 2,
Doom 2, Duke Nukem 3D ...). In TEAMPLAY it summarizes the scores for TEAMs.

How to install the modification
-------------------------------
Put the PROGS.DAT file in a subdir of your Quake-dir, and start Quake with:
quake -game subdir

This is only necessary for the server, the clients do not need it.

You may find DDM v1.14 at:
 
ftp://ftp.cdrom.com/pub/quake/quakec/stats/ddm114.zip ,
 
or any other dir below quakec, where it may have moved.

***************************
* Copyright / Permissions *
***************************

Rado's DDM is copyright 1997 by Rado Smiljanic.

You may use and distribute this patch in any way as long as there is no
profit made by doing so in any way !
Distribution must include this explanatory text-file !
If you want to offer this patch for use or distribution in any commercial
way, you must ask the author (Rado, see above) for permission prior to
doing so !
Only exception to the required free distribution is, so far,
Walnut Creek CDROM (but I'd be happy if they informed me nonetheless).

Any work based on the source of Rado's DDM, or parts of it, has to comply
with the restrictions for use and distribution that are valid for this patch
(no profit, Rado's permission).
Additionally, every such work has to be approved by the author (Rado) before
publishing it (copyright and stuff ...).
Every such work must include this whole section about Copyright/Permissions
and a link to where the base-source is avaiable and how the author of
Rado's DDM (Rado Smiljanic) can be reached (email).
	Let me (Rado) know when you begin playing around with DDM-source.

For combinations of DDM with other patches the most restrictive limitations
of both patches are valid for the combination !

Disclaimer
----------
I don't know how it should harm anything on your PC, be it soft- or
hardware, but anyway: I do not take any responsibilities for any damage to
your system due to the usage of this patch.

Details
-------
If in Quake you miss the summary for each level, as it is offered by games
such as Doom 2, Descent 2 or Duke Nukem 3D, like I missed it, then give DDM
a try.
The patch does not alter the behaviour of the game as such. It just adds the
DM-stats as console-output after every level (this requires to end the level,
either by going through the exit, or using time/fraglimit) in the well known
style of other games.
	It also automatically toggles console when level is exited, so you
can see what it is all about (included this for newbies with the console.
Those, who've already been on console and kicked out of it, know how to get
back there ;). You can scroll on the console with page-up/-down keys.
	This patch required changes to client.qc, defs.qc and progs.src .
The main functions have been placed into a new file rado-ddm.qc . DDM is
implemented by adding a pseudo-array for individual kills to the
entity-structure.
	Since low resolutions do not give much room to display everything,
especially the sometimes really long playernames, I decided to print first
an ID to player assignment list for the DDM-stats-table. The list shows
number in table, fullname of player, standard-total kills and powerup-only
kills.  (powerups in this context are Quad and 666-Mega-armor)
Then the table is printed with the columns representing the victims, and the
rows naming the fraggers. In the last column you get your total frags, in the
last row you get your total deaths (to calculate the ratio). Suicides are
subtracted from the total frags, but not from total deaths (so they count
twice, in a way) !
	If you have TEAMPLAY, then an additional line for team-stats is
printed. The number of teams is not limited, you may have as many teams as
Quake/QC allows. PLEASE, play TEAMPLAY, because half of the brainpower went
into the code for TEAMS ! ;)
	Even though each column for a player has only 4 characters, it still
has its limits: you can have a nice table for 12 players in 512 x 384, but if
you have more players than your resolution can display in one line, then
you need to learn reading the table in interleaved mode. 8)
The display has been approved to be good for at least 9 players in 512x384.
Estimated max players, that are well displayed, each in one line:
  320 x ??? = 7
  512 x ??? = 12
  640 x ??? = 16.
For more players you need to change to a higher resolution.
	I've looked in client.qc where the frags are increased, and added
there the calls to my frag-counter. If TEAMPLAY==2, for teamfrags you get 2
suicides and 1 frag for the teammate, so the total sum for frags stays
correct.
	The table counts only the frags for the active players when the table
is created ! If in midgame a player, who you fragged 12 times, leaves the
game, then you would have a difference in total frags between DDM and the
standard counter of 12. Because of this you get a '=' in front of toK if both
numbers are equal, a '>' if you killed some players who have left.
	Don't get confused when the powerup-only-kills are more than your
standard-total kills. This can happen when you kill often with Quad, but kill
yourself (or your team) often, too ! This is because p-o-kills are a part of
your total, but when you kill yourself, only your total gets decremented. I
had no desire to check whether to decrement p-o-kills, too, and it doesn't
make much sense to know if you kill yourself with Quad or not, either.
	The player -> table-ID assignment remains the same as long as no one
quits. If someone quits, then the following IDs are decreased, replacing the
quitter if no new player fills in the fallen rank.

Of course you can preserve the tables via logfiles, but the tables need not
to be edited by piping the log through a filter, just cut out the tables
from the log. (on client or server you start a console-log by launching Quake
with the command-line parameter -condebug. In the DDM-dir it appends to a
file qconsole.log)
	For dedicated servers I've added the possibility to have the tables
printed at the end of each level on the server-console, too. You can turn
this feature OFF by setting the dummy-console-variable 'temp1' to 1 exactly.
All other values, in particular 0 by DEFAULT, set it ON.
	It was intended for dedicated servers where all their console-traffic
is logged. This allows for alot of tables that can be published. 8-) Don't do
this on listen-servers (not dedicated, where the server is also a player),
because then the tables are printed twice for the server-player.
	Logging has the bad side effect of lag: when a player logs, then this
player gets lags every time he kills someone (not DDM's influence) and at the
end of the levels (very strong DDM influence, takes long). When the
server logs, every player is fine till the end of level. Now DDM loads the
server so much, that the players get a 'disconnected' symbol on the screen.
Don't worry, just wait. For 4 players it didn't take more than 3 seconds on a
P133 32MB, 9 players ca. 17 secs, for more players it has to be tested !
(disturbing) Lags should occur only when logging !

Sample output:

>>>>>>
******
   DDM:  lvl e1m3,  20.0 min
      TP 2, DM 1, Tl 20, Fl 0
<1 Emperor,3,0><2 pedman,7,0><3 tornado,8,0><4 Chameleon,23,0>
K/V:  1   2   3   4 :toK
--------------------
  1= -2   2   1   2 =  3
  2=  5  -1   3   0 =  7
  3=  0   6  -4   6 =  8
  4=  8   1  17  -3 = 23
--------------------
toD= 15  10  25  11 
Teams <1,3>=11 <2,4>=30
<<<<<<

Legend: K: Killer, V: Victim, toK: total Kills, toD: total Deaths,
	lvl: played level, TP: teamplay-mode, DM: deathmatch-mode,
	Tl: timelimit, Fl: fraglimit
The player-list: <tableID name,standard-total-kills,powerup-only-kills>.

######

Any kind of reports are welcome !

history
-------
1.0	: first public release
1.1	- design modifications
	- added level, time, teamplay info
	- added teams-line
	- toggles console at end of level
	- fixed: optional powerup-neutralization caused penalties against
		powerup-users for new entering player.
1.1cw	- again design mods (includes powerup-frags)
	- added deathmatch, time- and fraglimit info
	- legend not on display, read this text ! :)
1.11ds	- changed order in table-header
	- control with temp1 whether to print to server-console too.
		(intended for dedicated servers only)
1.12ds	- changed server-console-output to default, set temp1 to 1 to turn
		off
	- tried to make the header look better, to identify players easier
	- the patch greets you with v1.11ds even though it's 1.12ds !
		there are no real changes
1.13	: still no real changes, only design and doc, displays v1.13 ;)
1.14	- removed display on every player-quit
	- removed optional powerup-kills influence on total
