1998Q3/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] Legend's speech system and moods -->
<!--X-From-R13: "Ybfgre, Dncu" <exbfgreNbevtva.rn.pbz> -->
<!--X-Date: Wed, 23 Sep 1998 09:34:33 &#45;0700 -->
<!--X-Message-Id: 11A17AA2B9EAD111BCEA00A0C9B41793EDBDA4#forest,origin.ea.com -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] Legend's speech system and moods</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:rkoster#origin,ea.com">
</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="msg01140.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01142.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg01168.html">Previous</a>
&nbsp;|&nbsp;<a href="msg01139.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#01141">Author</A>
&nbsp;|&nbsp;<A HREF="#01141">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#01141">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] Legend's speech system and moods</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: "'<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>'" &lt;<A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A>&gt;</LI>
<LI><em>Subject</em>: [MUD-Dev] Legend's speech system and moods</LI>
<LI><em>From</em>: "Koster, Raph" &lt;<A HREF="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</A>&gt;</LI>
<LI><em>Date</em>: Wed, 23 Sep 1998 11:31:50 -0500</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
OK, I promptly got a request to go into more detail, so here it is.

First off, this system (like all of Legend's systems) was designed to be
layered on top of a Diku. I have real affection for Diku-style muds,
which I call "template-based" muds. They are easy to maintain and easy
to expand, they're just not very dynamic. But the basic premise can
easily be applied to any code base.

First, we added a "mood" stored on characters. And we added a global
table of moods that looks something like this:

moods.h:
const struct mood_index mood_table [] = {
{    "normal",
       "",
       "",
       "",
       "",
       ""
}, {  "?",
       " inquisitively",
       " quizzically",
       " inquiringly",
       "$n enters from %s%s with a questioning look on $s face.",
       "$n walks off %s, clearly full of questions."
}, {  "abashed",
       ", abashed",
       " abashedly",
       ", somewhat abashed",
       "$n enters from %s%s, hoping no one will notice.",
       "$n hurries off %s, trying to avoid criticism."
}, { "absentminded",
       " absentmindedly",
       ", not really paying attention",
       " absentmindedly",
       "$n enters from %s%s, staring vaguely about.",
       "$n hurries off %s, scratching $s head in befuddlement."
}, { "aghast",
       ", aghast",
       " horrified",
       ", absolutely shocked",
       "$n enters from %s%s, $s face a mask of horrified surprise.",
       "$n rushes off %s, scandalized."
}, etc...

The first word is the mood's name; the other strings are used for
"coloring" text with the mood.

When we parse input, the first thing we check for, in advance of
anything else, is whether the first keyword is a mood defined in the
table. (Legend does not have a fancy parser, btw). If it is, we set the
mood on the player to be the mood we found.

eg:

  &gt; ? ' are you OK?

or 

  &gt; aghast ' That's awful

When something is spoken, we then take one of the first three strings
and simply insert it after the word "says."

  SoNSo says [mood], 'string'

Based on an option you can toggle, player can specify whether they want
moods to be "sticky" or not--if not, then the mood is reset to none
after it is used once. If it is sticky, then that mood remains on all
your speech until you change it.

  &gt; ? ' are you OK?
  Raph says inquisitively, 'Are you OK?'

  &gt; aghast ' that's awful!
  Raph says, absolutely shocked, 'That's awful.'

Now, you'll note that the text above has been cleaned up a little before
it got spat out. That's because we also scan through the spoken text. If
there is no punctuation at the end, we put a period there. If there is
intermediate punctuation (period excluding one on a known abbreviation,
question mark, exclamation point, ellipses) we know there is more than
one sentence. In which case there is a random chance that we stick the
whole "SoNSosays [mood]" bit in the middle.

  &gt; aghast ' that's awful. if that happened to me, I'd be really pissed
  'That's awful,' Raph says, absolutely shocked. 'If that happened to
me, I'd be really pissed.'

Otherwise, that stuff gets randomly placed at either the beginning
(classic mud practice) or at the end.

  &gt; abs ' damn, I forgot to call home
  'Damn, I forgot to call home,' Raph says, not really paying attention.

If you turn moods off, you will never see any of the above slicing and
dicing.

You can guess yourself exactly how we added it to entrances and exits,
which has proved to be very popular...

Why did I write this? Well, I read a lot. And when you read fiction,
speeches aren't presented like a radio play, they're presented in
semi-decent prose. And roleplayers tend to be readers. So if this helps
the fictional immersion, then it can help roleplayers.

Appended after my signature is a list of the moods supported by Legend
(we add new ones often).

-Raph

The following are moods available to you.
normal       ?            abashed      absentminded aghast
agonized
agreement    amazed       amused       angry        angstful     annoyed
approving    ashamed      bewildered   bitter       bloodthirsty bored
brave        callous      careful      careless     casual
childish
clinical     cocky        cold
compassionatecondescendingconfident
confused     content      courtly      coy          crude        cruel
curious      cynical      dazed        defensive    depressed    devious
dimwitted    disagreement disappointed discreet     disgruntled
disgusted
dismayed     distracted   doubtful     dramatic     dreamy       drunk
earnest      ecstatic     embarrassed  emphatic     encouraging
enthusiastic
evil         exasperated  exuberant    fanatical    foolish
forgiving
guilty       greedy       happy        harsh        helpful      honest
hopeful      hopeless     humble       hungry       hurt
hysterical
indifferent  impatient    imploring    impressed    incredulous
indignant
innocent     insane       interested   jealous      joyful       kind
knowing      lazy         lofty        lonely       loud         loving
lustful      mean         meek         melancholy   mischievous  musical
mysterious   mystified    nervous      neutral      offended
optimistic
pained       patient      pedantic     pensive      pessimistic
petulant
philosophicalpitiful      pitying      playful      polite       pompous
pouting      precocious   proud        provocative  protective   puzzled
quick        quiet        rebellious   regretful    relieved
reluctant
resigned     respectful   romantic     rude         sad
sarcastic
scared       scolding     scornful     secretive    seductive    serious
shameless    shocked      shy          sincere      sleepy       slow
sly          smug         snobby       soft         sorry
spiteful
stupid       stubborn     subject      subtle       sullen
surprised
suspicious   sweet        taunting     teasing      terrified
thankful
thoughtful   timid        tired        tolerant     uncertain
understanding
unhappy      unwilling    victorious   warm         whiny        wicked
wise         wistful      worried


</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg01140.html">[MUD-Dev] Re: Ugh, IS Diablo a mud?</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg01142.html">[MUD-Dev] Re: Legend's speech system and moods</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg01168.html">[MUD-Dev] Re: Legend's speech system and moods</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg01139.html">[MUD-Dev] Re: let's call it a spellcraft</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#01141"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#01141"><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="01184" HREF="msg01184.html">[MUD-Dev] META: Web posting from list archives</A></strong>, 
J C Lawrence <a href="mailto:claw#under,engr.sgi.com">claw#under,engr.sgi.com</a>, Thu 24 Sep 1998, 06:02 GMT
<LI><strong><A NAME="01150" HREF="msg01150.html">[MUD-Dev] MUD-Dev] META: What are you looking for in this list?</A></strong>, 
Scatter <a href="mailto:scatter#thevortex,com">scatter#thevortex,com</a>, Wed 23 Sep 1998, 19:53 GMT
<LI><strong><A NAME="01142" HREF="msg01142.html">[MUD-Dev] Re: Legend's speech system and moods</A></strong>, 
Raph &amp; Kristen Koster <a href="mailto:koster#eden,com">koster#eden,com</a>, Wed 23 Sep 1998, 17:20 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="01168" HREF="msg01168.html">[MUD-Dev] Re: Legend's speech system and moods</A></strong>, 
quzah [sotfhome] <a href="mailto:quzah#softhome,net">quzah#softhome,net</a>, Wed 23 Sep 1998, 23:45 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="01141" HREF="msg01141.html">[MUD-Dev] Legend's speech system and moods</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Wed 23 Sep 1998, 16:34 GMT
<LI><strong><A NAME="01139" HREF="msg01139.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Wed 23 Sep 1998, 15:46 GMT
<UL>
<LI><strong><A NAME="01151" HREF="msg01151.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Adam J. Thornton <a href="mailto:adam#phoenix,Princeton.EDU">adam#phoenix,Princeton.EDU</a>, Wed 23 Sep 1998, 20:03 GMT
</LI>
</UL>
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="01153" HREF="msg01153.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
S. Patrick Gallaty <a href="mailto:choke#sirius,com">choke#sirius,com</a>, Wed 23 Sep 1998, 20:29 GMT
</LI>
<LI><strong><A NAME="01160" HREF="msg01160.html">[MUD-Dev] Re: let's call it a spellcraft</A></strong>, 
Koster, Raph <a href="mailto:rkoster#origin,ea.com">rkoster#origin,ea.com</a>, Wed 23 Sep 1998, 21:44 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>