I would really like to try to implement a menu based dialogue system after spending the other day trying to wrap my head around how I might even start with such a system I felt pretty lost. Ideally I would like to try and make something myself so that I understand how it works and how best I can implement it for what I’m working on, so while I have seen some recommendations for extensions that can do this, I’m more looking for how to learn to do this. I couldn’t find anything in the documentation that really delved into this besides the brief mention in 7.8 of writing with inform. Are there any examples, documentation extensions to learn from, forum topics, general tips/strategies for approaching this etc that people would recommend? I’m fairly afraid I’m getting into something that is over my head but I feel like dialogue is such an important part of the game I want to make that I want it to be perfect.
I’m interested in learning this too, and I also want to code it myself instead of using an extension, and I also feel overwhelmed by it!
I think the examples (like Farewell and Sweeney) in 7.8 are a good starting place, and they’ve been really helpful to me. It sounds like there’s something you want to do that isn’t covered there. Could you elaborate a little? I’m very interested in seeing what responses you get!
There are a bunch of extensions that implement menu-based dialogue, so the easiest thing would probably be to just check them out for inspiration, much like one tends to do with the Recipe Book. The two I’ve futzed around with are Quip-Based Conversations by Michael Martin (which depends on his Reactible Quips extension), and Hybrid Choices by AW Freyr – both have good documentation, including example games, in addition to the extension code itself.
You can find both – as well as many other examples – at the Friends of i7 extension page.
Emily Short wrote a post called Conversation that I found helpful as an overview when I started thinking beyond Inform’s basic Ask/Tell. She talks about all forms of conversation input including menu conversations.
@AmandaB think the big differences I’m stuck on compared to the systems like Sweeny is having the player forced to choose an option, not relying on initiating conversation through ask to begin with instead having npc’s initiate it, and how to have the conversation able to flow through several choices and even come back to certain points.
I guess what I’m going for is more of a sort of CYOA style at least within dialogue where the conversation would go on for several choices the character has to make before they can take other actions. It could just be I’m having a hard time wrapping my head around what exactly the Sweeny example is doing, and how it could be expanded, but I think it’s the sort of flow of conversation that I’m most confused about, of how to cut out the ask portions and to have the player make further choices.
Thank you @billmaya and @DeusIrae I do think my biggest hurdle is just trying to wrap my head around what exactly is being done by these examples and how that compares to what I want so that I can begin to bridge that gap, so I really appreciate the recommendations for further examples.
My understanding is the Extensions Library page isn’t being updated anymore, so the Friends of i7 page is where the most up to date versions of extensions can be found, FYI. I think there are also some efforts by @Zed and others to test and update older extensions for the current release of Inform. Anyway it’s a great resource, and I’d be wary of using the Library at this point since I think it’s pretty out of date.
All correct, though other projects have distracted me for some months…
Conversation is always the weakest point of a parser game for me, for exactly the reasons you describe. Even in the best examples, it always feels on-the-rails. I see many tables in your future as you try to make more CYOA style dialogue. Best of luck to you and I’m excited to see what you come up with.
Thanks! I’ll be sure to share stuff here as I learn. I suspect it’ll take me quite a few days of tinkering though.
For what it’s worth, I found Quip-Based Conversations relatively easy to grok, and after reading it over a couple of times I felt like I could have hacked together my own solution using its example (though for my last game I didn’t have enough time to do that and hit the IF Comp deadline so I just used it out of the box, which led to wrestling with some of its timing foibles). Hybrid Choices I found harder to understand, though I can’t pinpoint a specific reason for that. Anyway I’d definitely look at multiple examples to see what resonates!
I’ve probably written a version of this post repeatedly, but here’s another.
The main reason there’s no great extension for menu-based dialogues is because Inform 7 is pretty hardbaked around the parser input loop and world model. In theory, if I want the player to choose an option and press a key, I don’t want the game to be looking for any other input. Relatively speaking, it’s a real pain just to ask Inform to check if the player typed “2” or “3”, etc., and have it screen out and NOT react to every other typed response in the world at that moment. This is why Hybrid Choices and the like have learning curves. They are dancing with Inform’s preferred way of doing things, which doesn’t suit this task of taking and reacting to, say, a choice limited to pressing a key between 1 and 4, at all. 8-bit computers running BASIC were better at this.
You can actually write a whole CYOA game or dialogue sequence using the ‘press any key hack’ (I mean, the mechanism whereby Inform asks for a keypress is sort of a hack) but the main problem with this method is there’s no automatic UNDO support/mechanism. Inform won’t remember any of these keypresses… if it was a person, it’d just be pining for them to end so it could run the next turn via the parser. Since it’s not a person, it is in fact completely blind to what you’re doing (feverishly grabbing keypresses and printing text in response) inbetween two standard turns.
You can see the ‘press any key hack’ method of writing an entire Inform choice game in action in this project of mine called Time Warp:
This is a game I wrote on an Apple II when I was 12ish. I ported it to Inform 7 just to test/demonstrate a way you could program a whole CYOA game in Inform without using the parser or world model at all. If it turns out that this suits a whole project or part of one, it’s very easy to do.
Elsewhere, Zarf made this neat extension called Unified Glulx Input (UGI), which facilitates taking input for the standard turn loop in many ways. It can wait for a typed line, or just a single keypress, or a mouse click, etc. This, to me, was the key needed for the menu extension problem. It makes it easy to screen out the world while taking keypresses and still have the game’s turn process advance.
A few years back I was working on an extension designed on top of UGI to make creating CYOA /dialogue menus easy-ish. I got a long way, but it got out of control, and also had a low-level tech flaw. I eventually rewrote bits of it for my WIP, where my system’s working great, but unfortunately it’s not very portable. I don’t have time to extricate it to an extension for now. I can summarise its overhead approach by saying that each choice or dialogue node is an Inform rule.
I’ve put out two tiny games that were previously to have been demo projects for the abandoned extension (Captain Piedaterre's Blunders - Details and Dragon's Pass - Details). The former is a game driven entirely by keypresses or links. The latter combines parser input with one choice menu and a few dialogue menus.
I think there are a couple of morals of my story. One is: don’t forget about the ‘keyboard hack’ method. It can be great for easily creating short dialogues or menus, but it’s not going to hold up a whole game that has a world model.
My other suggestion is, if you want to program your own CYOA / dialogue system, I would start by breaking out Unified Glulx Input. I don’t think people should continue to battle with the default Inform input system for this task, for it is a battle! No disrespect to Hybrid Choices, btw. It’s allowing people to do this job amongst many others it can do, but it’s not the best way to do this particular job.
I have used Hybrid Choices in a few games and actually helped AW Freyr with its initial development. The latest version might not be in the IDE, so I have uploaded it here and it is available in the topic linked below.
Hybrid Choices allows the author to freely switch between parser and choice-mode (the player types a number to choose a menu option in choice mode) and choice contents are formatted like “pages” and the choices presented and the pages they lead to can also be offered or not based on normal I7 rules and the syntax of the extension.
I ended up using Eric Eve’s conversation extensions for a updated version of a previously released game. It was just my personal preference but I found his set of extensions structured so I could learn how to use them bit by bit.
Unfortunately, they don’t allow an option for menu selections but, combined with Jon Ingold’s Flexible Windows, it has worked out quite nicely.
I’ve used the Michael Martin conversation systems (in The Chinese Room and Calm). It’s a bit clunky, but as it’s table-based you can always write the content in a spreadsheet and then paste it into the table of quips. With this you can produce typical menu-based conversation as you might see in an old Lucasarts game.
Thanks again to everyone who’s recommended different systems, I feel like I’ve learned a lot. For those interested here’s a rough draft/first try at a tech demo for what I took away from looking at these dialogue systems and trying to make it my own. Any sort of feedback is also appreciated especially if there are different sorts of mechanics one might want to see in this kind of system that I could try implementing to learn more, as well to know if anything is broken.
Lab is a room. Gwen is a person. Gwen is here. Current Topic is a text that varies. The index is a number that varies. Index is 1. A person has a table name called Master Dialogue. Current Conversation Table is a table name that varies. The Current Conversation Table is the Table of Blankness. Current Speaker is a person that varies. Blank person is a person. Table of Blankness E a text Table of Gwen's Dialogue Master Conversation Speech Choice Table Selected "test" "I am testing!" Table of Gwen's Dialogue Test 0 "weather" "It sure is weather outside!" Table of Gwen's Dialogue Weather 0 Table of Gwen's Dialogue Test Choice Response next topic Selected Label "Can you test the quanitity of choices you can provide the player?" "Sure thing, let me show you!" Table of Gwen's Dialogue Quantity 0 number "What can you tell me about the quality of the choices?" "A whole lot I'm sure!" Table of Gwen's Dialogue Quality 0 -- Table of Gwen's Dialogue Weather Choice Response Selected next topic Label "Yep it sure is weather." "Weather!" 0 a table name number "What?" "Huh?" 0 -- -- Table of Gwen's Dialogue Quantity Choice Response Selected next topic label "This choice doesn't have any follow up choices, so choosing this ends the conversation, this could be a goodbye or just a choice with a response from the character that doesn't merit more choices." "Goodbye" 0 -- a number "You can have as many of these dead end choices as you want." "Goodbye" 0 -- -- "Otherwise a dialogue choice can lead to another dialogue choice." "I can say my response to you and then allow you to continue the conversation with more choices, this is done by having another table where all of your response to what I say are listed, just like all of your previous choices were listed in a table associated with your first choice." 0 Table of Gwen's Dialogue Continued Quantity -- Table of Gwen's Dialogue Continued Quantity Choice Response Selected next topic label "You can have as many diaogue choices as you want here's 10 just for show." "This was obviously the best choice, I think thats all I have to say about quanitity though, feel free to ask me about Quality if you haven't already." 0 -- a number "1" "You chose 1." 0 Table of Gwen's Dialogue Numbers -- "2" "You chose 2." 0 Table of Gwen's Dialogue Numbers -- "3" "You chose 3." 0 Table of Gwen's Dialogue Numbers -- "4" "You chose 4." 0 Table of Gwen's Dialogue Numbers -- "5" "You chose 5." 0 Table of Gwen's Dialogue Numbers -- "6" "You chose 6." 0 Table of Gwen's Dialogue Numbers -- "7" "You chose 7." 0 Table of Gwen's Dialogue Numbers -- "8" "You chose 8." 0 Table of Gwen's Dialogue Numbers -- "9" "You chose 9." 0 Table of Gwen's Dialogue Numbers -- "10" "You chose 10." 0 Table of Gwen's Dialogue Numbers -- Table of Gwen's Dialogue Numbers Choice Response Selected Next Topic Label "And 10 more choices! These could all be seperate choices in their own table but I just had all the choices lead to this one table to go easy on myself." "That sure is a lot of choices!" 0 a table name a number "1" "You chose 1." 0 -- -- "2" "You chose 2." 0 -- -- "3" "You chose 3." 0 -- -- "4" "You chose 4." 0 -- -- "5" "You chose 5." 0 -- -- "6" "You chose 6." 0 -- -- "7" "You chose 7." 0 -- -- "8" "You chose 8." 0 -- -- "9" "You chose 9." 0 -- -- "10" "You chose 10." 0 -- -- Table of Gwen's Dialogue Quality Choice Response Selected Next Topic Label "With this example I'll show how text can be looped." "I'm looping." 0 Table of Gwen's Dialogue Quality a number "Continue to the next example." "I was having fun with that! Fine, lets continue." 0 Table of Gwen's Dialogue Quality Continued -- Table of Gwen's Dialogue Quality Continued Choice Response Selected Next Topic Label "The dialogue choices you make can be remembered both within and outside of dialogue, along with how many times you have chosen it." "You've seen this response [the selected in row 1 of Table of Gwen's Dialogue Quality Continued][if the selected in row 1 of Table of Gwen's Dialogue Quality Continued is 1] time[otherwise] times[end if] before." 0 Table of Gwen's Dialogue Quality Continued 2 -- Table of Gwen's Dialogue Quality Continued 2 Choice Response Selected Next Topic Label "[if the selected in row 1 of Table of Gwen's Dialogue Quality Continued 2 is greater than 1]And we can change this choice one final time.[otherwise if the selected in row 1 of Table of Gwen's Dialogue Quality Continued 2 is 1]This is still the same entry in the table but it now detects you've selected it more than once.[otherwise if the selected in row 2 of Table of Gwen's Dialogue Quality Continued 2 is greater than 0]Several conditions can be used to vary the text of a choice.[end if]" "[if the selected in row 1 of Table of Gwen's Dialogue Quality Continued 2 is 0]Select this choice again to see it change.[otherwise if the selected in row 1 of Table of Gwen's Dialogue Quality Continued 2 is 1]Even the response can be changed with the same conditions.[otherwise if the selected in row 1 of Table of Gwen's Dialogue Quality Continued 2 is greater than 1]But that's all of the changes to the text I have, however I can now change the next topic entry of this choice so that instead of looping, it'll continue on to the next topic.[go to topic Table of Gwen's Dialogue Quality Continued 3 from row 1 of Table of Gwen's Dialogue Quality Continued 2][end if]" 0 Table of Gwen's Dialogue Quality Continued 2 a number "[if the selected in row 2 of Table of Gwen's Dialogue Quality Continued 2 is 0]Choices can be hidden until certain conditions are met, the order of hidden choices doesn't matter. The first choice of this table isn't available until you've selected this choice once.[Otherwise if the selected in row 2 of Table of Gwen's Dialogue Quality Continued 2 is 1]Conditions can also be used to hide choices." "[if the selected in row 2 of Table of Gwen's Dialogue Quality Continued 2 is 0]This choice loops so you can select the now revealed choice to continue the demonstration.[Otherwise if the selected in row 2 of Table of Gwen's Dialogue Quality Continued 2 is 1]Now there will only be 1 choice again." 0 Table of Gwen's Dialogue Quality Continued 2 -- Table of Gwen's Dialogue Quality Continued 3 Choice Response Selected Next Topic Label "That's all for now." "If you think there's any sort of uses/mechanics that I haven't implemented feel free to let me know!" 0 A table name a number To say go to topic (next - a table name) from row (# - a number) of (conversation - a table name): choose row # in the conversation; now next topic entry is next. The Master Dialogue of Gwen is Table of Gwen's Dialogue Master. Understand "[a number]" as choosing. Choosing is an action applying to one number. Instead of doing something other than choosing when the command prompt is "You respond>": say "[The Current Speaker] eagerly awaits your reply." Check choosing a number when the current conversation table is the table of blankness: say "There is currently no one to respond to."; stop the action. Check choosing a number less than 1: say "Natural numbers only"; stop the action. Check choosing a number greater than index: say "Please choose from the choices available."; stop the action. Carry out choosing a number(called the number chosen): choose row with label of the number chosen in the Current Conversation Table; say "[The Current Speaker] says, '[Response entry]'"; say paragraph break; increase the selected entry by 1; now index is 1; if there is next topic entry: now Current Conversation Table is next topic entry; repeat with i running from 1 to the number of rows in the Current Conversation Table: choose row i in Current Conversation Table; unless choice entry is "": say "[bracket][index][close bracket]. [Choice entry]"; say line break; now label entry is index; increase index by 1; otherwise: now the current topic is ""; now the current speaker is blank person; now the current conversation table is the table of blankness; now the command prompt is ">"; Starting conversation about is an action applying to one topic. Understand "Start conversation about [text]" as starting conversation about. Check an actor starting conversation about a topic: if "[the topic understood]" is not a conversation listed in the Master Dialogue of the actor: say "[The actor] has nothing to say about [the topic understood]"; stop the action. Carry out an actor starting conversation about a topic: now Current Speaker is the actor; now Current Topic is the topic understood; choose row with conversation of Current Topic in the Master Dialogue of Current Speaker; say "[Current Speaker] says, '[Speech entry]'"; say paragraph break; now Current Conversation Table is Choice Table entry; repeat with i running from 1 to the number of rows in the Current Conversation Table: choose row i in Current Conversation Table; say "[bracket][index][close bracket]. [Choice entry]"; say line break; now label entry is index; increase index by 1; now the command prompt is "You respond>". Talking to is an action applying to one thing. Understand "Talk to [someone]" as talking to. Carry out Talking to Gwen: try Gwen Starting conversation about "test".
I don’t think this system is anything too original but I think where things are now should be good enough for me to use in the game I’ve been trying to make (and which this project has stolen most of my attention from). And it has been a great learning opportunity. I also hope to grow it out a bit more, especially with some ideas I want to work on for other sorts of systems and associated tech demos once I finish this game such as NPC planning to initiate conversations, moods influencing choices, responses and follow up topics, information/fact tracking for both PC and NPC’s and certain actions being able to interrupt certain choices. I think the way I’ve set things up keeps room open for these things, but they are probably a bit of a ways off for me as I return my focus to the game.
This isn’t really intended as an extension or anything really but if anyone does find any of this helpful feel free to steal from it.
What you describe is the holy grail of conversation systems! The closest in Inform 7 is some combination of Eric Eve’s intertwined suite of conversation extensions, or the extension “Threaded Conversation” that was initially begun by Emily Short as a crowdsourced conversation and knowledge system for the game Alabaster and has been developed and maintained by Chris Conley because it is genuinely useful but has its own set of pitfalls.
Not discouraging your efforts, but those extensions could potentially be useful to mine for inspiration on your own solution.