Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Procedurally Generated Dialogue

794 views
Skip to first unread message

Drakalor Tourist

unread,
Jun 25, 2011, 12:02:18 PM6/25/11
to
Well, I haven't really seen this topic get much discussion, which is a
shame, so I thought I'd toss my design for procedurally generated
dialogue out there. Based on my design goals for my project,
implementing this is highly desirable, due to: increased immersion,
more natural quests/plots/whatever, and making non-combative skills
more meaningful.

While truly random dialogue is nearly impossible for all practical
purposes, a pseudo-random dialogue generator is definitely feasible,
and like with any procedurally generated system, it significantly
amplifies the work you put into it with a greatly increased amount of
content.

My general idea is to make use of a Markov chain, processing grammars
and rules. In essence, it's the same type of system commonly used for
random name generators, but instead applied to pieces of dialogue.

Basically, for every subject that can be talked about, you'd want to
create a dialogue file that is unique to the topic. This dialogue
file would then be composed of a large amount of sentence fragments,
as well as a collection of rules for assembling the fragments into
complete sentences. As always, the amount of fragments and rules you
create will directly correspond to an increased amount of possible
dialogue to be generated.

Ideally, you'd want to create enough variations so that pieces of
dialogue that are repeated word for word becomes minimal, since to me,
that is an instant immersion breaker. The worst is when two different
characters say exactly the same thing. A further refinement to the
system can help with this.

By also adding a series of one or more tags to each fragment and rule,
you can gain some rather interesting functionality. Example tags
could be "rude", "simple", "lofty", "practical", etc. Basically, the
number of tags you create is only limited by your imagination and the
scope of your game. By applying this to the system, you can actually
express the individual character's personalities to a far greater
extent, while further eliminating repetition. A simple farmer is
unlikely to say the same thing about a given subject as a scholar.

This would obviously require that each character has a set of
appropriate dialogue tags, which determines how their dialogue is
generated. Adding weighted preferences for certain tags would allow
for more variety, than using a simple boolean that is responsible for
dictating tag preferences. Using this, you could even simulate
emotional responses and changes, by allowing the character's emotional
state to alter the weighted preferences for sets of tags. For
example, a farmer may tend to be friendly and polite, and speak
accordingly, although when angered or distressed he may be more likely
to speak rudely.

The actual implementation of this system is actually fairly easy,
although adding content to the system is, as always, the bulk of the
work. And I won't lie, adding a sufficient number of sentence
fragments and rules for a given subject is a time consuming task, but
I think the payoff makes it well worth it.

A further refinement that could be added to the system would be to
assign sets of fragments and rules a unique knowledge ID. This would
prevent a character from speaking about a subject they know nothing
about. Again, weighted preferences for speaking about a particular
subtopic (represented by knowledge IDs), will result in greater
expressiveness of the characters. For example, when discussing a
recent battle, a merchant is more likely to discuss the economic
effects, whereas a soldier might discuss the particulars of the
battle, such as strategies employed, death count, or even telling
tales of his role in the battle.

I think this system would be well suited to a keyword-based dialogue
system, where the player can type in a topic or subtopic when
conversing with a character. This does lead to the problem of
providing enough synonyms for each topic or subtopic, to avoid forcing
the player to play "hunt the verb/noun", but that's a separate
problem.

Overall, I don't see any flaws in the above ideas, and it seems like
it would go a long way to making dialogue in the game interesting and
believable. It would increase the workload on the developer when
creating dialogue files for the various subjects, but that's to be
expected, and an obvious price to pay for adding immersion and
complexity to the game world. In the end, for any game that aims to
be dialogue heavy, I see this system as being far more preferable than
simply writing an excessive amount of static lines of dialogue, which
will inevitably be repeated word for word throughout the game.

Even though, statistically, dialogue that is procedurally generated
will eventually get repeated word for word, the player is unlikely to
notice due to the huge number of variations. One way to minimize this
would be to mark exact sequences of fragments and rules as being
recently used once spoken, and to force the generator to create a
different sequence until a set amount of time has passed.

Another refinement to the system would be to allow fragments to
contain variable strings, so that dialogue can be more directly
tailored to the particulars of the game world. For example, let's say
we've presented the player with a murder mystery to solve. The
characters involved may be randomly generated each game. So, we can
allow the murder mystery dialogue file to "fill in the blanks" for the
various sentence fragments with the particulars, such as the names of
the characters involved, or even the details of the murder (was the
victim stabbed, poisoned, etc?).

Well, I should probably wrap up this incredibly long-winded post. I
definitely look forward to discussing this issue, as I'm sure that the
bright minds that make up this community will undoubtedly think of
some things that I didn't. Now, if only I could come up with a good
random plot generator to go with this, I'd be in business :)

Krice

unread,
Jun 25, 2011, 1:51:30 PM6/25/11
to
On 25 kesä, 19:02, Drakalor Tourist <drakalor.tour...@gmail.com>
wrote:

> Well, I haven't really seen this topic get much discussion, which is a
> shame

It's been a topic from time to time, but I think no one has
implemented it. Dialogue and more widely AI seems to be a hard
task after all, so creating procedural dialogue system is
not in the top of the list. It's interesting of course and would
be a perfect match for procedurally generated world content.
The great thing about more intelligent conversation would be
interaction with other creatures. Then it would actually matter.

Drakalor Tourist

unread,
Jun 25, 2011, 2:01:42 PM6/25/11
to

Yeah, it definitely poses another challenge for the developer, and for
any game where dialogue is not important, is complete overkill. I
definitely like the idea of making NPC interaction more fun and
interesting, which is why I started pondering over this issue in the
first place.

paul-d...@sbcglobal.net

unread,
Jun 25, 2011, 3:01:04 PM6/25/11
to
Drakalor Tourist <drakalor...@gmail.com> writes:

> Well, I haven't really seen this topic get much discussion, which is a
> shame, so I thought I'd toss my design for procedurally generated
> dialogue out there. Based on my design goals for my project,
> implementing this is highly desirable, due to: increased immersion,
> more natural quests/plots/whatever, and making non-combative skills
> more meaningful.
>

> ...


>
> I think this system would be well suited to a keyword-based dialogue
> system, where the player can type in a topic or subtopic when
> conversing with a character. This does lead to the problem of
> providing enough synonyms for each topic or subtopic, to avoid forcing
> the player to play "hunt the verb/noun", but that's a separate
> problem.
>

> ...


>
> Well, I should probably wrap up this incredibly long-winded post. I
> definitely look forward to discussing this issue, as I'm sure that the
> bright minds that make up this community will undoubtedly think of
> some things that I didn't. Now, if only I could come up with a good
> random plot generator to go with this, I'd be in business :)

That's pretty insane. In a good way. I'm interested in seeing how it
works out. The difficulty with dialogue is that suddenly the player has
to step out of the engaging, dynamic game world and... perform a tree
traversal. Keyword guessing is more like iterating over a set of likely
topics. I think that's a little better, but it still can't hold a candle
to the bulk of your gameplay if your gameplay is any good. I guess what
I'm getting at is that IMO, even if your system is good, it could easily
suck compared to whatever else the player could be doing.

If I were making a dialog system, before I even worried about content,
I'd think about how I was going to make dialog a dynamic part of the
world.

On the verbal end, giving a set of taboo topics to each NPC could be a
good start, transforming the activity from an iteration over possible
topics to a social reasoning task. Players would need to pick topics
carefully according to their interlocutor, and feel them out on a given
topic before charging in or risk losing their conversational
partner/starting a fight. Some taboos could be easily learned (never ask
race X about thing Y), and others could be easy to guess (don't go
asking guards about secret entrances to the palace). Others would be
personal and need to be discovered in conversation.

Increasing the player's conversational affordances is another thing you
could do. Rather than just "topic", you could offer "ask about" and
"tell about". "Praise X" and "badmouth X" are other good choices and
would go well with taboos. You could parse them out of the ask/tell
string (tell about: "goblins bad" vs. tell about: "goblins good") if you
wanted.

Depending on how hard you want to parse, question/statement could be
parsed too ("goblins" vs. "goblins?"), but in a roguelike the high-level
approach is more fitting. In combat you have buttons to attack, shoot,
throw something, cast a spell. In dialogue you might have buttons to
ask, tell, make excuse, some of which might not require user input. Any
of these can be modified by stats. Wisdom could increase question yield,
high charisma better results from telling (with an additional bonus from
intelligence when informing a scholar about a topic of interest)... and
high combat stats decrease the chances of people taking offense?

On a nonverbal level, character behavior could influence NPC
responses. If you drop the dreaded dialogue window and make conversation
an in-world thing, you immediately get the ability to do some neat you
couldn't do otherwise. For example, NPCs intent on speaking to you can
now approach you and even follow you a bit to do so.* Imagine beggars or
vendors on the one hand, or police on the other. Walking away from an
NPC during conversation could be rude or dangerous. Bringing the
conversation into the world introduces all these positional options,
including the possibility of unwanted conversation and avoiding it, a
huge difference from most games, in which the player either gets sucked
into a dialogue screen against their will, or must initiate all
conversation.

You can go further: Running around jumping on tables when someone is in
mid-sentence should have a negative effect on the
conversation. Shuffling through your inventory should be mildly
negative. Pulling a weapon could be bad or good depending on the
situation. If sentences span multiple turns, timing your
questions/statements and such to not interrupt a sentence would improve
a conversation.

I may have gone far afield, but procedural dialogue is a great
opportunity to avoid some of the problems dialogue systems have, because
when the dialog isn't manually authored the paths through a conversation
increase and the cost of unused paths decreases. It's totally ok if a
conversation is aborted early by either participant. And with less
knowledge-related content to be worked through, the space for more
rewarding behavioral gameplay opens up.

It probably sounds like I'm trying to suggest you do even more work, and
in a sense I am. I think that for there to be any point in a dialogue
system, it needs to be a dynamic part of the game. Otherwise, just
System Shock it**. In your game, that would probably mean procedural
barks, which I think would be a really great thing in any case. A
non-dynamic dialog system just turns conversation into a chore. But I'm
not suggesting an deeper language model, or knowledge model, or anything
else difficult from an AI perspective. More involved interpersonal
gameplay is my suggestion.

Whew. I expected this to be a two-sentence post. I hope some of it is
useful to you. tl;dr Make sure the conversational process is rewarding
gameplay, otherwise please skip it entirely and just do barks and a
"tell me more" button. There are enough games dragging themselves
through the dialogue tarpit.

P. S. If you're having trouble not generating sentences that make your
NPCs sound like morons, try making up a dialect with alternate grammar
to mask the problem. Plenty of slang may help as well.

* Of course they could follow you and bark at you anyway, but if you're
not "in dialog" at the time then your reaction could have no bearing
on any ensuing conversation, unless you for some reason implemented an
out-of-dialog behavioral tracking system on top of whatever you've got
within the dialog system.

** For System Shock they chose not to include a dialogue system, after
their experience with Ultima Underworld. Instead, they introduced the
audio log style of story telling. In UU, they had a dynamic, physics,
based world that was a lot of fun to play around in... and it ground
to a halt every time the dialogue screen came up. I think it was a
good call. There's a reason I've finished System Shock several times
and UU zero times.

Drakalor Tourist

unread,
Jun 25, 2011, 4:04:08 PM6/25/11
to
On Jun 25, 2:01 pm, paul-donne...@sbcglobal.net wrote:
> That's pretty insane. In a good way. I'm interested in seeing how it
> works out. The difficulty with dialogue is that suddenly the player has
> to step out of the engaging, dynamic game world and... perform a tree
> traversal. Keyword guessing is more like iterating over a set of likely
> topics. I think that's a little better, but it still can't hold a candle
> to the bulk of your gameplay if your gameplay is any good. I guess what
> I'm getting at is that IMO, even if your system is good, it could easily
> suck compared to whatever else the player could be doing.

Yeah, that's a pretty natural conclusion to reach. When implementing
any new system, the game needs to be designed in such a way as to
actually make the system an integral and fun part of the gameplay,
otherwise it's just a tech toy. My project aims to be more of a
roguelike/RPG hybrid, with the rather lofty goal of creating as close
to a pure roleplaying experience as possible. One aspect of this is
my focus on providing non-combative ways to play the game (indeed, as
of now, the game lacks an end goal, instead being a more sandbox
oriented roleplaying experience). The social aspect offered by a
dialogue system is one approach that seems worth exploring.

> If I were making a dialog system, before I even worried about content,
> I'd think about how I was going to make dialog a dynamic part of the
> world.
>
> On the verbal end, giving a set of taboo topics to each NPC could be a
> good start, transforming the activity from an iteration over possible
> topics to a social reasoning task. Players would need to pick topics
> carefully according to their interlocutor, and feel them out on a given
> topic before charging in or risk losing their conversational
> partner/starting a fight. Some taboos could be easily learned (never ask
> race X about thing Y), and others could be easy to guess (don't go
> asking guards about secret entrances to the palace). Others would be
> personal and need to be discovered in conversation.

Good idea. Maybe by implementing a sliding scale value ranging from
extremely negative to extremely positive, in the context of every
possible conversation topic, the player would have to think deeper
about their choices. This would change conversations from merely
being sources of information to a whole new means of interaction, with
significant impact socially. Talking flippantly to a merchant about
his recently deceased wife might cause him to never engage in trade
with the player again.

> Increasing the player's conversational affordances is another thing you
> could do. Rather than just "topic", you could offer "ask about" and
> "tell about". "Praise X" and "badmouth X" are other good choices and
> would go well with taboos. You could parse them out of the ask/tell
> string (tell about: "goblins bad" vs. tell about: "goblins good") if you
> wanted.

Definitely something to consider. And by allowing the player to "tell
about" a topic, it could result in a natural spread of information.
Informing the head of the merchant's guild about a recently discovered
deposit of valuable metals could result in them sending out a mining
expedition. Bonus points if the game allows NPCs to have
conversations with each other, which could provide a more realistic
way to spread in-world news and information, in a very organic
fashion. Now that I think about it, this would provide the complete
functionality required for reputation/renown/fame/whatever systems.
Very nice idea.

> Depending on how hard you want to parse, question/statement could be
> parsed too ("goblins" vs. "goblins?"), but in a roguelike the high-level
> approach is more fitting. In combat you have buttons to attack, shoot,
> throw something, cast a spell. In dialogue you might have buttons to
> ask, tell, make excuse, some of which might not require user input. Any
> of these can be modified by stats. Wisdom could increase question yield,
> high charisma better results from telling (with an additional bonus from
> intelligence when informing a scholar about a topic of interest)... and
> high combat stats decrease the chances of people taking offense?

I think maybe a mix of both manually typed question/statement parsing,
coupled with a higher level approach like you suggested, could prove
to be rather nice. Maybe have the user inputted text parsing, with
buttons that can be pressed that modify the way the dialogue is
spoken, in essence allowing for the player to adopt varying tones.
For example, typing "tell about goblin raid", could be modified by
pressing the "angry" button, which the character would understand as
the player being upset about the goblin raid. Pressing the "laughter"
button instead, the character would interpret the player as finding
the goblin raid as funny or humorous. Such a minor change in input
could result in drastically different reactions. This would also
allow the player to express their character in more interesting ways,
such as playing a great warrior who yells and intimidates people, or a
lofty scholar who speaks at great lengths about deep subjects in a
pretentious tone.

> On a nonverbal level, character behavior could influence NPC
> responses. If you drop the dreaded dialogue window and make conversation
> an in-world thing, you immediately get the ability to do some neat you
> couldn't do otherwise. For example, NPCs intent on speaking to you can
> now approach you and even follow you a bit to do so.* Imagine beggars or
> vendors on the one hand, or police on the other. Walking away from an
> NPC during conversation could be rude or dangerous. Bringing the
> conversation into the world introduces all these positional options,
> including the possibility of unwanted conversation and avoiding it, a
> huge difference from most games, in which the player either gets sucked
> into a dialogue screen against their will, or must initiate all
> conversation.

I definitely was thinking about making conversation an in-world
thing. A dialogue window of some sort seems unavoidable, but if it is
positioned so that it doesn't block the world-view, and doesn't lock
the player in, preventing other actions, than it should work really
well. Also, if you couple this with giving the ability to NPCs to
talk amongst themselves, you could achieve cool effects like secretly
listening in to conversations, creeping forward to hear better,
without being seen. You could actually allow the player to be a spy,
where information gathering is just as important as assassinations and
such.

> You can go further: Running around jumping on tables when someone is in
> mid-sentence should have a negative effect on the
> conversation. Shuffling through your inventory should be mildly
> negative. Pulling a weapon could be bad or good depending on the
> situation. If sentences span multiple turns, timing your
> questions/statements and such to not interrupt a sentence would improve
> a conversation.

Definitely valid points, although I do have one objection. While
sentences should definitely span a real period of time, so that
lengthy conversations don't take up a single instant of game time
(which is just silly, and far too common in games), I don't think the
player should have to engage in any sort of timing mini-game to avoid
interrupting conversations. In real life, people are pretty capable
of interjecting something in the middle of a conversation, at an
appropriate moment. I do think that the player should be *capable* of
interrupting someone mid-sentence, but they should have to consciously
make that choice. Maybe just make the game assume that when the
player tries to speak, that he politely waits for a break in the
conversation to do so, unless otherwise desired.

> I may have gone far afield, but procedural dialogue is a great
> opportunity to avoid some of the problems dialogue systems have, because
> when the dialog isn't manually authored the paths through a conversation
> increase and the cost of unused paths decreases. It's totally ok if a
> conversation is aborted early by either participant. And with less
> knowledge-related content to be worked through, the space for more
> rewarding behavioral gameplay opens up.
>
> It probably sounds like I'm trying to suggest you do even more work, and
> in a sense I am. I think that for there to be any point in a dialogue
> system, it needs to be a dynamic part of the game. Otherwise, just
> System Shock it**. In your game, that would probably mean procedural
> barks, which I think would be a really great thing in any case. A
> non-dynamic dialog system just turns conversation into a chore. But I'm
> not suggesting an deeper language model, or knowledge model, or anything
> else difficult from an AI perspective. More involved interpersonal
> gameplay is my suggestion.

You've pretty much hit the nail on the head. Unless dialogue is
intended to be nothing more than a source for information dumps, it
needs to be made yet another integral, fun aspect of the gameplay.
Otherwise, it's just another source of grinding and tedium for the
player to deal with. I think that with some of your ideas taken into
account, we've definitely made a big step in the right direction for
providing meaningful social interaction in a genre that typically
solves problems by hitting things with a big pointy stick.

> Whew. I expected this to be a two-sentence post. I hope some of it is
> useful to you. tl;dr Make sure the conversational process is rewarding
> gameplay, otherwise please skip it entirely and just do barks and a
> "tell me more" button. There are enough games dragging themselves
> through the dialogue tarpit.
>
> P. S. If you're having trouble not generating sentences that make your
> NPCs sound like morons, try making up a dialect with alternate grammar
> to mask the problem. Plenty of slang may help as well.

You actually just reminded me of a point I forgot to mention in my
original post. By using tags to differentiate different sentence
fragments and rules, you can also emulate the conversational
differences between different cultures, which increases immersion even
further. Use of slang, common phrases, manners of speech, and even
basic sentence construction would all aid in this.

Thanks for your reply. You've definitely made a lot of good points,
and gave me even more to think about regarding the use of dialogue. I
think this thread is off to a very productive start :)

paul-d...@sbcglobal.net

unread,
Jun 25, 2011, 6:10:02 PM6/25/11
to
Drakalor Tourist <drakalor...@gmail.com> writes:

> I definitely was thinking about making conversation an in-world
> thing. A dialogue window of some sort seems unavoidable, but if it is
> positioned so that it doesn't block the world-view, and doesn't lock
> the player in, preventing other actions, than it should work really
> well.

I was envisioning this: The player, to speak, presses an appropriate
key, the keys being "t" to tell, "a" to ask... maybe "g" to
greet/goodbye. Depending on how you want to abstract conversation. A
prompt appears, where the player types a couple words. Not a sentence.
All NPC speach appears like a bark, that is, floating above their head.

I think that would work well in a graphical game. In a text-based game,
floating speech could be a problem. Maybe any long NPC speech could
appear in a text area, like the message area, and the speaking NPC could
be marked? If long utterances are split over turns, you wouldn't need
more than a single line, and I can't see why more than one NPC should
need to be able to say lengthy things at once.

> Also, if you couple this with giving the ability to NPCs to
> talk amongst themselves, you could achieve cool effects like secretly
> listening in to conversations, creeping forward to hear better,
> without being seen. You could actually allow the player to be a spy,
> where information gathering is just as important as assassinations and
> such.

Oh, that reminds me of something I was thinking but forgot to
write. Making conversation in-world means that conversations now have
by-standers. So a police officer could wander past when you're trying to
discuss something illegal. Or you might need to get an NPC in private to
get them to say what you want.

> Definitely valid points, although I do have one objection. While
> sentences should definitely span a real period of time, so that
> lengthy conversations don't take up a single instant of game time
> (which is just silly, and far too common in games), I don't think the
> player should have to engage in any sort of timing mini-game to avoid
> interrupting conversations.

Yeah, timing mini-games aren't so neat. I was thinking more of correctly
timing topic changes or speaker switches. Topic changes might require an
amount of discourse-awareness that would be difficult to program.

What I specifically had in mind was that NPC utterances would be split
over a couple turns (except short ones), with the player pressing the
wait key, and a guaranteed empty turn between utterances. It would be
rude to begin telling them something mid-utterance, so you would have to
begin on that empty turn. It may be too mechanical enhance fun, but I
look at it as a mechanism to keep the player in a conversational
mindset.

Games have two kinds of conversations: sucked into a dialogue screen
J.C. Denton style, or running around barely aware that a social
situation is occuring, Gordon Freeman style. Either way, the player is
not socially engaged. With players used to that lack of engagement, I
think it might be worthwhile to require a certain amount of "manual
adherence" to conversation rules, just to reorient their attitude. I
agree that it's logical your character would wait until an appropriate
moment to open their mouth... but at the same time, if the player isn't
aware their character is waiting, I could see the illusion of a subtle
conversation parter breaking.

> You've pretty much hit the nail on the head. Unless dialogue is
> intended to be nothing more than a source for information dumps, it
> needs to be made yet another integral, fun aspect of the gameplay.
> Otherwise, it's just another source of grinding and tedium for the
> player to deal with. I think that with some of your ideas taken into
> account, we've definitely made a big step in the right direction for
> providing meaningful social interaction in a genre that typically
> solves problems by hitting things with a big pointy stick.

Hear hear. Conversational games are something I keep telling myself I'll
work on, but all the language/knowledge stuff is scary. Luckily there's
so much more to conversation than the words spoken or the information
exchanged, and probably we can model much of the process of conversation
in a fun way without stumbling into hard AI problems.

> You actually just reminded me of a point I forgot to mention in my
> original post. By using tags to differentiate different sentence
> fragments and rules, you can also emulate the conversational
> differences between different cultures, which increases immersion even
> further. Use of slang, common phrases, manners of speech, and even
> basic sentence construction would all aid in this.

For sure. I nearly mentioned regional variations and what slang can do
for your world building (cf. Thief and Planescape: Torment), but the
post was getting long and I figured you knew it already. ;-)

R. Alan Monroe

unread,
Jun 27, 2011, 7:29:20 PM6/27/11
to
paul-d...@sbcglobal.net wrote in news:87oc1ll...@sbcglobal.net:

> If I were making a dialog system, before I even worried about content,
> I'd think about how I was going to make dialog a dynamic part of the
> world.

Personally I think I'd prefer the generated text was one directional
from NPC to player. It'd be like rolling on a random rumors table in a
pen & paper RPG, except that, all the results would be relevant to the
area, situation and speaker.

Alan

Drakalor Tourist

unread,
Jun 30, 2011, 11:54:55 AM6/30/11
to
First off, sorry for the long delay between replies, and if this
thread is as good as dead, feel free to ignore my post. Stupid google
groups showed no new posts to this group for the last five days, and
today, suddenly, a bunch of old posts popped up. Grr...

On Jun 25, 5:10 pm, paul-donne...@sbcglobal.net wrote:


> Drakalor Tourist <drakalor.tour...@gmail.com> writes:
> > I definitely was thinking about making conversation an in-world
> > thing.  A dialogue window of some sort seems unavoidable, but if it is
> > positioned so that it doesn't block the world-view, and doesn't lock
> > the player in, preventing other actions, than it should work really
> > well.
>
> I was envisioning this: The player, to speak, presses an appropriate
> key, the keys being "t" to tell, "a" to ask... maybe "g" to
> greet/goodbye. Depending on how you want to abstract conversation. A
> prompt appears, where the player types a couple words. Not a sentence.
> All NPC speach appears like a bark, that is, floating above their head.

I was thinking about something more UI friendly, and eliminating
excess keystrokes. My current idea, which only works for games that
plan on adding mouse support, would be to allow the player to right
click on an NPC, which will bring up a context menu. Conversational
options, of varying depth, will be in the menu, as well as other
possible actions (pickpocketing, etc). Ideally it would be possible
to do this with keyboard input as well, for those players that are
inherently opposed to using the mouse. In this case just a single
interaction key (space would seem intuitive), and allow the context
menu to be operated using arrow keys and enter for selection.

Operating under the assumption that conversation in the game is very
common (and if it's not, then procedurally generated dialogue wold be
unnecessary overkill anyway), perhaps a permanent widget for text
input could be placed somewhere, probably at the very top or bottom of
the screen. A single line would be enough, since, as you said, only a
couple words would be typed for later parsing. Actually, I was
thinking about something like this (bad ASCII doodle ahead, best to
used a fixed font for reading):

+================================================+
| Bob: It looks like the battle is going poorly. |
| < asked about battle casualties > |
| Bob: I'm not entirely sure, but I've heard |
| that over five hundred of our soldiers have |
| died so far. |
+================================================+
| > |
+================================================+

The bottom section is for text input, and the main area above stores
all dialogue. A scrollbar to the right could be used to examine older
parts of the conversation. Points of player interaction, like the
"asked about battle casualties" above, would be enclosed in "< >", and
possibly color coded to make things easier on the eyes. Due to the
nature of the in-game conversation system, it would be possible to
converse with multiple NPCs at once (or even overhear multiple NPCs
who aren't even talking to the player). This would necessitate the
need for tagging all dialogue as belonging to the relevant speaker.
Subtle color coding could be used here to make it easier to tell apart
different speakers at a glance, although choosing sane, decent looking
colors would be important here, to avoid a psychadelic nightmare.

> I think that would work well in a graphical game. In a text-based game,
> floating speech could be a problem. Maybe any long NPC speech could
> appear in a text area, like the message area, and the speaking NPC could
> be marked? If long utterances are split over turns, you wouldn't need
> more than a single line, and I can't see why more than one NPC should
> need to be able to say lengthy things at once.

I think that, given the typically ASCII nature of roguelikes, that a
dedicated message area, like the one I suggested above, would probably
be for the best. As to your last point, I can envision scenarios
where multiple NPCs *would* say a lot of things at once. In a
panicked situation, you might have several different people yelling
and barking orders or whatever. Not common, but definitely the kind
of scenario you'd want to allow.

> > Also, if you couple this with giving the ability to NPCs to
> > talk amongst themselves, you could achieve cool effects like secretly
> > listening in to conversations, creeping forward to hear better,
> > without being seen.  You could actually allow the player to be a spy,
> > where information gathering is just as important as assassinations and
> > such.
>
> Oh, that reminds me of something I was thinking but forgot to
> write. Making conversation in-world means that conversations now have
> by-standers. So a police officer could wander past when you're trying to
> discuss something illegal. Or you might need to get an NPC in private to
> get them to say what you want.

That's what I was thinking. It would add increased complexity to the
code, but that should hardly be a reason not to implement it. In
fact, I think that the point you raised above would be a vital part of
any game that made conversation important. Talking about a woman's
secret lover in front of her husband would likely be a bad idea
(depending on the outcome desired). A lot of depth can be introduced
this way, and significantly enhance the roleplaying experience.

Valid points. It would be vital to somehow shift the player's mindset
towards conversation when relevant, especially because you'd have to
be fighting against the player's prior assumptions that conversation
in games is not important. The challenge is making sure it's easy to
both stay in conversation without requiring excessive UI intervention,
while at the same time making it easy to break away from
conversation. If conversation requires significant effort (possibly
even a couple keystrokes or mouse clicks), then the system would be
frustrating and disruptive to the overall game flow, especially in an
area highly populated by NPCs who start conversations with the player.

> > You've pretty much hit the nail on the head.  Unless dialogue is
> > intended to be nothing more than a source for information dumps, it
> > needs to be made yet another integral, fun aspect of the gameplay.
> > Otherwise, it's just another source of grinding and tedium for the
> > player to deal with.  I think that with some of your ideas taken into
> > account, we've definitely made a big step in the right direction for
> > providing meaningful social interaction in a genre that typically
> > solves problems by hitting things with a big pointy stick.
>
> Hear hear. Conversational games are something I keep telling myself I'll
> work on, but all the language/knowledge stuff is scary. Luckily there's
> so much more to conversation than the words spoken or the information
> exchanged, and probably we can model much of the process of conversation
> in a fun way without stumbling into hard AI problems.

Agreed. Tone and emotion arguably shape conversation to the greatest
extent, even more so than the choice of words themselves. This could
possibly be used to add greater depth, with some sort of icon or color
coding being used to represent tone and emotion. You could even
possibly tie this to the player character's relevant stats and
knowledge base, so that reading tone and emotion aren't guaranteed to
be accurate. For example, a player character that hasn't had much
exposure to a different culture might not be able to read the subtle
nuances of their conversation, possibly misinterpreting things, like
not noticing the anger in an NPC's voice.

> > You actually just reminded me of a point I forgot to mention in my
> > original post.  By using tags to differentiate different sentence
> > fragments and rules, you can also emulate the conversational
> > differences between different cultures, which increases immersion even
> > further.  Use of slang, common phrases, manners of speech, and even
> > basic sentence construction would all aid in this.
>
> For sure. I nearly mentioned regional variations and what slang can do
> for your world building (cf. Thief and Planescape: Torment), but the
> post was getting long and I figured you knew it already. ;-)

Indeed :) Again, this has been a very productive conversation. I
think that I'm going to pause development on my game for a few days,
and throw together a simplified text-based implementation of the
procedurally generated dialogue.

paul-d...@sbcglobal.net

unread,
Jul 1, 2011, 1:51:00 AM7/1/11
to
Drakalor Tourist <drakalor...@gmail.com> writes:

> As to your last point, I can envision scenarios where multiple NPCs
> *would* say a lot of things at once. In a panicked situation, you
> might have several different people yelling and barking orders or
> whatever. Not common, but definitely the kind of scenario you'd want
> to allow.

My thinking is that since nobody can actually follow multiple
simultaneous speakers, it's not necessary to display them either. I'd
only display full conversation text for whichever NPC the PC is
currently paying attention to. Other NPCs might have a word or two
picked out to display. So yes, I'd want to allow multiple NPC's
talking. I don't think I'd provide the player with perfect information
about what was said though.

I'm not sure what should constitute "paying attention". If there's only
one speaker (including turn-taking) presumably the PC pays attention to
them. Otherwise... last interacted with, else defaulting to nearest?

> The challenge is making sure it's easy to both stay in conversation
> without requiring excessive UI intervention, while at the same time
> making it easy to break away from conversation. If conversation
> requires significant effort (possibly even a couple keystrokes or
> mouse clicks), then the system would be frustrating and disruptive to
> the overall game flow, especially in an area highly populated by NPCs
> who start conversations with the player.

Hopefully the player has some way to avoid entering conversation with
every interested NPC, especially since beggers and obnoxious merchants
are the most likely people to speak to a stranger in a public
place. Perhaps a conversation does not begin unless the player responds
to the NPC. It's a shame a roguelike can't make use of eye
contact... although NPC's could notice when the player uses their "look"
command, which could be a part of deciding who to approach.

I had pictured conversation being a de facto state rather than something
you're in or out of. Each NPC would have its own idea of where in the
conversational process it stood with respect to the PC, and would react
accordingly to the PC's actions. To end a conversation only walking away
or ceasing to speak would be strictly necessary, and the NPC's reaction
would be the only consequence. Conversely, staying in conversation would
be a matter of not walking away and continuing to interact.

Darren Grey

unread,
Jul 1, 2011, 8:09:18 AM7/1/11
to
On Jun 30, 4:54 pm, Drakalor Tourist <drakalor.tour...@gmail.com>
wrote:

> First off, sorry for the long delay between replies, and if this
> thread is as good as dead, feel free to ignore my post.  Stupid google
> groups showed no new posts to this group for the last five days, and
> today, suddenly, a bunch of old posts popped up.  Grr...

Hmm, same for me. I keep meaning to find a proper news server, but
I'll admit that I like being able to use my Google Groups account from
any location. Oh well...

> Agreed.  Tone and emotion arguably shape conversation to the greatest
> extent, even more so than the choice of words themselves.  This could
> possibly be used to add greater depth, with some sort of icon or color
> coding being used to represent tone and emotion.

You could go all out and have a completely abstract dialogue system.
Would be rather fitting in roguelikes, where the graphics are all
abstracted to different coloured ASCII symbols.

By abstract dialogue I mean using colours, symbols and descriptions
instead of spoken words. The colours could show emotions, whilst the
symbols convey the meaning (the player would have to learn a few base
symbols) and in-game descriptions of a character's movements or
expression could flesh out some detail.

Hmm, could use capital letters for nouns, and lower case for verbs,
with the colours showing tone and adjectives. The verbs and nouns
could tie in with command keys and monster representations to make
them easier to pick up. For instance:

WgP> I! @gP?
(black W, red g, pink P, green >, yellow I, white !, blue @, blue g,
pink P, yellow ?)
= evil Wizard, angrily grabbed, liked Princess, forest dungeon,
scared I, strong exclamation, brave adventurer, bravely get, liked
Princess, scared question
= "The foul wizard has violently kidnapped our most beloved princess
and taken her to his forest keep. Oh how terrible this is - I shall
faint of distress! Please, noble adventurer, I most humbly beg you to
rescue the precious maiden from her dreaded fate."

The last interpretation is of course embellished, but that's all part
of the interpretation of abstract notation. Indeed, it's the strength
of this method - holes in grammar and boring description are washed
over by the player's imagination, much as an @ bumping into a D is far
more dramatic than watching a pixelated warrior poorly swinging a
sword at a badly rendered dragon. Stringing sentences together from
simple rules becomes much easier, as you don't need to worry about
connecting words and phrases or pieces simply not fitting together in
the right tone or style.

Of course the problem is leaving players baffled by what looks like
utter nonsense. And of course it has its restrictions in terms of the
range of nouns and verbs that can be employed. But the same is said
of ASCII presentation in general, of course.

--
Darren Grey

paul-d...@sbcglobal.net

unread,
Jul 1, 2011, 2:39:33 PM7/1/11
to
Darren Grey <darrenj...@gmail.com> writes:

> By abstract dialogue I mean using colours, symbols and descriptions
> instead of spoken words. The colours could show emotions, whilst the
> symbols convey the meaning (the player would have to learn a few base
> symbols) and in-game descriptions of a character's movements or
> expression could flesh out some detail.
>
> Hmm, could use capital letters for nouns, and lower case for verbs,
> with the colours showing tone and adjectives. The verbs and nouns
> could tie in with command keys and monster representations to make
> them easier to pick up. For instance:
>
> WgP> I! @gP?
> (black W, red g, pink P, green >, yellow I, white !, blue @, blue g,
> pink P, yellow ?)
> = evil Wizard, angrily grabbed, liked Princess, forest dungeon,
> scared I, strong exclamation, brave adventurer, bravely get, liked
> Princess, scared question

That's closer to a mini-language than an abstract system, isn't it? Not
that creating a simple language for a game isn't a cool idea. I picture
an abstract system as consisting of commands above the content level.

BRitchie

unread,
Jul 17, 2011, 9:54:59 PM7/17/11
to
I played around with procedurally generated quests before and procedurally generated dialogue was one of the things that I tried to tackle. It's not easy and not something that I would leave to algorithms alone. At first I tried a simple pre-written response with fill in the blanks kind of system. This went down hill bad as the files needed would get very large very quickly and be impossible to parse through. My second attempt was to create a meta language like you are proposing and this got arduous and unwieldy very quickly as well.

My most successful attempt was my third attempt but it was a lot of work and at the time not really feasible (After I explain you will understand). I came to the conclusion that the reason we (humans) are able to communicate isn't really because of the rules of the language that adhere to (Although that is part of it), but we have significant names for abstract as well as physical ideas. The key is to keep these things organized and refer to them when needed. For instance the sentence "My brother is a cobbler." implies that we know what a brother is, what a cobbler is and also what an occupation is. For an NPC to be able to say something like this of their own accord they would have to be able to connect the dots themselves. This lead to my first attempt at the bloodlines generator. It was designed to hold everything in a tree structure and allow me to quickly (It wasn't that quick) figure out the relationships between the members in it. Using rules I was able to have these people spit out some basic information about their family. Some of the successful tests were able to string together two or three sentences about different relationships they had: Mothers, Fathers, siblings, if these relations were still alive (The simulation advanced one year every iteration), marital status and their current age.

I got excited at this point and added a second layer that described physical features of a town: house numbers, public fountain, nearby castle, Shops (occupations were based on which house a person lived in). This made the people more talkative as they had more context and understood the concepts of more words. The contexts added were basically the difference between a house and a shop, where this thing called a fountain was (They didn't understand the purpose and never commented on it except to say someone lived across the street from it.), What a street was and the concept of tiles (Everything was measured in tiles). An example of a simple conversation would be "Bob lives on Knight Street across from the fountain. It is 13 tiles from my house".

This was as far as I got. There was a meta language that defined exactly how the output was to be formatted. It simply defined the order of granularity. For directions it depended on how far the person lived away from the target. If they were less then two streets away it would simply give the street name and name a nearby landmark if available. Any further they would resort to turn by turn directions. This was intensive as it required to pick a subject, a person or place and then traverse several trees to pull the information needed.

I had plans to create a general purpose scene graph to keep all of this information in a single place, but getting rid of the tree structures really hurt the performance. After that I lost interest and the code was lost in one of the many re-formats of my computer since then.

This is my story of procedurally generated dialogue/quests attempt. It was interesting but in the end the ram usage bordered on about 1.5 Gb for just this small example. It was readily apparent that the amount of information to make procedural generation work was huge and not scale able for a whole game.

Here are some links to my early work, I can't find any links to anything after version 0.5.

https://groups.google.com/forum/?hl=en#!topic/rec.games.roguelike.development/ydjZhBv1Hbc

https://groups.google.com/forum/?hl=en#!topic/rec.games.roguelike.development/M7SuoePI1NY

paul-d...@sbcglobal.net

unread,
Jul 18, 2011, 12:59:55 AM7/18/11
to
BRitchie <ritchi...@gmail.com> writes:

> My most successful attempt was my third attempt but it was a lot of
> work and at the time not really feasible (After I explain you will
> understand). I came to the conclusion that the reason we (humans) are
> able to communicate isn't really because of the rules of the language
> that adhere to (Although that is part of it), but we have significant
> names for abstract as well as physical ideas. The key is to keep these
> things organized and refer to them when needed. For instance the
> sentence "My brother is a cobbler." implies that we know what a
> brother is, what a cobbler is and also what an occupation is. For an
> NPC to be able to say something like this of their own accord they
> would have to be able to connect the dots themselves. This lead to my
> first attempt at the bloodlines generator. It was designed to hold
> everything in a tree structure and allow me to quickly (It wasn't that
> quick) figure out the relationships between the members in it. Using
> rules I was able to have these people spit out some basic information
> about their family. Some of the successful tests were able to string
> together two or three sentences about different relationships they
> had: Mothers, Fathers, siblings, if these relations were still alive
> (The simulation advanced one year every iteration), marital status and
> their current age.

Did you use some kind of Prolog for that, and if not, do you think that
would have helped with its speed/ease of implementation?

BRitchie

unread,
Jul 18, 2011, 7:20:40 PM7/18/11
to
On Monday, 18 July 2011 00:59:55 UTC-4, paul-d...@sbcglobal.net wrote:
> Did you use some kind of Prolog for that, and if not, do you think that
> would have helped with its speed/ease of implementation?

No I didn't use any type of logic language. Although, a Prolog implementation may have helped. I've never used a logic language so I'm mostly guessing here. The biggest problem is the sheer amount of data that needs to be kept in ram as the application was running. For the application that I described I remember my Pentium 3 500Mhz (Yes, it was a while ago.) really struggling to run it. The application used to fill a good 200Mb of Ram when it was running. If one could find a better way to store all of the data then this might not be such a concern. I'm really in the dark in how well Prolog handles the traversal of thousands of objects.

I recently read an interesting article on scenegraphs. http://www.realityprime.com/articles/scenegraphs-past-present-and-future, the last part "Scenegraphs of Tomorrow" is the really interesting part. If one could pull this off then it may be an appropriate solution to holding that much data and traversing the graphs efficiently.

T. Ettinger

unread,
Jul 19, 2011, 10:54:31 AM7/19/11
to
On Friday, July 1, 2011 11:39:33 AM UTC-7, paul-d...@sbcglobal.net wrote:
> That's closer to a mini-language than an abstract system, isn't it? Not
> that creating a simple language for a game isn't a cool idea. I picture
> an abstract system as consisting of commands above the content level.

The human-usable language Lojban can be parsed with a packrat parser ( http://www.digitalkingdom.org/~rlpowell/hobbies/lojban/grammar/ ), but that wouldn't solve the memory consumption issues, as most (all?) packrat parsers are very memory-hungry. It might be a valid solution to limit the game to, say, one village (as in the first chapter of Mother 3, a Japan-only GBA RPG which is good at tugging your heartstrings). With fewer NPCs and fewer conversation topics, you could actually bond with a few NPCs and become "friends" (although you wouldn't have much to talk about).
On the topic of limiting the game's scope, what if you tried a Tron-style silly virtual world, and had characters actually speak in code? Since many programming languages can be parsed unambiguously with a minimum of memory usage, the player could learn to speak in the same language they do, and they could actually understand what the PC is saying. This also gives you permission to make NPCs act like robots, because that's what they are. Of course this would need to be a tiny, simple language with forgiving syntax; a subset of Lua might count, or Lisp if you can color-code the parentheses, as some editors do ( https://code.google.com/p/counterclockwise/wiki/ScreenShots#Source_code_Editor for example ). It could be fun to have NPCs respond negatively to code that throws errors or enters a (sandbox-terminated) infinite loop. Of course, people could just do "you.friends.add(me)" if you allow that kind of thing, so there could be some interesting public/private variable stuff. Trying to access someone's private variables would not only cause an error, it could be illegal in this world. Of course, having a past tense could be difficult for normal code, so it might need to be a code-like "natural" language.
An alternative could be to eliminate dialogue entirely, and procedurally generate cartoon-y flashback sequences or requests to do something, appearing to the player when an NPC explains something of relevance to the game. This, of course, has no relevance to the topic.

BRitchie

unread,
Jul 19, 2011, 9:46:25 PM7/19/11
to
Lojban sounds interesting. I've never used this but it has piqued my interest. I remember for one of my college projects I used Python to create a small domain-specific language to control a small (virtual) robot. Lojban seems very similar on the surface.

The game you describe sounds fascinating, I doubt if I could do a project like that because my job keeps me very busy. I could see something like that be time consuming, especially in the debugging department. If someone wants to take up the challenge I would be interested in seeing how this turns out.

paul-d...@sbcglobal.net

unread,
Jul 20, 2011, 12:11:59 AM7/20/11
to
"T. Ettinger" <tommy.e...@gmail.com> writes:

> On Friday, July 1, 2011 11:39:33 AM UTC-7, paul-d...@sbcglobal.net wrote:
>> That's closer to a mini-language than an abstract system, isn't it? Not
>> that creating a simple language for a game isn't a cool idea. I picture
>> an abstract system as consisting of commands above the content level.
>
> The human-usable language Lojban can be parsed with a packrat parser (
> http://www.digitalkingdom.org/~rlpowell/hobbies/lojban/grammar/ ), but
> that wouldn't solve the memory consumption issues, as most (all?)
> packrat parsers are very memory-hungry.

lo nu lo skami ku pensi cu ralju nandu iju la lojban bangu lo skami i
pe'i se ja'e tu'a la lojban lo nu lo skami ku pensi na frili ni'o mi
nelci lo sidbo be lo me la lojban se kelci ni'o lo bangu poi sapmau la
lojban ku xamgu pe'i lo nu tavla lo skami va'o lo se kelci i se ja'e lo
nu lo se kelci ku ctuca fo lo bangu kei lo lo kelci ku ka bangu certu ku
rinju i lo se kelci ku po'o crerai

mb...@sdf.squishthisbitandinvalid.org.invalid

unread,
Jul 20, 2011, 2:11:20 PM7/20/11
to

ta'o za'a .ue lo'i tcidu be fi la rygyryd. je jbosku na se pa mei

Although Lojban as a whole certainly is too complicated, perhaps a
small reduct of it could be appropriate to the purpose suggested. With
a handful of game-specific words and a few simple grammatical
concepts, you could have a simple human-learnable and
machine-"understand"able language quite easily.

(I'm thinking of something like the reduct where the only cmavo are
lo, nu, du'u, se etc, be etc, maybe poi, a smattering of KOhA and UI,
and the relevant terminators)

If all NPCs also talk in this stilted fashion, the player will get the
impression of being allowed to say anything at all in this new
language the player is learning...

Actually teaching the player the language in a context of a game
without this becoming its main focus, and actually making meaningful
use of the player's lojbanic input, are perhaps more difficult tasks.

Anyway, a roguelike is probably one of the least appropriate genres
for this idea ;)

paul-d...@sbcglobal.net

unread,
Jul 21, 2011, 5:01:34 AM7/21/11
to
<mb...@sdf.squishthisbitandinvalid.org.invalid> writes:

> On 2011-07-20, paul-d...@sbcglobal.net <paul-d...@sbcglobal.net> wrote:
>> "T. Ettinger" <tommy.e...@gmail.com> writes:
>>
>>> On Friday, July 1, 2011 11:39:33 AM UTC-7, paul-d...@sbcglobal.net wrote:
>>>> That's closer to a mini-language than an abstract system, isn't it? Not
>>>> that creating a simple language for a game isn't a cool idea. I picture
>>>> an abstract system as consisting of commands above the content level.
>>>
>>> The human-usable language Lojban can be parsed with a packrat parser (
>>> http://www.digitalkingdom.org/~rlpowell/hobbies/lojban/grammar/ ), but
>>> that wouldn't solve the memory consumption issues, as most (all?)
>>> packrat parsers are very memory-hungry.
>>
>> lo nu lo skami ku pensi cu ralju nandu iju la lojban bangu lo skami i
>> pe'i se ja'e tu'a la lojban lo nu lo skami ku pensi na frili ni'o mi
>> nelci lo sidbo be lo me la lojban se kelci ni'o lo bangu poi sapmau la
>> lojban ku xamgu pe'i lo nu tavla lo skami va'o lo se kelci i se ja'e lo
>> nu lo se kelci ku ctuca fo lo bangu kei lo lo kelci ku ka bangu certu ku
>> rinju i lo se kelci ku po'o crerai
>
> ta'o za'a .ue lo'i tcidu be fi la rygyryd. je jbosku na se pa mei
>
> Although Lojban as a whole certainly is too complicated, perhaps a
> small reduct of it could be appropriate to the purpose suggested. With
> a handful of game-specific words and a few simple grammatical
> concepts, you could have a simple human-learnable and
> machine-"understand"able language quite easily.

I think semantics are the basic issue. Lojban may not be trivial to
parse, but simplifying the grammer isn't going to solve the basic
problem, making a computer comprehend what it's been told.

> (I'm thinking of something like the reduct where the only cmavo are
> lo, nu, du'u, se etc, be etc, maybe poi, a smattering of KOhA and UI,
> and the relevant terminators)
>
> If all NPCs also talk in this stilted fashion, the player will get the
> impression of being allowed to say anything at all in this new
> language the player is learning...

Yes, I think there's a lot of power in that approach for language based
games.

> Actually teaching the player the language in a context of a game
> without this becoming its main focus, and actually making meaningful
> use of the player's lojbanic input, are perhaps more difficult tasks.

Lojban seems like a difficult language to teach by example alone. The
grammar is simple, but in most natural langauges you can construct
reasonable utterances just by mashing appropriate words together. Since
in lojban that will explicitly mean something else, I don't see how a
learner can be expected to notice the issue. Either the computer is very
generous and attempts to construct a meaning (the player will never know
they're wrong), or it totally misses the intended point.

I think precise language is targeting the wrong problem. If the computer
misunderstands me, I'd rather that be because I was ambiguous than
because it's obviously stupid.

> Anyway, a roguelike is probably one of the least appropriate genres
> for this idea ;)

Ah, maybe. It seems like "do it all" adventuring games fit roguelikes
more naturally than other genres.

mb

unread,
Jul 21, 2011, 12:30:12 PM7/21/11
to
On 2011-07-21, paul-d...@sbcglobal.net <paul-d...@sbcglobal.net> wrote:
><mb...@sdf.squishthisbitandinvalid.org.invalid> writes:
>
>> On 2011-07-20, paul-d...@sbcglobal.net
>> <paul-d...@sbcglobal.net> wrote:
>>> "T. Ettinger" <tommy.e...@gmail.com> writes:
>>>
>>>> On Friday, July 1, 2011 11:39:33 AM UTC-7, paul-d...@sbcglobal.net wrote:
>>>>> That's closer to a mini-language than an abstract system, isn't it? Not
>>>>> that creating a simple language for a game isn't a cool idea. I picture
>>>>> an abstract system as consisting of commands above the content level.
>>>>
>>>> The human-usable language Lojban can be parsed with a packrat parser
>>>
>>> lo nu lo skami ku pensi cu ralju nandu iju la lojban bangu lo skami i
>>> pe'i se ja'e tu'a la lojban lo nu lo skami ku pensi na frili ni'o mi
>>> nelci lo sidbo be lo me la lojban se kelci ni'o lo bangu poi sapmau la
>>> lojban ku xamgu pe'i lo nu tavla lo skami va'o lo se kelci i se ja'e lo
>>> nu lo se kelci ku ctuca fo lo bangu kei lo lo kelci ku ka bangu certu ku
>>> rinju i lo se kelci ku po'o crerai
>>
>> ta'o za'a .ue lo'i tcidu be fi la rygyryd. je jbosku na se pa mei
>>
>> Although Lojban as a whole certainly is too complicated, perhaps a
>> small reduct of it could be appropriate to the purpose suggested. With
>> a handful of game-specific words and a few simple grammatical
>> concepts, you could have a simple human-learnable and
>> machine-"understand"able language quite easily.
>
> I think semantics are the basic issue. Lojban may not be trivial to
> parse, but simplifying the grammer isn't going to solve the basic
> problem, making a computer comprehend what it's been told.

It *does* make it easier, though. Consider SHRDLU, or (at a
considerably more basic level) IF parsers. Once sentences are
guaranteed to come in certain stereotyped forms, you have some hope of
interpreting them sensibly.

With natural languages, such restrictions are necessarily artificial
and hard to impose cleanly. Restricting the vocabulary is really not
enough - witness Simple English.

In Lojban, different grammatical constructs require different words.
So you can naturally produce a highly grammatically constrained
version by just constraining the vocabulary.

>> (I'm thinking of something like the reduct where the only cmavo are
>> lo, nu, du'u, se etc, be etc, maybe poi, a smattering of KOhA and UI,
>> and the relevant terminators)

(You'd probably also want to disallow tanru)

>> If all NPCs also talk in this stilted fashion, the player will get the
>> impression of being allowed to say anything at all in this new
>> language the player is learning...
>
> Yes, I think there's a lot of power in that approach for language based
> games.

Yeah! I think someone should give it a shot! Maybe a simple
lojbo SHRDLU-alike would be a good place to start (I have for nearly a
decade been meaning to try this).

>> Actually teaching the player the language in a context of a game
>> without this becoming its main focus, and actually making meaningful
>> use of the player's lojbanic input, are perhaps more difficult tasks.
>
> Lojban seems like a difficult language to teach by example alone. The
> grammar is simple, but in most natural langauges you can construct
> reasonable utterances just by mashing appropriate words together. Since
> in lojban that will explicitly mean something else, I don't see how a
> learner can be expected to notice the issue. Either the computer is very
> generous and attempts to construct a meaning (the player will never know
> they're wrong), or it totally misses the intended point.

If it does so in such a way that the player can guess what meaning it
understood, that might be sufficient feedback for learning. Giving
decent feedback on parse errors without breaking memesis may be
difficult, although {[first unparsed word] ki'a} might suffice.

> I think precise language is targeting the wrong problem. If the computer
> misunderstands me, I'd rather that be because I was ambiguous than
> because it's obviously stupid.

My feeling is that a precise unambiguous language should actually be
easier (for an adult) to learn by example and feedback. Consider how
much easier it is to learn LISP than French (or is that just me?).

>> Anyway, a roguelike is probably one of the least appropriate genres
>> for this idea ;)
>
> Ah, maybe. It seems like "do it all" adventuring games fit roguelikes
> more naturally than other genres.

That's true... and roguelike players are brave and persistent, and
accustomed to spending time learning their way around a system...

Maybe we should add Cevni as a new Crawl god, who you can pray to for
favours and advice?

p doi cevni ga'inai lo vi ratcu mi fanza
The voice of Cevni echos through the dungeon "JE'E BAVMRO".
The rat dies.
The rat dies.
The rat dies.

;)

BirdoPrey

unread,
Jul 21, 2011, 2:34:18 PM7/21/11
to
On Jun 25, 12:02 pm, Drakalor Tourist <drakalor.tour...@gmail.com>
wrote:

> Well, I haven't really seen this topic get much discussion, which is a
> shame, so I thought I'd toss my design for procedurally generated
> dialogue out there.  Based on my design goals for my project,
> implementing this is highly desirable, due to: increased immersion,
> more natural quests/plots/whatever, and making non-combative skills
> more meaningful.
>
> While truly random dialogue is nearly impossible for all practical
> purposes, a pseudo-random dialogue generator is definitely feasible,
> and like with any procedurally generated system, it significantly
> amplifies the work you put into it with a greatly increased amount of
> content.
>
> My general idea is to make use of a Markov chain, processing grammars
> and rules.  In essence, it's the same type of system commonly used for
> random name generators, but instead applied to pieces of dialogue.

For what it's worth, I've never once read anything generated by a
markov chain that made sense or didn't look artificial. I think you
might have more success with some kind of complex mad-libs system,
although it might take a good deal more work to be as expressive and
flexible.

Mario Lassnig

unread,
Jul 21, 2011, 2:48:42 PM7/21/11
to

Just a basic conceptual question... what's the point of random
dialogue, if it doesn't convey useful information?

Just mood and atmosphere? I don't think that dialogue is the
right way to do this.

BirdoPrey

unread,
Jul 22, 2011, 6:25:20 PM7/22/11
to

Procedurally generated dialogue would be one of the best ways to make
NPC's that actually seem like real characters. And who says it
couldn't convey useful information at the same time? The point of
speech in the first place is to convey information.

paul-d...@sbcglobal.net

unread,
Jul 23, 2011, 4:55:39 PM7/23/11
to
mb <mb...@sdf.justtrytospammegoon.org.invalid> writes:

Well yeah, but SHRDLU had an extremely constrained *world*. I think
trying to obtain precise parses is part of the blocks world mindset, and
maybe isn't so helpful in a more complex world, such as a
roguelike. People misunderstand each other in conversation all the
time. I think you'd get more out of disambiguation strategies than out
of precise parsing. The real problem to solve is getting the computer to
respond intelligently to what it hears, not to make sure it hears
properly. What's going to make your computer look smarter,
misunderstanding what you've said and responding appropriately to what
it *thought* it heard, or hearing precisely and taking it in the wrong
direction?

Not that parsing English isn't stupidly hard. A simpler language would
take a lot of workload off the programmer. I'm just saying that a
simpler language is mainly going to solve your pragmatic problems.

I just picture this:

player: mi catra ratcu
npc: do na ratcu
player: ?

(The player tries to tell an NPC they killed a rat, but actually claims
to be a deadly rat. The NPC tells them they are not a rat.) Hopefully
for the player's sake the NPC doesn't believe them. Learning lojban
without an explanation of the grammar seems like learning ed without the
manual.

>> I think precise language is targeting the wrong problem. If the computer
>> misunderstands me, I'd rather that be because I was ambiguous than
>> because it's obviously stupid.
>
> My feeling is that a precise unambiguous language should actually be
> easier (for an adult) to learn by example and feedback. Consider how
> much easier it is to learn LISP than French (or is that just me?).

Probably would be. But I think it also needs to be more DWIM (do what I
mean) than lojban is to be taught quickly by example. When the most
common errors lead to totally different statements (sometimes even valid
ones, like above), you're setting yourself up for a confusing
experience. Lojban places an immediate grammatical hurdle in front of
the learner. It's a low one and actually talking to a lojbanist will set
you straight in moments, but it also only takes moments to quit playing
a game because the first thing you do is make grammatical errors with
only a computer to try to explain where you've gone wrong.

Ploog

unread,
Jul 31, 2011, 9:04:16 AM7/31/11
to
On Thu, 21 Jul 2011, Mario Lassnig wrote:
>> On Jun 25, 12:02 pm, Drakalor Tourist<drakalor.tour...@gmail.com>
>> wrote:
>>>
>>> While truly random dialogue is nearly impossible for all practical
>>> purposes, a pseudo-random dialogue generator is definitely feasible,
>>> and like with any procedurally generated system, it significantly
>>> amplifies the work you put into it with a greatly increased amount of
>>> content.
>
> Just a basic conceptual question... what's the point of random
> dialogue, if it doesn't convey useful information?
>
> Just mood and atmosphere? I don't think that dialogue is the
> right way to do this.

I cannot answer those, but Crawl has some (very) little in that direction
since Eronarn's Zin patch for 0.8. There is the god Zin who is pretty
strict and stern about all things. Followers can use a god power Recital
which takes three turns and affects monsters in a number of ways (e.g.
blind, confuse, paralyse, put to sleep, terrify etc.). In order to
indicate that this is a multiturn action, and to indicate which version of
Recital is used (there are several, depending on the audience), sentences
made from three building blocks are used. The blocks are randomised, two
examples below [where the stuff in quotation marks is the speech I am
writing about and the whole thing is what you read in the message window]:

You clear your throat and prepare to recite Apostates 17:23.
"The law of Zin demands thee..."
"...be faithful, and that the punishment for unfaithfulness..."
The goblin is terrified by your recitation.
"...shall be swift and harsh!"
You finish reciting Apostates 17:23. You feel short of breath.

You clear your throat and prepare to recite Apostates 4:53.
"And so Zin bade the heretics to come before..."
"...the altar, that judgement might be passed..."
The goblin is awed by your recitation.
"...upon those who were not loyal."
You finish reciting Apostates 4:53. "Amen!"

You clear your throat and prepare to recite Ablutions 9:70.
"And Zin said to all in attendance, 'Which of ye..."
Menkaure is turned into a pillar of salt by the wrath of Zin!
You destroy Menkaure!
"...number among the fetid masses? Come before me, that..."
"...I may oust you now for your contamination!'"

The messages are not really important, hence darkgrey, but it is a lot
more fun (not to mention the flavour) to have them like they are now.
Players generally like them.

0 new messages