Newsgroups: rec.arts.int-fiction
Path: news.duke.edu!newsgate.duke.edu!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!feed2.onemain.com!feed1.onemain.com!uunet!dca.uu.net!ash.uu.net!world!buzzard
From: buzzard@world.std.com (Sean T Barrett)
Subject: Re: Game design article
Message-ID: <GLBtzq.Gq8@world.std.com>
Date: Wed, 17 Oct 2001 01:40:37 GMT
References: <9qcn9u$d47$1@news.panix.com> <GL8E3z.GEw@world.std.com> <SBuy7.18390$gT6.11004926@news1.rdc1.sfba.home.com> <f5a22ce4.0110152106.12ca9cd4@posting.google.com>
Organization: The World Public Access UNIX, Brookline, MA
Lines: 94
Xref: news.duke.edu rec.arts.int-fiction:93656

tryguy <tryguy74@hotmail.com> wrote:
>Sean, how does a "subscription list"? I've just downloaded "The
>Weapon". :)

"The Weapon" is all hacks. I wouldn't really want to try doing
subscription lists in Inform; building real data structures is
a little too complicated.

The system we used on the mud in '93 wasn't very ideal, but basically
you could say to any object "subscribe to stimulus X":

Object foo:
   ...
   someobj.subscribe(self, $someStimulus);
   ...

this would cause someobj to add 'foo' to a list of objects
associated with '$someStimulus'. Then later someone would
stimulate it:

   someobj.stimulate($someStimulus, ...other info...)

and someobj would iterate through its list of things that
receive it, and make it call them like so:

   foo.someStimulus(...other info...)

We used this system for the following behaviors that I can recall
(we'd only implemented a small part of our world model when we stopped):

   object arrives
   object departs
   object begins flying
   object stops flying
   flaming object arrives
   liquid object arrives

Objects that were flammable would watch for a flaming object
to arrive. Objects that needed to know about liquid (such
as flaming objects, liquid objects, or things like paper that
would get soaked) would watch for liquid objects. We built a
pressure-plate system that would watch how many items were in
a room, subtracting out the ones that were flying, using the
first four--indeed, we allowed any object to subscribe to these
lists without being part of the contents, but normally you
subscribed to your container's lists.

I can easily imagine expanding this to have objects request
a threshhold--"it must be THIS hot before you should tell
me about it". The containers could track these threshholds
and only call if the threshhold is exceeded.

The commercial game Thief actually had a little system called
"Act/React" which was organized around the same issue: allowing
objects to affect other objects, instead of being player-centric.
It was used for things like letting water extinguish torches, and
it used a generic stimulus-response model, although it was a 3D
game so there were different models of spatiality. (Actually I'm
not sure it was ever used for anything other than when two things
came in contact via collision.)

Back to the mud, we actually used a separate system for passing sense
data--sense data doesn't tend to have "physics-y" cause-and-effect so
much as NPC reactions, and that system allowed propogating sense data
from room to room which was rather more complex. The main important
compontent was to pack up the information describing some event
which had occured (the player put the ball in the box) not just
as a string, but as a little object which knew how to print the
string from the player's pov, possibly from others' povs, and
also could provide the raw info in an easily digestible form to
the NPC.  They wouldn't describe what action the player had
*attempted*, the way before/after/react_after do in Inform;
instead they would describe each physical thing that occurred
that was visible. If attempting to 'get X' causes a collapse
that drops a boulder into the room, an event, say,
"moved(boulder,room,player,TRUE)" , would be generated:

   moved    ! an object moved to a new location
      boulder   ! the object that moved
      room      ! the place where it ended up
      player    ! the actor who triggered it
      TRUE      ! TRUE if it was unintentional (usually false)

and then you could write some code along the lines of

   if (agent == player && unintentional)
      "^", (The) self, " says, ~Way to move ", (adjthatorthose) obj,
        ", you loser.~";

except that this comment would actually be issued as ANOTHER little
packet of sense data, and the player would only get to hear it if
the sense data managed to propogate to the player via sound propogation.

SeanB
