Manual page for PLAYER(5)
player.config - player configuration file for crock
SYNOPSIS
player.config
DESCRIPTION
The
player.config
file contains entries that specify certain character specific parameters,
the locations of bitmaps and sound files, the definitions of moves and
the keybindings.
There are four sections to the player config file:
variables, bitmaps (and sounds), moves,
and
keybindings.
Each command is terminated by a newline.
Lines that begin with a hash sign
(#)
are interpreted as comments and are ignored, as are blank linkes.
Variable entries have the following form:
set variable value
-
variable
-
can be one of the following:
-
- width
-
to set the global width of the character
- version
-
to set the version of the config file format.
The only valid values are:
-
- 1
-
Obsolate. Initial version of config file.
- 2
-
The current version of the config file, as described by this man page.
- pathprefix
-
Specifies the path that should prefix all bitmap and bitmask file names.
Note that if the environment variable CROCKROOT is defined, it is prepended
to all filenames, before the pathprefix. This allows the pathprefix to
refer only to directories within the crock distribution (or an alternative
set of directories).
- bmsuffix
-
Specifies the suffix that should be added on the end of all bitmap
file names. Typcially ".xbm".
- bmmsuffix
-
Specifies the suffix that should be added on the end of all bitmap mask
file names. Typcially ".m".
- sndsuffix
-
Specifies the suffix that should be added on the end of all sound
file names. Typcially ".wav".
- face
-
Specifies which direction the player is facing. Legal values are
"left" and "right".
- stepsize
-
Specifies how far a player moves with each step to the left or right.
- startattribute
-
Obsolete. Specifies the flag values initially for the character.
This value would be the sum of all the special move attributes that
the character should initially possess. The idea being that certain
special moves would require a certain amount of "experience" to be
gained before they could be used. Support for this feature was removed
from the code due to the tediousness of keeping it in sync with the
special moves. No support for adding attributes was implemented.
-
value
-
is a symbolic or numeric value, depending on the variable set.
- Bitmap loading entries have the following form:
-
load tag filename xoffset yoffset offense_zone,
head_zone, mid_zone, low_zone
-
tag
-
is the "tag name" or nickname of that image. The
tag
is used to refer to the bitmap when defining moves.
-
filename
-
is the full path to the X bitmap file. This is for both the
bitmap image and the bitmap mask. The actual filename to load
is constructed by taking the
filename
and prepending
pathprefix
to it and adding
bmsuffix
or
bmmsuffix
to it (for bitmaps and bitmap masks, respectively).
-
xoffset
-
and
yoffset
are numeric offsets for the image in pixels from the upper left corner
of the window. Note that these must be determined and calibrated, because
different frames have
different
widths and heights, since each is cropped to reduce space utilization.
The perl scripts
adjustbm.1
and
changeconfig.1
can be used to determine the offsets and uniformly change the offsets
respectively. If the global
width
and
height
values are changed, the bitmap offsets must be changed as well.
-
offense_zone, head_zone, mid_zone,
-
and
low_zone
all have the same form:
-
-
- xhigh yhigh xlow ylow
-
these form the boundary line for that zone. Note that the comma
(,)
is required to separate each zone definition.
- offense_zone
-
represents the area of the image that is attacking, such as the
first in a punch or foot in a kick. If the move is not an attack
then it should be defined as: "-1 -1 -1 -1,".
- head_zone
-
represents the area from the top of the head to the neck and is used
to determine if an attack hit the head. If there is no head zone
present, perhaps due to an unusual crouch or doubling over, then it
should be defined as "-1 -1 -1 -1,".
- mid_zone
-
represents the area from the neck to just below the torso (typically
approximated around the mid-thigh region) and is used to determine if
an attack hit the mid section. If there is no mid zone present, then
it should be defined as "-1 -1 -1 -1,".
- low_zone
-
represents the area from just below the torso (around the mid-thigh)
to the bottom of the feet and is used to determine if an attack
hit the legs and trips the fighter. If there is no low zone present,
perhaps due to a jump, then it should be defined as "-1 -1 -1 -1". Note
that there is no comma after the low zone definition.
- Also note that if a frame is defined as being "invulnerable",
-
then all three vulnerable zones,
head_zone, mid_zone,
and
low_zone
should be defined with -1's. A fighter is "invulnerable" while
recovering from an attack (e.g., getting knocked down and then
standing back up), losing, wining, etc.
- A varient of the
-
load
command is the
loadmask
command which allows a new mask to be associated with an image that
has already been loaded. It has the following form:
load originaltag tag filename xoffset yoffset
offense_zone, head_zone, mid_zone, low_zone
-
orignaltag
-
is the tag name of the already loaded bitmap image to use for the frame.
Note that only the new mask will be loaded from disk.
- All other fields are exactly the same as the
-
load
command.
- The final loading command is the
-
soundload
command which loads in sounds. It has the following form:
soundload sound_tag filename
-
sound_tag
-
is the "tag name" or nickname of that sound. The
sound_tag
is used to refer to the sound when defining moves.
-
filename
-
is the full path to the sound file. The actual filename to load
is constructed by taking the
filename
and prepending
pathprefix
to it and adding
sndsuffix
to it. Note that it may be necessary to change the
pathprefix
variable before this command, if the sounds are in a different
directory than the images.
- Moves definitions are multiline commands formed by specifying
-
the move name and attributes and all of the images that comprise it.
Moves are defined as follows:
define movename damage xoffset yoffset flag
[
soundtag stag
]
[
tag delay
]
[ ... ]
enddef
- movename
-
is the name that the move is called.
Crock
requires several
movenames
to be defined. Refer to section XXXXX for a complete list.
The
movename
is used when binding a key to that move. Refer to the definition of
bind
for more details.
- damage
-
specifies how much damage the move does. Players strength start at 100
and go to zero. Blocked moves do one quarter the damage of undefended moves.
xoffset
and
yoffset
specify the force imparted by the attacker to defender when they receive
an unblocked hit. This can be used to knock the defender back or in the air.
- flag
-
specifies if this move has any special attributes. A value of 0
indicates that it is a normal move. A non-zero value causes
crock
to call a code to handle the move. Note that unfortunately, much
of the code must be custom written for that move. Refer to the
source file
flags.h
for a list of all the legal values of
flag.
In addition, special moves have been defined (currently) as bitfields,
so the values tend to get large, since each value must be twice that of
the previous. This may change in a future version.
- If there is a sound to be associated with that move (and played
-
when it is invoked) then the line immediately following the
define
command must be a
soundtag
line.
- stag
-
is the tag associated with the sound that was loaded with the
soundload
command.
- After the optional
-
soundtag
line, there are zero or more instances of the
tag
line, which specifies the frames, in order, to use for the move.
- tag
-
is the tag associated with the image that was loaded with the
load
or
loadmask
commands.
- delay
-
is the delay or number of "ticks" associated with that frame. A larger
number holds the player in that pose for a long time, a small number
makes a quick move. "ticks" is a game dependent time unit and is
currently defined to be 100,000 microseconds.
- The move definition is terminated by the
-
enddef
line.
- Keybindings associate keys to the move names and have the following form:
-
movename binding
-
movename
-
is the name of the move as specified with a
define
command.
- binding
-
specifies they key bindings to be used for that move. The key
bindings follow the X key translation conventions (refer to XXX
for details).
EXAMPLES
Here is a trimmed down version of the config file currently used by crock.
Note that the only difference is that the real version has more backgrounds
it uses.
# PHASE I:
#
#Set up some variables. Format
# is: set varname value
set version 2
# path to look for bitmaps
set pathprefix /n/weather/0/frank/frames/done-golden/
#bitmap suffix
set bmsuffix .xbm
#bitmap mask suffix
set bmmsuffix .m
#sound file suffix
set sndsuffix .wav
#character is facing right or left
set face right
#width (approx. max) of character
set width 230
# size of step he takes
set stepsize 25
# PHASE II:
# Load in bitmaps
#stances
load ts0 s0 0 90 -1 -1 -1 -1, 122 12 119 58, 119 58 134 150, 134 150 155 264
load ts1 s1 0 90 -1 -1 -1 -1, 127 12 118 53, 118 53 138 160, 138 160 174 268
load ts2 s2 0 90 -1 -1 -1 -1, 100 13 100 59, 100 59 118 158, 118 158 166 263
#move
load tw0 walk0 0 90 -1 -1 -1 -1, 115 16 101 57, 101 57 132 163, 132 163 183 263
load tw1 walk1 0 90 -1 -1 -1 -1, 142 14 137 53, 137 53 160 162, 160 162 200 263
load tw2 walk2 5 105 -1 -1 -1 -1, 143 13 137 54, 137 54 156 165, 156 165 183 271
load tw3 walk3 0 70 -1 -1 -1 -1, 115 14 103 52, 103 52 120 167, 120 167 149 275
load tw4 walk4 0 90 -1 -1 -1 -1, 125 18 108 56, 108 56 134 154, 134 154 158 264
#left jab
load tlj0 lj0 -20 80 -1 -1 -1 -1, 115 16 109 56, 109 56 138 171, 138 171 176 271
load tlj1 lj1 -10 80 188 34 204 54, 110 17 107 57, 107 57 134 174, 134 174 169 274
load tlj2 lj2 5 80 224 29 225 25, 121 12 114 50, 114 50 145 172, 145 172 175 269
load tlj3 lj3 -20 85 -1 -1 -1 -1, 98 11 92 52, 92 52 121 162, 121 162 163 264
#
# load a sound into the audio server (if present)
set pathprefix /n/monster/1/remcon/frank/sounds/
soundload low hmmm
# PHASE III:
#define a move
define stance 0 0 0 0
ts0 2
ts1 2
ts2 2
ts1 2
enddef
define leftjab 10 10 0 0
tlj0 1
tlj1 1
tlj2 3
tlj3 1
ts0 3
enddef
define moveleft 0 0 0 0
tw4 2
tw3 2
tw2 2
tw1 2
tw0 2
enddef
define moveright 0 0 0 0
tw0 2
tw1 2
tw2 2
tw3 2
tw4 2
enddef
# PHASE IV:
#
#
#bind a move name to an action.
bind leftjab <Key>KP_Add
bind quit <Key>q
bind moveleft <Key>Left
bind moveright <Key>Right
FILES
- config.crock
-
- player1.config
-
- player2.config
-
SEE ALSO
crock.1
config.crock.5
adjustbm.1
changeconfig.1
netaudio,
AUTHOR
Copyright (c) 1994 Frank Adelstein
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97