Archive for July, 2009

h1

Modeling conversation flow: NPC repeating information

July 30, 2009

[This is part of a series of discussions on the craft of modeling conversation. For previous installments, see my original Homer in Silicon article which lays out the basic elements of the model, and previous blog posts on NPC initiative, subject changes, transitions in player speech, and interruptions.]

One of the standard objections to early versions of ASK-TELL IF conversation was that NPCs would go on repeating themselves verbatim every time you asked the same question. On the other hand, having the NPC refuse to answer a question more than once meant that the player might lose access to game-important information that he might not have noticed or understood the first time he read it. This point has been hashed over a lot and solved in various ways over the years, and I discuss some of the most-used solutions in my longer article on conversation approaches in IF in general. An increasingly common solution in modern IF is to have the protagonist refuse to re-answer the question but simply remember what was said last time if he tries, so

>ASK WHEELER ABOUT SNOW

might result in

Weatherman Wheeler already told you that he expects eight inches of snowfall in the next two days.

That neatly preserves the player’s knowledge while avoiding the conversational problems.

In the Alabaster conversation model, the player is allowed to THINK to review the facts he’s already learned, which is another way to approach retention of knowledge once a one-use quip has been used up. It would be possible to arrange things so that the Alabaster model produced the same results as in the first example, too. The attractiveness of that approach would probably depend a lot on whether there were many quips per subject, as there are in Alabaster [in which case the player would often be invited to disambiguate among some quips that he'd already asked as well as the ones currently available], or very few, as there might be in a more exploratory game.

But the other thing that Alabaster does is let the player repeatedly request information about certain common topics, and the NPC’s response is generated from several random elements to piece together a reply that will not be the same each time, but will always contain roughly the same set of facts if there’s anything important there. In fact, Alabaster glues together various clauses semi-randomly so that the cadence of the generated text will also vary from time to time. (The code is here.) If the player has asked the same question many times, the NPC will notice and remark on the repetition, as one might expect. (Indeed, allowing the player to annoy the NPC is probably the main reason to implement repeated questioning at all, rather than relying solely on a knowledge system to remind the player of questions already asked.)

Alabaster’s system isn’t terribly sophisticated because, in fact, most of this information is local color, not hugely important, and because in testing players spent relatively little of their time asking these generic questions when there were more specific, conversation-advancing things to say.

In a different game, it might be better to handle the problem using facts.

A fact is a part of the conversation model by default: a fact can be known or unknown by each of the characters (including the player). The player can learn facts from conversation, but also from the surrounding world (say by reading a letter or seeing a clue): any time text is printed to the screen that contains a fact-name as a tag (like [bob-killed-harry]), the player is marked as knowing that fact. NPCs also know facts that are conveyed in the text of conversations that they were present to hear, even if they are not participants in said conversation.

So most of the time, the implementation is that the author writes the text in whatever form he likes and then marks up that text to indicate what factual data it contains. This sounds daunting, but in practice the number of facts worth modeling is usually much much lower than the number of quips; you only model the information that’s going to affect gameplay.

But I can imagine an alternate way of writing a repeatable quip would be to give that quip a property containing a list of facts to be conveyed. Each fact would have several phrases that this particular NPC might use to convey such information; and then the system would stitch together the phrases into a paragraph in the same way that Alabaster does.

One advantage to this is that it would be possible to have the NPC automatically filter the list so as not to repeat facts that were just recently stated in conversation, or indeed only to repeat the facts that were already known. Thus the summary response to “TELL ME ABOUT BOB” would get longer as more and more information about Bob was introduced elsewhere in the dialogue, but this summary quip would never give away information that was meant to be broached first elsewhere.

h1

Modeling conversation flow: interrupting the player

July 27, 2009

[This is part of a series of discussions on the craft of modeling conversation. For previous installments, see my original Homer in Silicon article which lays out the basic elements of the model, and previous blog posts on NPC initiative and subject changes, and transitions in player speech.]

There’s a hacky moment in Alabaster to do with interruptions.

During one of the first moves of the game, you can ask Snow White about something while she’s waiting for an answer about whether you’re going to escort her to the forest. So, if you talk about something else instead, she gets angry and interrupts. In the first implementation, she waited for the subject-changing hook to object; but I didn’t like the effect of that, so I decided to have her actually interrupt the speech in progress. Whatever the player is saying, after the first few words, she’ll leap in: this is done by dumping the quip content to indexed text and running a regular expression to automatically detect a safe break-in point. This happens regardless of which question you’ve asked her (and there are dozens of possibilities). For instance:

“Why do you –”

She sets her jaw as she realizes you are changing the subject.

“–avoid the Queen’s mirror? Many of us have stood before it, and taken no harm.”

If you asked this under any other circumstance, this question would just print as “Why do you avoid the Queen’s mirror? …” without interference.

The strength of this is that it let me introduce this feature across dozens of possible quips the player might say here, without having to edit the quips themselves. As this sample demonstrates, though, the weakness is that the algorithm for producing break-in points is pretty basic. Here we have Snow White looking irritated before the gist of the player’s comment is really clear at all.

Still, sometimes it works a lot better, and I found that it was still more interesting than using the subject-changing hook to show her anger in this particular context, so I left it as it was.

Read the rest of this entry ?

h1

Modeling conversation flow: transitions in player speech

July 26, 2009

[This is part of a series of discussions on the craft of modeling conversation. For previous installments, see my original Homer in Silicon article which lays out the basic elements of the model, and previous blog posts on NPC initiative and subject changes.]

One of the issues that has already appeared several times in these posts is the idea of the transition: how do we produce smooth, plausible segues from one bit of speech to another?

In the present model, the NPC’s responses are generally written to go with the player comment that led into them, and we’ve already looked a little at the way the system creates transition text when the NPC wants to introduce a new topic of conversation.

The remaining area of concern is the transition from whatever the NPC last said to the player’s next comment, which appears at a turn break:

PC comments
NPC replies
> (player’s command)
PC comments again
NPC replies

Read the rest of this entry ?

h1

Passport to Perfume

July 25, 2009

Picture 15Now and then I get review copies of things that turn out to have too little narrative content for a Homer in Silicon column, but are decent enough that I play them for a while anyway. Passport to Perfume is one such: a new casual game from Playfirst.

Passport does the thing a lot of casual games do these days: “innovate” by combining standard existing types of gameplay — in this case time management and hidden object segments.

This is not what appealed to me. I’ve played enough generic time management games for a lifetime now, and hidden object has never been my favorite.

What appealed to me was the third element of the game, the ability to mix ingredients to create your own new perfume blends. It sounded derivative of Chocolatier: Decadence by Design, where you can mix ingredients to create your own chocolates — but since I liked Decadence by Design and thought there was some unexplored potential in its mix-and-match gameplay, I was curious whether Passport took this idea further. (It was pretty clearly ripping off borrowing heavily from the Chocolatier series in other respects, with retro-looking maps of the world and exotic locations for the heroine to visit for new ingredients.)

Read the rest of this entry ?

h1

Latest HiS

July 24, 2009

On Super Energy Apocalypse Recycled. (Yeah, it’s a mouthful.)

h1

Modeling conversation flow: subject changes

July 24, 2009

[This is part of a series of discussions on the craft of modeling conversation. For previous installments, see my original Homer in Silicon article which lays out the basic elements of the model, and my blog post on NPC initiative, which describes how NPCs might manage a list of things to say in the future.]

Alabaster has a threaded conversation system, which is my way of saying that it keeps track of which quips follow naturally from which others. That’s important because it allows the game to prompt the player with the quips that he’s most likely to want to use next (and, even if such hinting is turned off, to parse input more intelligently).

Responses to the player.

Thanks to its awareness of threads, the Alabaster system allows for a hook, the subject-changing activity, which comes between the PC’s comment and the NPC’s reply. For reference, the full sequence for handling a conversation action looks like this:

1. PC’s comment (which can be multiple paragraphs, but usually isn’t)
2a. NPC challenges a change of subject, if relevant (SUBJECT-CHANGING HOOK)
2b. NPC’s response (which can be multiple paragraphs, but usually isn’t)
3. (If step 4 is going to happen) A grounding beat is produced to mark a pause in the conversation, to pave the way for
4. (Optionally) If the current conversation thread is at an end, and if the NPC has something else planned to say, he now starts a new conversation thread by saying the next thing on his list.

In transcript, that might look like this:

>ASK LUCY ABOUT DIAMONDS
(1) “Are diamonds your favorite gem, Lucy?”

(2a) She looks surprised by this question. (2b) “Yes, ever since I was a child.”

(3) Overhead the seagulls wheel and cry.

(4) “I do wonder what my mother did with the family rubies. They were missing when she died,” Lucy says.

And for a non-conversation option:

1. PC’s action is handled however is appropriate.
2. (Optionally) If the NPC has something else planned to say, he now starts a new conversation thread by saying the next thing on his list.

which would produce a transcript like this:

>EXAMINE DIAMONDS
(1) They glitter at you malevolently.

(2) “I do wonder what my mother did with the family rubies. They were missing when she died,” Lucy says.

Read the rest of this entry ?

h1

Audioverse

July 24, 2009

Ran across this randomly while searching for something else: Audioverse is “an interactive fiction framework” that includes rigorous modeling for ambient sound effects. The screenshot looks severely old-school to my eye, and I haven’t gotten the downloadable sample file to run, so I have no idea what it’s like in practice, but I confess I’m intrigued by the description. I have generally tended to think that a heavily sound-based approach to IF runs into problems because it’s hard to sync the real-time nature of sound with the turn-based text — but I haven’t tried something like this, and it might be interesting.

h1

Sims 3 in review

July 23, 2009

Endearing semi-bugs(?) aside, my recent Sims playing has been comparatively uneventful. I played a family through several generations; then, on advice to interact more with the non-active households to watch how those evolve, I set up a larger neighborhood, moved in every family I’d ever created, and spent a lot of time having my active Sims visit the ones that were running by themselves.

The result seemed to be that all the Sim families I wasn’t actively playing immediately got a new baby — presumably by adoption, since none of them acquired new romantic partners or spent any time pregnant as far as I can tell — but that otherwise they seemed rather static. The evil, mean-spirited Lars and humorless, snobbish Lisa still had fights, but still continued to live together until their family left the neighborhood entirely for no reason I could see. They didn’t seem to make changes to their houses, either. Maybe they can’t buy things when I’m not there to buy them new stuff. Or maybe it was just that they weren’t very proactive about job-finding on their own, so didn’t have the cash to make changes.*

Anyway. I’ve spent far more time playing with this than I originally intended to do, and I am still finding lots of neat and unexpected interactions; the amount of detail and care that has gone into the whole game is phenomenal. Many short-term interactions in it turn out to make good anecdotes, too — sometimes because they run into odd corners of the simulation, but not always.

I continue to think that it doesn’t tend to produce good long-term story, because there’s no arc structure. In this respect, it’s being true to what it is trying to simulate: my life also yields the odd anecdote but overall lacks narrative structure.

Read the rest of this entry ?

h1

Modeling conversation flow: types of NPC Initiative

July 22, 2009

In Galatea, one of the things I wanted to do, but managed very badly, was to have Galatea continue the conversation herself if you stopped to listen to her rather than talking. But the number of such things she had to say was pretty sparse, so it wasn’t worth stopping to wait after every turn, and there wasn’t always any clear sign when she was likely to continue. Moreover, the mechanism for this was very hacky and didn’t allow her to have more than one thing planned to say at a time.

Alabaster does this much better. Instead of having the NPC’s speech be part of the player’s action, the NPC actually has a separate action in which he speaks, and he has a list of quips to say next. He will go on saying things from this list if the player is silent, or if the current conversation thread has come to an end and it’s time to change the subject to keep conversation flowing. (Galatea has no model of when conversation threads have ended, either.)

New quips added to the list have two kinds of priority. They can be marked either “obligatory” or “optional”, and either “immediate” or “postponed”. Obligatory quips are things the NPC definitely means to say sooner or later, even if the player interrupts with some other comments first; optional quips are things he might say, but is equally happy to skip if the conversation moves in another direction instead. Similarly, “immediate” means he’ll say this next even if there are other things on the list — it goes in at first position — while “postponed” means the quip should instead go at the end of the list.

Between them, these cover a number of different ways an NPC could want to go on with the conversation:

Read the rest of this entry ?

h1

Sims 3: The Tragedy of Fred Chilton

July 21, 2009

Fred was one of three adopted children of Howard, a chubby, rigorously logical Sim with absolutely no romantic ability. As a young adult, Howard frankly assessed his odds of having a family through dating and marriage and decided to start adopting instead. And I have to say that he wasn’t a bad father: played many games of chess with his eldest, Lily, teaching her logic; spent time tutoring his younger two, Fred and Dandelion. He made a much better parent than his half-sister Kumquat, who left her daughter Rose to grow up more or less dependent on various maids and babysitters.

Fred's last bath But one day in his early teens, Fred had a mishap: he tried to take a bath when already extremely tired. This led to a strange, locked-in cycle: he kept passing out from exhaustion, then resuming his bath, then passing out again… and he never seemed to finish either task. Eventually he also needed to use the bathroom and get something to eat, but these other needs couldn’t overpower the bath/passing out cycle. I tried various things to snap him out of it — gave him different instructions, tried to cancel some of his orders, sent Dandelion in there to talk to him (and, I hoped, rescue him). No good. After a solid day or so of bathing, Fred started to starve to death, and I reconciled myself to his doom. I did throw Rose a birthday party, hoping that that would at least catch his attention — Sims seem to come running from all over when there’s birthday cake to eat — but instead there was just the rather ghoulish spectacle of the family and friends partying down while upstairs Fred scrubbed and splashed away his last three hours, his starvation clock ticking away.

But then… miracle! The grim deadline came and went. Fred was now officially dead (his only remaining task being “Expire”, his starvation clock counted all the way down) — but he went on bathing! I had a new idea, a pleasingly gothic idea. I got out the build tools and bricked Fred’s bathtub away so that none of the rest of the household would see him. He could go on bathing eternally in there, I figured, but everyone else’s life would go on.

Screenshot-11Alas, that bricking up turned out to be all that was needed to snap Fred back to awareness. He got out of the tub and died in his tiny, airless, lightless enclosure. I had to sledgehammer a hole in the new brick wall so that he could be found by his relatives and laid to rest properly.

Howard was devastated. A team of local scientists sent an offer: they would let Howard see Fred again, if Howard brought Fred’s remains to the lab. In the dead of the night, Howard crept out of the house with the coffer containing Fred. The procedure went ahead. The scientists said it was a failure, but Fred’s ghost materialized and began hanging around the house, with all his old goals and skills still working. Except for the transparency and the creepy eyes, the guy’s as good as new.

The first thing Revived Fred did was have a big meal.