Previous
Next
Table of Contents
An entity is an object. This may be the whole level (described by a BSP file),
the player (described by a MDL file), an explosion (described by a SPR file) or
the like.
There are different kinds of entities.
Static Entity
A static entity doesn't interact with the rest of the game. These are flames
(progs/flame.mdl) and the like. It will be
created by the spawnstatic message.
It will never be necessary to reference such an entity. They don't get an
entity number. The maximum number of static entities is 127.
Dynamic Entity
A dynamic entity is anything which changes its behaviour or its appearance.
These are ammunition boxes, spinning armors, player models and the like.
A dynamic entity will be created by the spawnbaseline
message. The maximum number of dynamic entities is 449.
Temporary Entity
A temporary entity will be created by the temp_entity
message.
A temporary entity is a (as the name indicates) short time entity.
Quake uses these entities for hits on the wall (point-like entities) or for the
Thunderbolt flash (line-like entities).
For more information on temporary entities look in section
temp_entity.
The Quake objects pass different life phases. The following information is not
DEM specific but it may be of general interest to understand the
co-operation of all the messages.
Armor
- To enable the client to display an armor the serverinfo message asks
for the
``progs/armor.mdl'' model file and the ``items/armor1.wav'' sound file.
- The armor starts its life with a spawnbaseline message during the
initialize phase. The armor is now a dynamic entity and spins around.
- The corresponding updateentity message appears only, if the camera is
near enough to see the armor.
- The player gets it in the play. This results in the sound message
``items/armor1.wav''
and a print message ``you got armor'' and the stufftext message
``bf\n'' to make a short flash.
- The updateentity message for the armor
doesn't appear ever again: the player got it.
- From this moment the
corresponding bit in the
items variable in the clientdata message
will be 1 and the armorvalue variable get its maximum (100/150/200).
From the items bit follows the color of the picture to be drawn in
the lower left corner of the status line.
- Now the player may be hit by a grenade. The total damage value
(damage=take+save) will be
split in take (
health-=take) and save (armorvalue-=save).
The save amount depends on the armor type (none/green/yellow/red):
save=0.0/0.3/0.6/0.8*damage.
The damage message in the DEM file tells the
reduction of the current armor. With the old clientdata value and the
reduction it is easy to recompute the new clientdata armor value.
Any difference betrayes the cheat code player.
- After some severe hits the
armorvalue variable is 0 and the items bit falls back to 0 as
well. There is no armor anymore.
(Multi) Player
The following describes the deathmatch DEM messages of the two players Alice
and Bob. Alice records the game from her -listen 3 server.
- The serverinfo message contains the ``maxclients 3'' command to show
how many clients are (at most) in this recording.
- During the 1st initialization phase there are 3 spawnbaseline messages to
create the player models. In the 2nd initialization phase player 0 gets its name
(Alice), color and frag count (0) . The other 2 players get an empty name
string. In the 3rd phase Alice gets again her name and color.
All these phases are controlled by signonnum messages.
- The game starts. Alice (entity 1) is alone in the game and looks around.
- Bob connects to Alice's server and it appears entity 2 (Bob's player
model) a transport end temporary entity and a print message
(``Bob entered the game'') to inform everyone. Then the player 1 (Bob) gets his
updatename and updatecolors message.
- Alice doesn't hesitate and runs for him and shoots him with the Shotgun.
During every shot the clientdata message reduces the ammo count,
the angles[0] command shows the wobble of Alice's screen and
the weaponframe
command selects the corresponding weapon frames. There is a sound message
to start the
weapons/guncock.wav file. Entity 1 gets
its attack_state command. Alice hits Bob and so appear many particle messages
(blood).
Every Shotgun shot contains 6 parts. This means the shot can create 6 particles
(full hit) and 0 temporary entities (type 2: wall hits) or 0 particles and 6
temporary entities or anything in between. If there was at least one particle
Bob creates a sound message to start player/pain?.wav.
- Alice kills Bob. This creates the sound message to start
player/death1.wav. Then comes the updatefrags message to give Alice
1 frag and a print message to inform everyone ``Bob chewed on Alice's
boomstick''. A new entity will be created on the fly with an updateentity
message to display Bob's backpack.
- Bob is dead, his entity 2 model remains in the death frame.
- After some
seconds he starts again by pressing
SPACE. He reappears in a
totally different part of the level. The dead body transforms from entity 2
to entity 4 (maxclients+1) and a temporary entity (transport end) informs
about his return. He is out of sight from the point of Alice's view. This
means there is no entity 2 updateentity message.
- Bob runs to Alice's room. He goes through a slipgate and appears with
4 temporary entities (type 11: transport end) and the entity 2 in her room.
- Bob shoots and kills Alice. The scenario is the same as above. Only
the damage messages appear now too, because Alice was hit.
- Bob uses the say console command (
say this sucks) and in the
DEM file appears a print message ``Bob: this sucks''.
- Bob disconnects from Alice's server. This results in a print message
``Bob left the game with 1 frags'' and updatename and updatecolor messages
to remove client 2 (or player 1). It is a bit strange but there are 2
updatefrags messages: player 1 gets first 0 frags (this I understand) and then
again 1 frag (this I don't understand at all).
- Entity 2 represents now the dead player 1.
- Alice spins around (it is possible even if you are dead) and the two
dead bodies from Bob are totally white
because they represent player 1 and he got (as he left) the updatecolor message
with the standard colors 0 and 0. She is alone, restarts again her play,
goes to the level end slipgate and get the ranking screen (intermission
message) with only one player
(Alice). Then she stops the recording. The DEM file ends with a disconnect
message.
Medikits, Chthon, etc.
will be included later (anyone volunteer?)
Previous
Next
Table of Contents