GameCam Configuration
GameCam should work just fine without any
special configuration, but may look and behave much better with it.
The following first two sections explain how to tweak the CHASE camera and
the ACTION camera target selection. The third section
deals with fixed cameras (how to define and use them), and
the last section is a
description of the simple script language used for programming the
GameCam ticker tape.
CHASE Camera Target Selection
The GameCam CHASE camera has two modes of operation:
-
MANUAL - this is the familiar CTF chase camera, only that spectators can adjust the
camera position and view angles with the movement keys (or mouse). The camera
may be reset with the CTRL key (+attack command).
-
AUTO - the computer adjusts the camera position and view angles automatically to provide
the best view of the closest opponent. I refer to this mode as creep-camera because the first camera mod
to ever use this concept was CreepCam for
(classic) Quake (but the GameCam creep-camera
uses my own original algorithm).
Obviously, in order to get the best results, GameCam has to
figure out who are the chased player's opponents and who are his team mates. The problem is
that different mods use different ways to distinguish between teams.
By default GameCam detects teams by following the next rules:
-
if either DF_SKINTEAMS (64) or DF_MODELTEAMS (128) is set
in dmflags, then
GameCam detects teams by skin or by model (respectively)
-
if the game folder name has the string "ctf" (or "CTF") in it, then
GameCam detects teams by skin
But not all CTF games use skins for teams, and other mods use other methods (e.g. HeadHunters uses
disks). GameCam can be configured to distinguish between
teams by looking at their model, skin, gun, and auxiliary models 2, 3 and 4 (e.g. HeadHunters disks).
To do that just set the flag GCF_TEAMS (8192) in
gc_flags, and set
gc_teams to one of the following values:
"skin", "model", "gun", "model2", "model3" or "model4".
Long explanation, short solution ...
ACTION Camera Target Selection
The ACTION camera may be configured to focus on specific types of players,
based on a priority list.
By default, the ACTION camera focuses on the player that can see the maximum number
of players (favoring players with larger frag counts). This behavior may not suit some
mods - e.g. in CTF the camera should favor flag carriers, and in HeadHunters the camera
should focus on players carrying the largest number of heads.
When using the priority based target selection scheme,
GameCam
first attempts to find a player that matches one of the potential targets
specified in gamecam.ini. If a match is found, GameCam
focuses on that player (favoring players that see the most players and
have the most frags). If a match is not found, GameCam
reverts to the default selection scheme, and attempts to find the
spot where most of the players are located.
Each game folder should have its own gamecam.ini (if needed). This file holds
a list of potential targets, grouped by priority. Each target is specified
as "<type> <value>", where
<type>
is one of the following:
- model - player plugin model;
<value> is <model>/<skin>.
- gun - player gunindex model (weapon view model);
<value> is the model's (.md2) file path.
- model2 - player modelindex2 model;
<value> is the model's (.md2) file path.
- model3 - player modelindex3 model (CTF flag, HH heads);
<value> is the model's (.md2) file path.
- model4 - player modelindex4 model;
<value> is the model's (.md2) file path.
- shell - player shell;
<value> is a pair of numbers separated by a colon - <effect>:<renderfx>
(e.g. quad is 32768:0, pentagram is 65536:0, and 256:<color> is a color shell -
consult id software's source code for more values).
Several example configuration files are available for download.
Note that gamecam.ini contains the target list only and is not used for anything
else. Any console variable setting should be placed in your server's configuration
script (autoexec.cfg, server.cfg etc.).
Fixed Cameras
The ACTION camera can find its way around the map without any
help. The dynamic behavior of the camera generates very cool shots most of
the time. However, sometimes it looks better if the camera always films
the action from the same position in certain areas of the map.
To enable this you can define fixed cameras for each area in each map that
you think would be best covered from specific positions.
GameCam uses fixed cameras as
long as the player being filmed is visible by some camera. When the player goes out of
sight GameCam reverts to the free moving
ACTION camera, until another camera has the player in view.
So here's what you should do:
-
start up a listen (i.e. not dedicated) server and load the required map
-
set the flag GCF_ALLOW_FREE (4) in
gc_flags, so that you can
enter FREE mode
-
type
camera on
and then use the menu to switch to FREE mode (or type
camera free)
-
move through the level to find a good spot for the camera, tweak the zoom (fov) to your liking
and when ready type
camera add "<name>"
(where "<name>" is the name
of the camera, which is later displayed to spectators at the bottom of the screen)
-
repeat the last step for all other spots
-
use camera list
to list all the cameras, and
camera next
or camera prev
to cycle thru the cameras and review your work
-
use camera remove
to delete the current camera,
and camera update ["<name>"]
to modify its parameters
-
save the cameras to file with
camera save
(this will generate a file named mapname.cam under a new cameras
sub-folder in the current game's folder, where mapname is the name of the current
map)
(Linux: the cameras directory has to be created manually
before you attempt to save!)
The new camera file will be auto-loaded by GameCam
the next time you load that map, so that the above procedure can be used to edit an existing
camera file. To test your work I recommend you run the map with bots, to see whether the resulting
camera behavior looks good.
IMO it's not a good idea to cover all the map with cameras - a better approach seems
to use fixed cameras to cover large (open) areas or strategic spots, and let the
free moving camera have control over the rest of the map.
Ticker Tape Scripts
The GameCam ticker tape can be programmed
with a simple script language which is a subset of the script language used to program
the Java LEDSign Applet.
Script Commands
- Appear - display text
- Sleep - wait (current text is kept unchanged)
- ScrollLeft - scroll text from right to left
- ScrollRight - scroll text from left to right
- Blink - blink text several times with a specified delay
- Do - begin loop
- Repeat - end loop (loop is executed a specified number of times)
- Reload - reloads the script file (this allows an external utility to update the
script automatically!)
Commands Parameters
All script commands have parameters:
- delay - delay in frames (10 frames = 1 second - applies to Sleep and Blink commands only)
- times - times to perform command (applies to Repeat and Blink commands only).
Note that "Repeat times=-1" is used to generate infinite loops.
- clear - clear text flag (possible values: true or false),
this parameter overrides any of the following
- center - center text flag (possible values: true or false)
- startspace - number of spaces before text (ignored if centered)
- endspace - number of spaces after text (ignored if centered)
- text - text to display (must be last parameter on the line)
Note that some parameters have no effect on some commands so they are simply
ignored if encountered.
Text Codes
The ticker text may include the following escape sequences and codes:
- \!text\! - highlight text
- \" - quotation mark
- \\ - back slash
- \x00 - special character: hexadecimal ascii code ('x' and two hex digits)
- \000 - special character: octal ascii code (three octal digits)
- \{$cvar$} - any console variable (replace 'cvar' with name of cvar)
- \{sb} - top scores (number of entries controlled by gc_maxscores)
- \{tt} - current time (12 hour format)
- \{hh} - current hour (12 hour format)
- \{HH} - current hour (24 hour format)
- \{hm} - current minutes
- \{ss} - current seconds
- \{am} - "am" or "pm"
- \{AM} - "AM" or "PM"
- \{dd} - day of the week (Sun Mon etc.)
- \{DD} - day of the week (Sunday Monday etc.)
- \{dn} - day of the month
- \{mn} - month number (1-12)
- \{mm} - month name (Jan Feb etc.)
- \{MM} - month name (January February etc.)
- \{yy} - year (two last digits)
- \{YY} - year (four digits)
These escape sequences are also available for the General Admission MOTD.
Using The Script
After writing down your script save it to the current game folder with extension
".led". Set
gc_ticker
to be the name of this script file without the extension (e.g. "myscript" for "myscript.led").
The script will be loaded as soon as someone becomes a spectator.
Example Script
The following script is the internal script used by
GameCam
when gc_ticker
doesn't point to any valid script file.
Do
Appear center=true text=\!GameCam\! v1.02
Sleep delay=10
ScrollLeft center=true text=\x90\x80\x91 1998-99, Avi \"\!Zung!\!\" Rozen
Sleep delay=10
ScrollRight center=true text=http://www.telefragged.com/\!zungbang\!
Do
Sleep delay=3
Appear center=true text=http://www.telefragged.com/zungbang
Sleep delay=3
Appear center=true text=http://www.telefragged.com/\!zungbang\!
Repeat times=3
Sleep delay=10
ScrollLeft center=true text=\!TOP SCORES\! . . .
ScrollLeft endspace=39 text=\{sb}
Sleep delay=10
Appear center=true text=type '\!camera\!' to see the menu
Sleep delay=10
ScrollRight center=true text=\!GameCam\! v1.02
Repeat times=-1