Contents | Index | < Browse | Browse >
3.1. Actors
In a typical adventure game it seems as if the player
is moving around the dungeon taking things, smelling them,
breaking them, and so on. A better model would be that the
player is giving commands to an actor. It is the actor
which actually moves around, collects items, and otherwise
acts. It is this model which ADL follows.
An Actor is essentially an "animate" object which acts
upon commands given to it. Notice that there is nothing in
this model which prevents more than one Actor from running
around a scenario. In fact, in ADL there may be up to ten
Actors which are active at any one time.
There are two kinds of Actors: interactive and non-
interactive. The player is an example of an interactive
Actor. Commands are read directly from the keyboard and
placed in a line buffer which is then passed to the parser
and interpreter. When the line buffer is empty a new one is
read from the keyboard. Any number of Actors may be
interactive, making multiple player games a possibility.
The robot in the introductory script is an example of a
non-interactive Actor (see Appendix 2 for the source to the
scenario which produced that script). The line buffer for
the robot was initialized after the player typed the sen-
tence starting with "Tell the robot ...". The robot then
acted on this command by performing the requested actions in
parallel with the actions of the player. This means that
each Actor gets one turn for each turn that the player
experiences. A non-interactive Actor is deleted from the
list of active Actors when its line buffer is emptied.
There is a special object-like item named ".ME" used to
implement this sort of "multiprocessing". .ME represents
the Object ID of the current Actor for the purposes of mov-
ing around, taking things, etc. Anything that the player
can do can be done just as well by another Actor. This is
probably the most powerful (and most obscure) feature of
ADL.
Actors may be activated using the $actor built-in rou-
tine and deleted at any time by using the $delact routine.