Any interest in an Inform 7 conversation tree creation tool?

Hmmm, I keep thinking about not posting this, but I guess it’s time to hit submit before I can change my mind!!!

This thread:

https://intfiction.org/t/help-me-clean-up-my-source-code/5173/1

Got me to thinking about how tedious and bug-prone (at least for me) it is to model conversation trees using a text editor.

I may or may not (I am loathe to blather about vaporware that never gets finished after something shinier appears to distract me) have started throwing together a tool for creating and editing dialog trees, and then exporting them to Inform 7 extensions for inclusion in a story. The idea is, you’d import a runtime library extension (containing the code to walk the trees and do something with them) and a bunch of these exported conversations, and then just fire them off in your game and not have to fool with much else.

A vaporous screenshot to illustrate the type of tool of which I speak:

I only mention it because it is not polished or feature-complete as-is. I certainly have interest in using it for my own stuff, but if anyone thinks that a tool like this could be useful to the larger IF community, I will try to keep myself from being distracted long enough to polish it up a little and put the sourcecode on a public repo somewhere.

The application is written in Java Swing (though it uses some language features only found in Java 1.6 and later), so it should be able to run on any desktop-paradigm computer capable of running JavaSE6. It is inspired by the dialog editor in the NWN Aurora toolset; the same sort of dialog tree editor that’s been done countless times before.

It uses a json structure for its internal file format, so that other tools can easily hook into the format if desired. The export model is modular, so it could easily export to other IF languages too, given someone to code an export module for the desired language. And although the tree model makes heavy use of TreeNode extensions, I’ve tried to make the presentation and storage layers relatively modular too, so that one could port it to Android, cloud storage, etc if desired. I am still working on the runtime library.

I hope I don’t seem big-headed or self congratulatory or anything with this post. (Look what IIIIII made, lol.) In truth, I’d have kept it to myself, except that the interest of others in my various pro bono free-time projects is what keeps me working on them.

So yeah, if you think something like this would be useful to you, please let me know, and hopefully that will motivate me enough to “make license plates” and polish it enough to release. Also please mention if you’d like to see some sort of flatter mode as well, for ask/tell/show conversation models and the like.

Far from it! I could be wrong, but I think this is the first such tool to appear in the IF world (certainly there are similar tools outside it like you mentioned), despite more than a couple of threads asking for something like this in the past. Which extensions are you targeting at the moment?

Thank you for the kind words!

One of my own devising at the moment (the runtime library mentioned above). I poked around and looked at some of the existing conversation extensions, but (though I think they are all very fine extensions!) none that I ran across seemed very easy to export to, at least not with the structure I am using at the moment.

That is, they appear to have a flag on each node, where it can be turned on or off by some external code. I am looking to insert the phrases that decide whether a node is evaluated in-line in the node itself, instead (that is what the “Appears When” field in the screenshot is for). I am also trying to allow nodes to execute a phrase of code when they are evaluated, and sometimes I think that phrase may not work in brackets and will have to be hooked into some other way.

I expect that most of my difficulties in figuring out how to hook into existing conversation extensions is mostly a result of my own ignorance. I’d like to believe that I am fairly accomplished at software engineering using more traditional languages, but this I7 stuff is still quite a learning experience for me. But what better why to learn than to jump in on the deep end? :stuck_out_tongue:

I expect that, due to my aforementioned ignorance, I’ll have to continue to plan to target the aforementioned runtime library initially. Once I’ve got that working, hopefully the act of implementing it will have provided me with the experience needed to more easily decipher the existing conversation extensions, and then I’ll be able to write export modules for them, too.

One thing that worries me is all of the nodes are probably being translated into “objects” with “properties” in I6. I am afraid that may mean that the properties (or at least the pointers) are not being put into high memory in the zMachine, even though all of the conversation data is static. I’m afraid that may gobble up a ton of dynamic memory (though I am not exactly sure where in the memory map Inform puts things). I have tried to figure out how to put it all into tables, so that everything will go in high memory, but I can’t figure out a non-overly-complex way to represent a doubly linked tree structure (where a node has one parent node and zero or more child nodes) in a table. But maybe I am just suffering from delusions of premature optimization. >_>

In the Z-machine, object data, property data, and table (array) data all goes into dynamic memory. There’s nothing you can do about this. The only data that goes above the 64k line is compiled code and compressed string data.

(I am simplifying a little, but not for it to matter for your purposes.)

Ohhh hmmmmm…

Does this become problematic in practice? Or am I just making things more complicated than they need to be?

I suppose nowadays folk just switch to Glulx when the z-machine runs out of writable memory, if they haven’t already selected it to begin with. :stuck_out_tongue:

I suppose I could track the current conversation node with a list of numbers (similar to a TreePath in Swing, I reckon), and generate the whole conversation as a great big nested switch block to fall through, and it wouldn’t be /terribly/ inefficient, but… Eww. D: Hehe.

Could be handy for a lot of people and I am surprised that it does not already exist. This could be a good opportunity for you. Personally, though, I never let the player directly manipulate the course of the conversation, because [omit long screed] I just don’t think it’s fun.

I wonder if there is already a tool that allows one to ferret text from a ‘conversational tree’, matching not on the relatively contentless remark the main character was just told to blurt in the immediately previous command, but rather, matching on the full content of the main character’s actions over all the previous commands?

P.S. I feel the same way as you regarding talking about my unfinished projects; I cringe every time, but I do it anyway because this place needs more people who are willing to talk aspirationally, and that is hard to do if there is a taboo against mentioning things-that-don’t-exist.

Hmmmm, hmmmmmmmmmmm…

I am not sure!

It seems to me… Just a gut feeling, so to speak, all just my (highly uneducated) opinion, like… Hmmm… Not sure how to say it, lol.

Like you’ve got a ball, balanced in the middle of a seesaw. At one end is Narrative, and at the other end is Simulation. I believe that they are diametrically opposed, because that is their nature. Like:

Narrative (in this context) encompasses things like rising tension, pacing, things under the author’s direct control, like reading a novel or watching a movie. But it is railroady, and that railroadyness is an inseparable part of that facet of the medium, due to the basic nature of narrative. The output of narrative is plot.

Simulation (in this context) encompasses things like the flow of the river based on the prevalent weather, where the monsters are and what sorts of monsters they are, how many hit points they have, what happens when you try to tie the rope to that fencepost. It’s like playing Dwarf Fortress, Sim City, or old school AD&D with the random dungeon appendices out of the back of the DMG. It produces unexpected results, to the delight of the player. But it is also highly random, or at least so complex as to appear random. And that randomness is also inseparable from that facet of the medium, due to the basic nature of simulation. The output of simulation is spontaneity.

I believe that one can roll that ball back and forth along the seesaw until it rests in a position that suits one’s personal taste. But one cannot fold the seesaw in half to get the full helping of both. Strengthening the role of plot inescapably thins spontaneity, and vice-versa.

I also believe that the input that makes narrative engaging is human intuition, the intuition of the author creating the plot, and that’s something a machine is just incapable of providing. Sure, we have things like the Mythic GME and other such sets of rules that allow rising tension, twists, pacing, and such to be generated in a systematic fashion, but it still requires human intuition to interpret the results, again something that the computer can’t provide. And if we try to let the player interpret those inputs and feed them back into the system, so as to leverage that human intuition in the absence of an Author, then the player just becomes the Author instead, the ball once again rolls somewhat firmly onto the narrative side, and spontaneity ceases.

Hmmm, I am grousing on and on. Lol. Anyway, I think the best position for an adventure game is somewhere close to the middle, without stretching too far towards either end, so that the consumer of the Fun (hopefully) is in a situation where the inherent problems at both ends tug at the player with somewhat equal force, keeping things in equilibrium between reading a novel and playing Sim City.

To that end, I think one could perhaps track a certain number of author-determined values that are adjusted as play proceeds, and then are used as the input to a fuzzy system or something that governed the operation of some kind of narrative plot/conversation gadget containing a set of pre-authored results to be chosen among. Balancing the ball near the middle as it were. But I do not think it is possible to create something that could produce anything approaching engrossing narrative with something that tries to consider everything that has come before, things that the author hasn’t designed in. That’d be folding the seesaw in half. I feel that one would end up with the sorts of nonsensical (in the context of the actual topic) results often produced by chatterbots and web search engines. And that would break the spell that we try to ensorcel the player with.

I don’t know. I’m not trying to poke holes in your suggestion at all, or anything like that. I think I may just not be smart enough to see the big picture and maybe I’m just stuck riding my seesaw, kinda like that dude riding the bomb in Dr Strangelove (yee haw). But… I dunno. Lol. That’s just my take on all that!

Looks like you did a pretty good job, anyway.

This assumes one narrative track. There could be multiple tracks. There could be many multiples, so many that it is difficult for a casual player to distinguish from an open field. That’s the sweet spot we need to aim for, IMO. Forget multiple endings: try multiple beginnings.

I find that the more random a simulation feels, the worse a sim it is, because it doesn’t feel like I can really affect anything. I prefer it when it feels like I can exert some control over the situation. And that means something needs to be overtly, explicitly, non-random. So it is not really true, I think, that simulation works in diametrical opposition to narrative. It only actually ‘works’ at all, when some narratives are included. Far from interfering with simulation, narrative is actually the only thing saving sims from being snoozefests. But they are fractured narratives, multiple possible chains of cause-and-effect running in parallel and providing for each other mutual escape trajectories (since you can’t actually exit one narrative without entering another), and therein, I believe, lies the key to breaking this dichotomy.

I agree with you on this. The point would not be to have the machine make the decision as to what part of the player’s history is relevant to the conversation. The point would be to make it way easier for a human to make that decision.

It is the IF author’s job to do just that. This is the challenge that we undertake; we just need better matching tools that consider the concept of environmental variables from a different perspective – one from which it is much easier to write complex multivariate conditionals and hold multiple parallel streams of them in one’s mind simultaneously, while making sure when making any changes that each possible stream preserves a coherent narrative, along with rules for injecting players into and removing them from certain narrative streams based on their simulative play.

Good points! I am too tired at the moment to do much thinking (darn real life interfering with Slack), but…

Maybe we ought to spin this off into another thread and see if we can figure out how to model it! :open_mouth:

(I am a tiny bit afraid of scaring people away from the original topic of this one if we become too, erm, vociferous in discussing it in this one! :laughing: )

I had a blurb here with some modeling ideas, but… I’ll revisit that once I’ve had a nap and my brain is working less badly than usual! Lol.

Hey Leaf, man oh man would something like this be useful to me. In my ongoing projects, I use a combination of both of Michael Martin’s fine menu-based conversation extensions (Reactable Quips and Quip-based Conversations). At the moment it is pretty much impossible to get any sense of the conversation-tree with just the tables, and when i have the very long or complicated conversations I end up with a handful of vast tables with no clear way of seeing how different parts interact with one another. If I could use an external conversation-tree builder for conversation, I’d be tempted to move away from Michael Martin’s efforts.

No probs. Sorry, didn’t mean to hijack. (As for modelling it, I’ve been on it. I have something similar in the works as a kind of glue for my transmedia stuff which I will probably take forever to complete, so anyone reading who is intrigued by my ideas should definitely NOT hold off implementing things to see what I do first, because it could be a while.)

Does this require the use of any extensions, such as Conversation Framework?

Clearly you haven’t tried ADRIFT:

Not at the moment. Though I’m still working on the runtime library.

Actually, that is a lie. I’ve been busy finishing the last of my job before my contract runs out and haven’t worked on it at all since the beginning of the week.

I’m probably doing things the hard way, implementing my own flavor of conversation runtime, but… I need the learning experience of doing so to get better with I7. :stuck_out_tongue_winking_eye:

Neat.