ADRIFT Forum


The place to discuss the ADRIFT Interactive Fiction toolkit

Conversation System Tutorial - Part 2 (Medium)

This forum is the place to discuss the older ADRIFT versions 3.9 and 4.0.

Please refer to the ADRIFT 4 Manual for more information.

Postby David Whyld » Mon Jan 17, 2005 11:38 pm

Conversation System Tutorial - Part 2 (Medium)

The demo for this tutorial can be found at: http://www.shadowvault.net/conv2.taf


This tutorial follows straight on from part 1.

In part 1, we had a very basic conversation system which consisted of the player speaking to a character and the character responding with a series of set answers. It was of limited use because the character would give the same response every single time he was asked the question and there was no variation to spice things up. The conversation also ended each time the player had spoken to the character and had to be restarted again to question him about another subject.

In part 2, we’ll add a few other conversation options as well as a loop which will allow the conversation to continue without the need for the player to type talk to bob each time.

1. First things first. Open up the conv1 file from last time and rename it conv2.

2. Go to the task called 1 - 10bob - the weather and change the text in the Message upon completion box to:

"Oh, it's fine. Bit cloudy," says Bob.

1) "Don’t you like it when it’s cloudy then?"
2) "I agree. I've never been fond of clouds myself."
3) "Let me ask you something else."


Before, the conversation ended immediately after Bob had spoken his line – ”Oh, it’s fine. Bit cloudy,” says Bob.. This time, the conversation can continue with three further options for the player to choose from.

3. Go to the Actions tab and change the variable con to 11. This means that when the player speaks to Bob now, Adrift checks the variable, finds that it has changed, and makes Bob respond with a different set of responses to whatever the player says.

4. Next we need to create more tasks for each of the conversation options. Go to the 3 - 10bob - adventure games task and duplicate it three times. Change:

First duplicated task

From 3 - 10bob - adventure games to 1 – 11bob – don’t you like it when it’s cloudy then? {You can abbreviate this as you see fit. After all, it’s just a reminder for you to keep track of everything. Adrift will ignore this line so whatever you type here is fine.} Press return and change the 3 to a 1.

Change the text in the Message upon completion box to Bob’s response to being asked “Don’t you like it when it’s cloudy then?”:

”No, not really,” says Bob. “I've never been a big fan of clouds.”

1) "Let me ask you something else."


Go to the Restrictions tab and change the variable con from 10 to 11 (10 was its value when the player first spoke to Bob; 11 is the value of the second set of conversation options).

Go to the Actions tab and change the variable con from 11 to 12. (The second set of conversation options has now ended and so the con variable is set to 12 which as you will see in a minute contains the same basic information as the original talk to bob task. This allows the conversation options to continue indefinitely.)

Second duplicated task

From 3 - 10bob - adventure games to 2 – 11bob – I agree. I've never been fond of clouds myself Press return and change the 3 to a 2.

Change the text in the Message upon completion box to Bob’s response to being told “I agree. I've never been fond of clouds myself.”:

”Can’t say I blame you,” says Bob. “Nasty things.”

1) "Let me ask you something else."


Go to the Restrictions tab and change the variable con from 10 to 11.

Go to the Actions tab and change the variable con from 11 to 12.

Third duplicated task

From 3 - 10bob - adventure games to 3 – 11bob – Let me ask you something else. Leave the 3 on the second line alone as nothing changes here.

Change the text in the Message upon completion box to Bob’s response to being told “Let me ask you something else.”. Now this differs from the previous two options as Bob’s response to this question returns the conversation to its initial state. So the box contains:

”Hello,” says Bob. “What do you want to talk about?”

1) “The weather.”
2) “Politics.”
3) “Adventure games.”


This brings about the loop mentioned earlier. The conversation can now continue indefinitely because each time the player types 3 in the second set of conversation options, they are redirected back to the first set, thus starting the sequence all over again.

Go to the Restrictions tab and change the variable con from 10 to 11.

Go to the Actions tab and change the variable con from 11 to 10.

5. Of the three options from the second set of conversation options, the third one is taken care of but the other two still need some work on. Option 3 took care of itself by changing the con variable back to 10 (the beginning of the conversation with Bob), but options 1 and 2 were set to 12. So another task has to be created to handle this.

6. Duplicate the 3 – 11bob – Let me ask you something else task. Change the 3 – 11bob – Let me ask you something else to 1 – 12bob – Let me ask you something else. Change the text in the Message upon completion box to:

”Hello,” says Bob. “What do you want to talk about?”

1) “The weather.”
2) “Politics.”
3) “Adventure games.”


Go to the Restrictions tab and change the variable con from 11 to 12.

Go to the Actions tab and change the variable con from 12 to 10.

7. The first branch of the conversation has now taken place. The player can speak to Bob and ask him about the weather and Bob will reply with three separate responses. Further complexity can be added by duplicating the above so, perhaps, when Bob is asked whether he likes it when it’s cloudy, you might change it to:

”No, not really,” says Bob. “I've never been a big fan of clouds.”

1) "What about rainbows?”
2) “Lunar eclipses, they're great!”
3) “Let me ask you something else."


All you need to do each time is remember to change the con variables in the Restrictions and Actions tabs to follow each branch of the conversation.

8. Of course, the first set of conversation options has three different things Bob can be asked about: the weather, politics and adventure games. The weather topic now has a decent set of responses, but politics and adventure games are still with their basic single responses. By following steps 2-7 above, it should be a fairly simple task to achieve a similar set of responses to these two options. A few things to remember:

* Keep a careful track of the con value. 10 was kept for the initial conversation opener; 11 for the second set of conversation options; 12 for the loop when the player says “Let me ask you something else.” and the conversation begins again. So 13 could be used for the questions about politics, 14 for adventure games and so on.

* Bear in mind you can only use each number once. So if you have questions about politics set to 13, you need to have adventure games set to something different otherwise if the player asks about adventure games he’ll get the response for politics. And get very, very confused.


The above conversation system is an improvement on the first but is still pretty basic. Bob’s responses are unchanging and will remain so no matter how many times the player questions him. In part 3, we’ll look at varying responses that should add a bit of realism to the conversation system.
David Whyld
 
Posts: 6918
Joined: Sat Dec 18, 2004 5:15 pm
Location: United Kingdom
Points: 35

Return to ADRIFT 3.9 and 4.0

Who is online

Users browsing this forum: Google [Bot], MSN [Bot] and 7 guests