Possible Dialog Extension

Before starting to write my first conversation, I needed to decide one thing: how am I going to code it? I wanted something a bit like Blue Lacuna, which works by topics. I browsed BL’s code, but I found it very tied up with the rest of the game’s structure. So I started reading the main dialog extensions in Inform page, but none gave me what I wanted out of the box, so I edited them to fit my needs. At the end I realized it hardly resembled the source material at all, so I thought I could share the code. I’m thinking if it’s worth to make an extension out of it. I’ll need help testing it and polishing it, of course. Short’s extension will be coming any time soon, but from what I saw while playing Alabaster, it is a completely different beast. This one is a simple chat-by-topic mechanism with memory and topic suggestions.

The source material I used was:

  • Conversation Framework and Conversation Suggestions by Eric Eve.
  • Conversation Framework for Sand-Dancer by Aaron Reed.

It needs, at the moment, the following extensions:

  • Epistemology by Eric Eve.
  • Complex Listing by Emily Short.

(Kudos to all of those above!)

So, what does it do?

Dialog Scene and the Chat-pall
Conversations have to be started by greeting an NPC, implicity or explicitly. Everytime a conversation starts, a dialog scene begins. You can create any rule you want during that scene, so that you can forbid some actions during a conversation. It also selects one NPC as the chat-pall. You can change the chat-pall at any time during a dialog scene.

Chatting by Topic
Talking is done by typing topics. Ask/tell are dropped completely.

It remembers all topics discussed, as well as the last discussed topic with each chat-pall. It is arranged so that it distinguishes a successefull discussion from an unsuccessfull one, so that if you have a customed response for an NPC refusing to adress a given topic, such topic won’t be taken as a discussed thing.

It also remembers if you ever started a conversation with a given NPC.

NPC control
It allows for mute NPCs, the ones you can’t talk to, and it monitors silent and talking NPCs.

Debugging mode
When it is on and a dialog is happening, it prints useful info, like the current chat-pall, the last discussed topic and the list of discussed topics with that chat-pall.

Topic suggestions
It prints a line with suggested topics. You can add and remove suggestions with text subs. It removes discussed things from topic suggestions automaticaly, like the Sand-Dancer extension.

Different prompt
It changes the prompt while a dialog is happening to anything. Defaults to “Talking with [the chat-pall]>”

Text Substitutions
Everything was done with text substitutions, and then a chapter with the “defaults” was added. This allows for easy override of the default answers (greeting, saying goodbye, reacting to unknown subjects, etc) to all NPCs, as well as the “choice of words” to stuff like the topic suggestions, the look of the prompt, etc.

I’ve created an example game, so you can see it working. You can switch debug mode in this version, although this won’t show in a final release.

Online play here (Edited. It had a bug and Weebly wasn’t updating the file…)
Source code here.

So now I would like to know two things: 1) if it is worthwhile to make an extension out of this, which involves documentation, etc; 2) if any of you would like to help me test it and polish it.

Hugs and kisses,

It definitely sounds useful, although to share it with others it might be worthwhile to make it into something that can be added onto Conversation Framework rather than replacing it.

I recently discovered the value of declaring extension sections “(in place of Section X in Extension Y by Z)”. You can use that method to pick and choose what aspects of other extensions you want to replace.

One comment about variable names, though, and I hope this is not rude: If you’re going to share your code with other English speakers, I recommend using the term “chat-pal,” as “pall” would more likely refer to a pallor, e.g. a pale color. Or you could stick with Eric Eve’s “current interlocutor” variable, which would help with compatibility.

This does sound useful. Thanks.

Not rude, just embarrassing. For me, not for you, of course :slight_smile:

It just points out the gazillion english I still have left to learn.

I chose “chat-pal” because I don’t like big names in variables, but I’ll have to keep “current interlocutor” if this is going to be compatible with Eric’s extensions. Speaking of which…

There are portions that could be made as stand-alone, like the debug and the memory, and Conversation Framework+Conversation Suggestions compatible.

On the other hand, it doesn’t seem likely that someone will be using both kinds of dialog in one game. A lot of the code in Eric Eve’s extensions surrounds Ask/Tell stuff (ask suggestions, tell suggestions, etc), and this one overrides all of it with an exclusive topic based approach, so it doesn’t seem having both extensions in the same story, one of which almost completely overriding the other, is resourceful wise.

I think I’ll browse all of it again to see what could be used in both frameworks. Suggestions are welcome :slight_smile: