[MUD-Dev] npc memory and reactions
James Wilson
jwilson at rochester.rr.com
Sat Sep 5 09:00:45 CEST 1998
I've been thinking about how one could best implement
certain scenarios, mainly social ones involving NPC reactions
and memory. (I think these issues generalize to certain sorts of
special effects as well, but am most interested in social effects.)
For instance, suppose that when Robot Zeke sees Tom wearing
a swastika, he immediately reports him to the local ADL and
Tom is brought in for questioning...
First, how does Zeke get the information about Tom's sartorial
faux pas? Perhaps Zeke is the consumer of a stream of 'sensory
events', i.e. some machine-reasonable encoding of "You see
Tom wearing a swastika". When Tom does something notable,
he broadcasts a stream of such events to all who can sense him.
Ideally, only events appropriate to the receiver would be sent (or
there'd be some wasted effort there).
Another possibility is that Tom's coming into sight sends just
one event, "Here's Tom", to Zeke, and then it is Zeke's job to
inspect Tom for the swastika. This way, viewers don't get any
information they don't ask for; conversely, Zeke will have to
scan every object that comes into sight, rather than simply
waiting for a 'you see swastika' event.
I believe this is the 'double dispatch' problem. To viewers who
couldn't care less what Tom's wearing, Tom should seem like
just another guy (and no irrelevant information should be sent).
BUT to viewers who care about the swastika, Tom should be
seen as a swastika-wearer AND a guy without the swastika
should be seen as just another guy. This bleeds into the 'different
people see differently' (or 'see different', as Apple would put it -
feh!) thread of a while back, which I am very interested in.
A bit of a different issue has to do with the internal representations
of 'the Tom object' and 'the Zeke object'. If Zeke wants to
remember Tom (so he can still be mad even if Tom takes off the
swastika), does he store some information about Tom in 'the
Zeke object'? Or does he set a 'cookie' in 'the Tom object'
which he then can look for upon re-encountering Tom? Both
have pros and cons... I will call the former method 'Zeke saves',
and the latter 'Tom saves'.
'Zeke saves' has the advantage that the information Zeke retains
might be imperfect; that is, he might mistake someone else for
Tom later if the way he remembered Tom was 'squat and balding
and white and middle-aged and male [etc]', and if he runs into
Bill who also happens to meet all (or maybe just MOST?) of
those criteria. One could use some fuzzy logic sort of thing here,
where if all the squat white men Zeke meets are evil, he builds up
a hatred for all squat white men and a dislike for white people
in general. I think there would also have to be a division
between short-term and long-term memory, so only the most
significant facts get permanently saved; otherwise Zeke's memory
could grow quite large and unwieldy. If there is also a mechanism
for transmitting memories from NPC to NPC (possibly distorting
them along the way) this could be quite a nice system.
'Tom saves' has the advantage that it can be implemented very
simply by just adding a new slot or property to 'the Tom object',
which other anti-nazis can then check quite easily. This also
bundles all the information about Tom inside 'the Tom object',
so if he dies or leaves the game the now-irrelevant info
can be removed. However, using cookies is a little too exact
for my taste; that is, if Tom becomes persona non grata with
Zeke, then takes off his swastika and goes across town to visit
with Phyllis, how could she possibly know immediately how
Zeke felt about Tom? One could build in a time delay, I suppose,
but it'd be kind of nice to give Tom the chance to save his
reputation by killing Zeke before he can spread the word, or
something similar. This technique could also lead to 'cookie
buildup', where cookies that are no longer relevant accumulate.
However, it becomes more difficult to determine whether a cookie
is in fact irrelevant - if Zeke's cookie turns all of Happytown
against Tom, and Zeke is killed a week later (by which time
everyone's heard the news), Tom shouldn't suddenly go back
to 'just some guy'.
James
More information about the mud-dev-archive
mailing list