[MUD-Dev] Legend's speech system and moods

Koster Koster
Wed Sep 23 11:31:50 CEST 1998


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:

  > ? ' are you OK?

or 

  > 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.

  > ? ' are you OK?
  Raph says inquisitively, 'Are you OK?'

  > 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.

  > 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.

  > 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




More information about the mud-dev-archive mailing list