1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  Parlez vous NPC? -->
<!--X-From-R13: @nguna T Kbfcr <lbfcrNunjnvv.rqh> -->
<!--X-Date: Tue, 24 Mar 1998 03:39:31 +0000 -->
<!--X-Message-Id: Pine.GSO.3.95q.980320171810.25232A&#45;100000@uhunix1 -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.LNX.3.96.980321022634.2885A&#45;100000#mpc,dyn.ml.org -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, Re: [MUD-Dev]  Parlez vous NPC?</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:yospe#hawaii,edu">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00868.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00870.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00807.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00892.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00869">Author</A>
&nbsp;|&nbsp;<A HREF="#00869">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00869">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>Re: [MUD-Dev]  Parlez vous NPC?</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: Mud-Dev list &lt;<A HREF="mailto:mud-dev#null,net">mud-dev#null,net</A>&gt;</LI>
<LI><em>Subject</em>: Re: [MUD-Dev]  Parlez vous NPC?</LI>
<LI><em>From</em>: Nathan F Yospe &lt;<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>&gt;</LI>
<LI><em>Date</em>: Mon, 23 Mar 1998 17:39:09 -1000</LI>
<LI><em>Reply-To</em>: Nathan F Yospe &lt;<A HREF="mailto:yospe#hawaii,edu">yospe#hawaii,edu</A>&gt;</LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Fri, 20 Mar 1998, Matt Chatterley wrote:

:Richard Woolcock asked me to make a post about something I mentioned as an
:offhand comment while dissecting one of the more annoying advertisements
:posted to rec.games.mud.admin in some time.

:I made an allusion to NPCs capable of conducting semi-coherent
:conversations with players, without following predefined patterns, and not
:using strictly pre-set responses, but rather, creating their own replies.

Hmm. Interesting. I suppose this would be a good time to point out that, as
the guy that loves his language handling AIs, this makes me blanche. Either
you're going to end up spending many cycles on it, or you're going to have
a pretty lame AI. But... I like a good challenge, so let me at it.

:Sadly the system I have in practise is neither as advanced as this, nor
:functional (I improved it, thus, it doesn't work now), but, this is the
:design model to which I am working, and with the exception of the last
:point, the system worked. An overview:

:The NPC receives a sentence from the player. The method of delivery is
:arbitary (I used directed speech, aka: 'say NPC, this is a sentence for
:you.' but this could equally be done with a separate command).

Just a note: I'd have to handle this clientside... meaning (and I already do
try to do this with spoken text before exporting it) I would be having the 
client tokenize all text and send the tokenized form to the server... but I
do send the complete text to all affected clients as well. I'm working on a
method to avoid involving the server in the transfer now. In any case... the
stuff I do is for input only, I haven't tried to stretch my local descriptor
program to the point that it could pose as an entity...

:The NPC takes this sentence, and performs some basic tests on it,
:determining the subject matter, sub-topics, and the overall tone of the
:statement. This is the hard part. One simple way to go about it is by the
:use of topic and context dictionaries, a sample entry in which might be:

:Weather:
:	Good:
:		sunshine, dry, warm, pleasant, breezy
:	Bad:
:		blustery, cold, showers, snow, blizzard, rain, sleet, hail

:Thus, when our NPC is fed the sentence 'What do you think about the
:weather? All this snow makes me miserable, how about you?', it dismantles
:it into components:

:what, do, you, think, about, the, weather (question)
:all, this, snow, makes, me, miserable
:how, about, you (question)

Mind if I try these myself?

What do you think about the weather? All this snow makes me miserable, how
about you?

I don't have the "what do you think about X?" in my phrase database, sadly.
Maybe I'll add it. Without it... I have [nature query] [action query]
[subject] [verb] [relation] [object] - which parses to "What is the nature 
of the query about the action thinking with respect to the weather?" This
obviously needs some work. Perhaps if I shift the weight on "what"... Put
in conjunction... unfortunately, though my parser is great with verb-led
commands, it has a hard time outside of that, even with the newish 
extensions. Let's see... It would be able to parse the first half of the
second line... except, perhaps, for the "all this" part. Let me see... no,
the design does allow for a correct parse of "all this"... but unless there
was snow on the ground, it would become confused indeed. In fact, from
memory, I think an AI hooked up similarly to the imput interpreter's query
would respond "All what snow?" Which kind of fits... "How about you?" is
taken correctly, mainly because I wanted to be able to handle "Are you 
hurt?" "No. How about you?"... The context is even taken correctly, I think.
Of course, there is nothing in place to determine whether an AI is miserable
due to the snow... *sigh*

:giving it three statements to deal with. Next we need to remove words
:which are of no value to us (for instance 'and', 'the', 'a' and so forth),
:leaving us with (writing from the NPCs point of view):

There is value to some of those words. Make sure you at least keep them in
a referenceable form...

:1. (directed at me) think about weather (question)
:2. (directed at &lt;player&gt;) snow miserable (statement)
:3. (directed at me) about (question)

:This incidentally shows up one flaw in the system - simple statement
:portions (such as #3 above), are mangled very badly and may no longer be
:useful. Anyway, to continue.

Hmm. I have a lot of words cross referenced to sets...

:The NPC takes each statement, determines the topic of discussion, the
:tone, and any subtopics:

:1. Weather, neutral tone (question), give opinion

Um. Is this universal? Ask an NPC about how their wife is in bed, and they
don't crack you over the head (or alternatively describe in detail (I see
a slew of censored marks coming out of said NPC's mouth) how much better
his wife is than yours...) Mind you, I don't do this either... I've put a
lot of thought into making certain NPCs handled by "headless clients", and
the rest essentially either nonsapient or justified in their stupidity/
inability to communicate (aliens with no language that a PC can ever learn,
Mechanicals, hive minds that use a communication method beyond your ability
to tap into...) ... this is especially attractive because the set of tables
that allow a client to handle input from a player and generate output almost
handle generation of believable conversation. In other words, most _human_
and _humanish_ (meaning close enough to be played by a human player, like
the various available PC species... and I do intend to allow PCs on both
sides of the war eventually) NPCs will be handled by a set of local
stripped-down clients with sleeper codes to keep them from overstimulating
the landscape when not needed, and tasked with fooling players into
thinking that they are just particularly RP-fanatic PCs filling certain
roles... I think I can do it, too, especially if admins animate these people
on a regular basis to throw off predictability, doubly so if I keep behavior
learning feedback on when the admin has usurped control.

:For #2, snow is listed under 'weather: bad:' above thus, and 'miserable'
:might appear in a general dictionary of 'overall negative words' thusly:

:2. Weather, bad tone (statement), none

:3. Indeterminate, neutral (question), give opinion

:The precense of 'about' in #1 and #3 as well as 'think' in #1 allow the
:NPC to know that it is being asked a question (along with the rather
:obvious hint the ? symbol provides), and it is able to determine that it
:should give 'its opinion' (definition or determination of this is not
:important yet). #2 is more straight forward and provides it with more
:information about the situation it is in.

The problem is trying to analyze a statement that is far too vague... now,
when you have the statement preprocessed for meaning (not sentance by
sentance, but the whole lot) and given to the NPC for a response, you lose
the keyword capacity, but gain a much wider base to create an illusion of
original thought. That part is good. But doing it sentance by sentance is
a good way to lose context... my method incurs a potential for
misinterpretation of the whole statement, but it does so in an internally
consistant manner. You won't get the impression that word X threw off the
AI, you would have that sort of (realistic) situation where you were saying
X, and they were hearing Y, and everything you said was taken wrong.

:If it groups this information, it has two clear groups:

:1. Respond about weather (neutral tone). &lt;Player&gt; sees the weather as bad.

:2. Respond (neutral tone).

:Since #2 has no subject, but the NPC knows it is attacked to &lt;player&gt;'s
:statement about the weather, it can determine that the player really
:wants:

:Respond about weather (neutral tone). &lt;Player&gt; sees the weather as bad,
:respond (neutral tone).

:This gives it two responses to make about the weather, which it can
:simplify to:

:&lt;player&gt; sees the weather as bad, respond (neutral tone).

:Since the player applies a negative tone, the NPC can add in the
:assumption that the weather really is bad:

:The weather is bad. What do I think?

:Which leaves us with the big question. How does the NPC respond?

Again, why make the stimulus-response absolute? If the NPC doesn't grok the
PC's conversation (or if it finds it uninteresting) blowing the PC off is a
good enough response.

    The watchmaker glares at you. "What are you blathering about? Are you
    going to buy a watch, or aren't you? I haven't time for a discussion
    about the weather."

This is, as I see it, a perfectly reasonable response to a topic that had
no meaning to this particular PC. The topic parsed, but didn't actually have
an effect, so it was tossed back as a "go away" message.

:One way is by having an indexed set of responses (so multiple responses
:for each tone, within the weather, some generic, some specific, and so
:forth). Another is of course to be far more sophisticated and go for the
:fully dynamic build. Given that the information the NPC has is 'weather,
:bad', can it really build a sentence from a bank of words?

:This wordbank would have to be very sophisticated, giving linkages between
:words and topics, and so forth - this begins to cause us problems in terms
:of the base data required. However, if our miracle NPC knows we are
:discussing bad weather (or assumes - either is sufficient for now), it can
:tie together a very simple 'test' sentence, and simply reply:

:"I think the weather is bad."

:That isn't terribly impressive given all this effort, is it?

:Mind you, if you begin to construct a suitable databank, and include
:methods for the NPC to teach itself, who knows what one could achieve? By
:implying that it might teach itself, I really mean creating a very
:sophisticated parrot like entity.

:"NPC, this snow is horrible, it sucks!"

:and later, we receive

:NPC: "I think the weather sucks.", because it is able to make the
:following connections:

:snow -&gt; sucks
:horrible -&gt; sucks

:There are still a thousand and one problems which I have deliberately not
:described (I wanted to put across the system outline in a basic fashion,
:plus I'm very tired). The obvious problems are actually amongst the hard
:ones to solve, and I await your blowtorches. :)

The problem with parrots is, they sound like their owners. I'd much rather
NPCs learn from a team of admins that control them than from the unwashed
player-base... Just my 2 copper shillings
-- 

Nathan F. Yospe - Aimed High, Crashed Hard, In the Hanger, Back Flying Soon
Jr Software Engineer, Textron Systems Division (On loan to Rocketdyne Tech)
(Temporarily on Hold) Student, University of Hawaii at Manoa, Physics Dept.
yospe#hawaii.edu nyospe#premier.mhpcc.af.mil <A  HREF="http://www2.hawaii.edu/~yospe/">http://www2.hawaii.edu/~yospe/</A>




</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00892" HREF="msg00892.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>
<ul compact><li><em>From:</em> Matt Chatterley &lt;matt#mpc,dyn.ml.org&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00804" HREF="msg00804.html">Parlez vous NPC?</A></STRONG>
<UL><LI><EM>From:</EM> Matt Chatterley &lt;matt#mpc,dyn.ml.org&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00868.html">Re: [MUD-Dev] Jukebox</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00870.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00807.html">Re: [MUD-Dev]  Parlez vous NPC?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00892.html">Re: [MUD-Dev]  Parlez vous NPC?</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00869"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00869"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Dynamic Loading of Modules</STRONG>, <EM>(continued)</EM>
<ul compact>
<LI><strong><A NAME="00825" HREF="msg00825.html">Re: [MUD-Dev] Dynamic Loading of Modules</A></strong>, 
Jon A. Lambert <a href="mailto:jlsysinc#ix,netcom.com">jlsysinc#ix,netcom.com</a>, Sun 22 Mar 1998, 19:31 GMT
</LI>
</ul>
</LI>
<LI><strong><A NAME="00804" HREF="msg00804.html">Parlez vous NPC?</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Sat 21 Mar 1998, 02:49 GMT
<UL>
<LI><strong><A NAME="00805" HREF="msg00805.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>, 
Vadim Tkachenko <a href="mailto:vt#freehold,crocodile.org">vt#freehold,crocodile.org</a>, Sat 21 Mar 1998, 04:26 GMT
<UL>
<LI><strong><A NAME="00807" HREF="msg00807.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Sat 21 Mar 1998, 13:12 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00869" HREF="msg00869.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Tue 24 Mar 1998, 03:39 GMT
<UL>
<LI><strong><A NAME="00892" HREF="msg00892.html">Re: [MUD-Dev]  Parlez vous NPC?</A></strong>, 
Matt Chatterley <a href="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</a>, Wed 25 Mar 1998, 08:37 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
<LI><strong><A NAME="00801" HREF="msg00801.html">Re: [MUD-Dev]	3D engines for MUDs</A></strong>, 
Chris Gray <a href="mailto:cg#ami-cg,GraySage.Edmonton.AB.CA">cg#ami-cg,GraySage.Edmonton.AB.CA</a>, Sat 21 Mar 1998, 02:29 GMT
<UL>
<LI><strong><A NAME="00851" HREF="msg00851.html">3D engines for MUDs</A></strong>, 
Niklas Elmqvist <a href="mailto:d97elm#dtek,chalmers.se">d97elm#dtek,chalmers.se</a>, Mon 23 Mar 1998, 19:17 GMT
</LI>
<LI><strong><A NAME="00861" HREF="msg00861.html">Re: [MUD-Dev] 3D engines for MUDs</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Mon 23 Mar 1998, 20:52 GMT
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>