Title            : Quake2 Relay
Windows filename : relay-0.3.win32.zip
Linux filename   : relay-0.3.tar.gz
Version          : 0.3 beta
Date             : Mar. 3, 2000
Author           : Conor 'TheKoron' Davis
Email            : cedavis@planetquake.com
Webpage          : http://www.planetquake.com/relay/

LEGAL
=====
Quake2 Relay is Copyright (C) 2000 by Conor 'TheKoron' Davis

Quake2 Relay is based on the Quake2 3.20 source, and is subject to the
the Id Software license agreement in id_license.txt. All non-Id code
is distributed under the GNU General Public License. See the file
Copying for details.

INTRO
=====
Have you ever wanted more from a Quake2 demo? Tired of making every
player record demos of your clan matches just to see everything? Now
your problems are over (well not all, but..). With Quake2 Relay, you
can record entire matches and play them back through the Replay
module. Unlike client demos, which only record a match through one
player's view, relay demos can record everything in the level for the
entire duration of the match. With Replay, you can watch these matches
through any player's perspective, chase-cam mode, or free-fly mode.

Benefits of Relay:
- Every player's perspective is recorded
- No lag
- Smaller and easier than many separate demos
- Many different viewing options

INSTALLATION
============

Windows
-------
Unzip the archive into the quake2 directroy. It will create a release
directory and a proxy subdirectory. Your Quake2 tree should
look like this:
Quake2/
Quake2/release/gamex86.dll
Quake2/release/readme.txt
Quake2/proxy/relay/gamex86.dll
Quake2/proxy/replay/gamex86.dll

Linux
-----
Extract the source archive into a new directory (I use
/usr/local/src/relay/). You should now have a directory tree like
this:
relay/ChangeLog
relay/FAQ
relay/Makefile
relay/README
relay/common/*.c
relay/common/*.h
relay/democonv/*.c
relay/democonv/*.h
relay/proxy/*.c
relay/relay/*.c
relay/relay/*.h
relay/replay/*.c
relay/replay/*.h

Edit the Makefile to suit your needs (there is no configure
script). Make sure your QUAKE2_DIR, BIN_DIR, ARCH, and SHLIBEXT are
set correctly. Compiling with gcc gave me no errors or warnings.

Note that the Linux version does not work well yet. Player models do
not show up under Replay and no models show up in the output file from
democonv.

COMPONENTS
==========

Proxy
-----
The Proxy module is responsible for loading other game modules. In
Windows, it is the Quake2/release/gamex86.dll file. In Linux, it is
the Quake2/release/gamei386.so file.

Proxy works by checking the 'proxy' console variable for a list of
other proxy modules to load (which are in the Quake2/proxy/
directory). For example, if 'proxy' was set to 'relay', Quake2 would
load the Proxy module, which would then load the Relay module, which
would then load the real game module.

The Windows version of Quake2 will automatically load the proxy module
first before trying to load any other module, but the Linux version
will not. To remedy this, rename the real game module
(e.g. 'baseq2/gamei386.so') to another filename
(e.g. 'baseq2/mygame.so'). Then create a symbolic link called
'gamei386.so' in the game directory that points to
'../release/gamei386.so'. You must do this for every game directory
you wish to use with Relay. There is a script included in the source
archive called 'proxify' which, when run from the Quake2 directory,
will add Proxy support for the specified directory.

You can override the filename Proxy uses to load the game module by
setting the 'module' console variable (e.g. quake2 +set module
mygame.so). By default, Proxy will use the standard module filename
(gamex86.dll or gamei386.so). In Linux, you must set the 'module'
console variable to the renamed file (NOT gamei386.so) for it to work properly.

Relay
-----
The Relay component is used to record a match. It must be run on the server.

To use Relay, start quake2 from the command line:
quake2 +set proxy relay +set demofile <demofile> +set game <game>
or type the commands from in the console.

The Relay module will start recording when a level is loaded and stop
recording when the level is over.

Relay will record to path <basedir>/<gamedir>/demos/<demofile>.rla

If the demofile console variable is not set or is empty, Relay will
not try to record a demo.

The demofile console variable can have escape codes, which will be
replaced by whateever they represent when recording starts:
%A - Full weekday name
%a - Abbreviated weekday name (3 letters)
%B - Full month name
%b - Abbreviated month name (3 letters)
%d - Day of month (01 - 31)
%F - Map title
%f - Map filename
%H - Hour in 24-hour format (00 - 23)
%h - Hour in 12-hour format (01 - 12)
%j - Day of year (001 - 366)
%M - Minute (00 - 59)
%m - Month of year (01 - 12)
%S - Second (00 - 59)
%W - Week of year, with Monday as first day of week (00 - 51)
%w - Weekday, with Sunday as first day of week (0 - 6)
%Y - 4-digit year
%y - 2-digit year

Example:
If you set the demofile console variable to "%f.%d%b%Y.%H.%S.rla",
Relay might store the file as:
quake2/baseq2/demos/base1.05Dec1999.11.04.rla

Replay
------
The Replay module is used to playback a match recorded with Relay. It
can also play regular client-side demos.

To use Replay, start quake2 from the command line:
quake2 +set proxy replay +set demofile <demofile> +set game <game>, 
where <demofile> is the filename of the file you recorded to with
Relay, and <game> is the same game you used to record. The default
extension for <demofile> is .rla, so if you want to play a client-side
demo, you must supply the .dm2 extension.

Then load the same level used to record the demo. If you load
the wrong level, Replay will restart the server with the correct
level.

While viewing the demo, pushing number keys 1-9 will track player 1-9,
respectively. Pressing 0 will stop tracking any player and revert to
freefly mode.

Pressing TAB will bring up the menu which lets you view information
about the demo, switch players to track, and change various settings.

When watching a demo through a player's eyes, you will still see the
player's model. This is a limitation of quake2.exe and cannot be fixed
without making the model invisible to everyone.

Democonv
--------
Democonv converts a relay demo to a client-side demo.

The syntax is:
democonv --basedir <quake2-dir> in.rla out.dm2

Democonv needs to know the quake2 directory so it can read the map
files to check for visiblity information and remove out-of-view entities.

Type 'democonv --help' for details.

HOW RELAY WORKS
===============

Relay is a proxy module, also called a transparent dll. When you start
Quake2, it looks in the release directory for a module to load before
the game directory. The module there is responsible for loading other
proxy modules in a chain as specified by the proxy cvar. For example,
if the proxy cvar is set to "relay", the proxy loader will load the
Relay proxy, which will then load the regular game module. The Relay
module intercepts various calls between the game module and the quake2
executable, which it then uses to record the locations of all the
entities and info for all the players.

SOURCE
======
The source is provided as a Microsoft Visual C++ 5.0 project and a
Linux Makefile.

The proxy concept is based on the ProxyMod source by Avi Rozen
(Zung!). http://www.telefragged.com/zungbang/gamecam

The source for Replay contains a versatile menu system based partially
on David 'crt' Wright's ra2menu source and the Deadlode 2 TC
(http://www.thecoven.com/dl2.shtml).

NOTES/BUGS
==========
- Sometimes the handling of old_origin will make entities seem to jump
  around
- The Linux version of Replay does not show player entities

ACKNOWLEDGEMENTS
================
Many thanks to id Software for Quake2.

Uwe Girlich for lmpc, the dm2 format description, and adding the relay
extension to the dm2 specs.
http://www.planetquake.com/demospecs/

Avi Rozen (Zung!) for the ProxyMod interface
http://www.telefragged.com/zungbang/gamecam

David 'crt' Wright for the ra2menu source
http://www.planetquake.com/servers/arena

Tom Vykruta for posting a serverrecord sample from 
John Carmack











