1998Q1/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: Re: [MUD&#45;Dev]  Parlez vous NPC? -->
<!--X-From-R13: [ngg Qunggreyrl <znggNzcp.qla.zy.bet> -->
<!--X-Date: Wed, 25 Mar 1998 08:37:44 +0000 -->
<!--X-Message-Id: Pine.LNX.3.96.980325081749.440G&#45;100000#mpc,dyn.ml.org -->
<!--X-Content-Type: text/plain -->
<!--X-Reference: Pine.GSO.3.95q.980320171810.25232A&#45;100000@uhunix1 -->
<!--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:matt#mpc,dyn.ml.org">
</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="msg00891.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00893.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00869.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00801.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00892">Author</A>
&nbsp;|&nbsp;<A HREF="#00892">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00892">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>: Matt Chatterley &lt;<A HREF="mailto:matt#mpc,dyn.ml.org">matt#mpc,dyn.ml.org</A>&gt;</LI>
<LI><em>Date</em>: Wed, 25 Mar 1998 08:37:21 +0000 (GMT)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:neddy#itl,net">neddy#itl,net</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
On Mon, 23 Mar 1998, Nathan F Yospe wrote:
&gt; On Fri, 20 Mar 1998, Matt Chatterley wrote:
&gt; 
&gt; :Richard Woolcock asked me to make a post about something I mentioned as an
&gt; :offhand comment while dissecting one of the more annoying advertisements
&gt; :posted to rec.games.mud.admin in some time.
&gt; 
&gt; :I made an allusion to NPCs capable of conducting semi-coherent
&gt; :conversations with players, without following predefined patterns, and not
&gt; :using strictly pre-set responses, but rather, creating their own replies.
&gt; 
&gt; Hmm. Interesting. I suppose this would be a good time to point out that, as
&gt; the guy that loves his language handling AIs, this makes me blanche. Either
&gt; you're going to end up spending many cycles on it, or you're going to have
&gt; a pretty lame AI. But... I like a good challenge, so let me at it.

Ner. I don't mind spending a fair amount of power on handling this, but of
course, refining it to require less would be favourite. It's proof that I
need to do more reading on language processing, really, but I just haven't
got time until mid-May. :)
 
&gt; :Sadly the system I have in practise is neither as advanced as this, nor
&gt; :functional (I improved it, thus, it doesn't work now), but, this is the
&gt; :design model to which I am working, and with the exception of the last
&gt; :point, the system worked. An overview:
&gt; 
&gt; :The NPC receives a sentence from the player. The method of delivery is
&gt; :arbitary (I used directed speech, aka: 'say NPC, this is a sentence for
&gt; :you.' but this could equally be done with a separate command).
&gt; 
&gt; Just a note: I'd have to handle this clientside... meaning (and I already do
&gt; try to do this with spoken text before exporting it) I would be having the 
&gt; client tokenize all text and send the tokenized form to the server... but I
&gt; do send the complete text to all affected clients as well. I'm working on a
&gt; method to avoid involving the server in the transfer now. In any case... the
&gt; stuff I do is for input only, I haven't tried to stretch my local descriptor
&gt; program to the point that it could pose as an entity...

Interesting. This helps solve some of the problems by the way; if the
client could perform basic parsing (break the text down into the
components that we want to use), it removes most of the initial work from
the server.
 
&gt; :The NPC takes this sentence, and performs some basic tests on it,
&gt; :determining the subject matter, sub-topics, and the overall tone of the
&gt; :statement. This is the hard part. One simple way to go about it is by the
&gt; :use of topic and context dictionaries, a sample entry in which might be:
&gt; 
&gt; :Weather:
&gt; :	Good:
&gt; :		sunshine, dry, warm, pleasant, breezy
&gt; :	Bad:
&gt; :		blustery, cold, showers, snow, blizzard, rain, sleet, hail
&gt; 
&gt; :Thus, when our NPC is fed the sentence 'What do you think about the
&gt; :weather? All this snow makes me miserable, how about you?', it dismantles
&gt; :it into components:
&gt; 
&gt; :what, do, you, think, about, the, weather (question)
&gt; :all, this, snow, makes, me, miserable
&gt; :how, about, you (question)
&gt; 
&gt; Mind if I try these myself?
&gt; 
&gt; What do you think about the weather? All this snow makes me miserable, how
&gt; about you?

I suspect, being you, you're about to point out one of the big problems.
Good! :)
 
[Snip one very confused parser]

&gt; Of course, there is nothing in place to determine whether an AI is miserable
&gt; due to the snow... *sigh*

Assume that it is familiar with basic question structure (this would have
to go in), and takes:

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

breaks this into two lines, removing the words it doesn't care about, and 
then breaks the second at the comma:

what you think about weather?
snow me miserable
how about you?

Then checks for references to itself:

[question to me]: what think about weather
[statement about X]: snow makes me miserable
[question to me]: how about you

It's possible to get this far without confusing it at all (since regular
rules are applied; I'll try to show up a problem in these rules in a
moment by the way). Next, we could have an index of responses by question
type "what..", "how.." and so forth, and also for the second word
("think"). Assume for now this is built in, getting the system to
intelligently add this stuff is next to impossible I think.

[question to me]: what think about weather -&gt;
	"I think" +
	[weather originally prefixed by the] "the weather is" +
	[my opinion on weather] "okay."

It adds in 'okay' because it has no pre-formed opinion - this data would
be collected from conversations it has, or pre-set things (for instance,
we can have defintions of what are bad weather, and adjust NPCs to know
the weather is bad). In the snow example specifically, the NPC can use the
opinions that the player has passed on.

[statement about X]: snow makes me miserable
	[for X]: snow -&gt; miserable, snow is weather
	[miserable is a negative word]: snow -&gt; bad, weather -&gt; bad

[question to me]: how about you
	[question with no subject, retrieve last subject]
	[last subject was weather]
		"I think" +
		[weather originally prefixed by the] "the weather is" +
		[my opinion on weather] "bad."

&gt; :giving it three statements to deal with. Next we need to remove words
&gt; :which are of no value to us (for instance 'and', 'the', 'a' and so forth),
&gt; :leaving us with (writing from the NPCs point of view):
&gt; 
&gt; There is value to some of those words. Make sure you at least keep them in
&gt; a referenceable form...

Yeah. As above, I realised they'd be needed for some things (at a basic
level, referring to something like 'weather' appropriately).
 
&gt; :1. (directed at me) think about weather (question)
&gt; :2. (directed at &lt;player&gt;) snow miserable (statement)
&gt; :3. (directed at me) about (question)
&gt; 
&gt; :This incidentally shows up one flaw in the system - simple statement
&gt; :portions (such as #3 above), are mangled very badly and may no longer be
&gt; :useful. Anyway, to continue.
&gt; 
&gt; Hmm. I have a lot of words cross referenced to sets...

I'm beginning to see that parts of this system will require as much data
as my current implementation, if not more. :)
 
&gt; :The NPC takes each statement, determines the topic of discussion, the
&gt; :tone, and any subtopics:
&gt; 
&gt; :1. Weather, neutral tone (question), give opinion
&gt; 
&gt; Um. Is this universal? Ask an NPC about how their wife is in bed, and they
&gt; don't crack you over the head (or alternatively describe in detail (I see
&gt; a slew of censored marks coming out of said NPC's mouth) how much better
&gt; his wife is than yours...) Mind you, I don't do this either... I've put a
&gt; lot of thought into making certain NPCs handled by "headless clients", and
&gt; the rest essentially either nonsapient or justified in their stupidity/
&gt; inability to communicate (aliens with no language that a PC can ever learn,
&gt; Mechanicals, hive minds that use a communication method beyond your ability
&gt; to tap into...) ... this is especially attractive because the set of tables

Well, we could set subject attitudes by:

Locale -assume this to be the homeplace of the NPC unless otherwise set,
thus determining 'culture', and also from race, gender, age, and then
allow local-level configuration (setting npcs to check a particular file).

This adds up to lots of work to create exceptions to the universal rules,
though.

&gt; that allow a client to handle input from a player and generate output almost
&gt; handle generation of believable conversation. In other words, most _human_
&gt; and _humanish_ (meaning close enough to be played by a human player, like
&gt; the various available PC species... and I do intend to allow PCs on both
&gt; sides of the war eventually) NPCs will be handled by a set of local
&gt; stripped-down clients with sleeper codes to keep them from overstimulating
&gt; the landscape when not needed, and tasked with fooling players into
&gt; thinking that they are just particularly RP-fanatic PCs filling certain
&gt; roles... I think I can do it, too, especially if admins animate these people
&gt; on a regular basis to throw off predictability, doubly so if I keep behavior
&gt; learning feedback on when the admin has usurped control.

Very nice. :)
 
&gt; :For #2, snow is listed under 'weather: bad:' above thus, and 'miserable'
&gt; :might appear in a general dictionary of 'overall negative words' thusly:
&gt; 
&gt; :2. Weather, bad tone (statement), none
&gt; 
&gt; :3. Indeterminate, neutral (question), give opinion
&gt; 
&gt; :The precense of 'about' in #1 and #3 as well as 'think' in #1 allow the
&gt; :NPC to know that it is being asked a question (along with the rather
&gt; :obvious hint the ? symbol provides), and it is able to determine that it
&gt; :should give 'its opinion' (definition or determination of this is not
&gt; :important yet). #2 is more straight forward and provides it with more
&gt; :information about the situation it is in.
&gt; 
&gt; The problem is trying to analyze a statement that is far too vague... now,
&gt; when you have the statement preprocessed for meaning (not sentance by
&gt; sentance, but the whole lot) and given to the NPC for a response, you lose
&gt; the keyword capacity, but gain a much wider base to create an illusion of
&gt; original thought. That part is good. But doing it sentance by sentance is
&gt; a good way to lose context... my method incurs a potential for
&gt; misinterpretation of the whole statement, but it does so in an internally
&gt; consistant manner. You won't get the impression that word X threw off the
&gt; AI, you would have that sort of (realistic) situation where you were saying
&gt; X, and they were hearing Y, and everything you said was taken wrong.

Yeah. I'm not sure how to address this; perhaps sentences can be handled
in context of the paragraph they come from (and sentence fragments from
the sentence that they belong to). Thus all the way thruogh the original
example the NPC would bear 'weather' in mind, and in a 'snow' sentence it
would bear 'snow' in mind, unless a change of context was detected. Mind
you, its hard to define a change of context here (at least in sentence
fragments; it should be used to create a paragraph break in paragraphs?)
 
&gt; :If it groups this information, it has two clear groups:
&gt; 
&gt; :1. Respond about weather (neutral tone). &lt;Player&gt; sees the weather as bad.
&gt; 
&gt; :2. Respond (neutral tone).
&gt; 
&gt; :Since #2 has no subject, but the NPC knows it is attacked to &lt;player&gt;'s
&gt; :statement about the weather, it can determine that the player really
&gt; :wants:
&gt; 
&gt; :Respond about weather (neutral tone). &lt;Player&gt; sees the weather as bad,
&gt; :respond (neutral tone).
&gt; 
&gt; :This gives it two responses to make about the weather, which it can
&gt; :simplify to:
&gt; 
&gt; :&lt;player&gt; sees the weather as bad, respond (neutral tone).
&gt; 
&gt; :Since the player applies a negative tone, the NPC can add in the
&gt; :assumption that the weather really is bad:
&gt; 
&gt; :The weather is bad. What do I think?
&gt; 
&gt; :Which leaves us with the big question. How does the NPC respond?
&gt; 
&gt; Again, why make the stimulus-response absolute? If the NPC doesn't grok the
&gt; PC's conversation (or if it finds it uninteresting) blowing the PC off is a
&gt; good enough response.
&gt; 
&gt;     The watchmaker glares at you. "What are you blathering about? Are you
&gt;     going to buy a watch, or aren't you? I haven't time for a discussion
&gt;     about the weather."
&gt; 
&gt; This is, as I see it, a perfectly reasonable response to a topic that had
&gt; no meaning to this particular PC. The topic parsed, but didn't actually have
&gt; an effect, so it was tossed back as a "go away" message.

This is what I was alluding to, really. NPCs can shrug, they can smile at
you as if you were an idiot, tell you to get the heck out of it, try to
sell things, or redirect you rather forcefully ("Why do you waste my time
so? Leave now lest I be angered!" or "What on earth are you on about? Do
you want to know where the dragon is or not?")

[Snip]

-- 
Regards,
	-Matt Chatterley
Spod: <A  HREF="http://user.super.net.uk/~neddy/spod/spod.html">http://user.super.net.uk/~neddy/spod/spod.html</A>



</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<UL><LI><STRONG>References</STRONG>:
<UL>
<LI><STRONG><A NAME="00869" HREF="msg00869.html">Re: [MUD-Dev]  Parlez vous NPC?</A></STRONG>
<UL><LI><EM>From:</EM> Nathan F Yospe &lt;yospe#hawaii,edu&gt;</LI></UL></LI>
</UL></LI></UL>
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00891.html">Re: [MUD-Dev] World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00893.html">Re: [MUD-Dev]  World Persistence, flat files v/s DB v/s ??</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00869.html">Re: [MUD-Dev]  Parlez vous NPC?</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00801.html">Re: [MUD-Dev]	3D engines for MUDs</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00892"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00892"><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><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
<UL>
<LI><strong><A NAME="00873" HREF="msg00873.html">Re: [MUD-Dev] 3D engines for MUDs</A></strong>, 
Ling <a href="mailto:K.L.Lo-94#student,lboro.ac.uk">K.L.Lo-94#student,lboro.ac.uk</a>, Tue 24 Mar 1998, 14:58 GMT
</LI>
</UL>
</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>