Concurrent Dialogue Trees in Twine/Twine-likes?
December 30, 2015 12:40 PM   Subscribe

I'm hoping to build a game prototype in Twine (or a similar friendly-to-non-programmers tool) but I'm not sure if it supports what I want to do. The snag is the game is designed around two concurrent dialogue trees that the player can hop between at any point.

The player is talking (i.e. choosing from a scripted list of responses) to two different people, and switching back and forth between the two whenever they want, each time jumping back to the other conversation wherever they left it. So the game is designed around two non-overlapping dialogue trees, which I've currently got written & sketched out as two flowcharts. Hitting key moments in a tree 'unlocks' questions/responses in different parts of either or both trees.

If it were just 1 conversation it seems like this would be easy, but with 2 I'm at a loss. Can this be done in Twine in a way that allows switching conversations on the fly? If not in Twine, is there another tool that a schmuck with minimal programming experience could build this in? Thanks much!
posted by churl to Computers & Internet (4 answers total) 2 users marked this as a favorite
 
Should be trivial to create a variable for each tree, assign a value to each card, and then make a "switch" button that brings you to the correct card. I haven't tried it, mind you, and I'm sure there are more elegant ways to do it, but it should be *possible*.
posted by restless_nomad at 12:51 PM on December 30, 2015 [1 favorite]


(Caveat: I mostly know Twine 1 - do you know which version you're intending to us? As far as I know the things I'm talking about are similar in Twine 2 but I might be wrong, so this will be more relevant if you're using 1.)

This is definitely possible, but (speaking as someone else with minimal programming experience) it might be kind-of faffy!

I don't thiiiiink you can easily do anything clever like having a variable for each conversation and going "for conversation-one-variable-value-X, go to conversation-one-passage-X" - I think you have to write out all the "X"s separately:
  • first keep track of where you're meant to be in each conversation (by having a variable for that conversation that you set at the start of each relevant passage),
  • and then having a huge pile of "ifs" where you go: If conversation-one-variable-value is 2, display a "switch" that links to conversation-one-passage-2. If conversation-one-variable-value is 3, display a "switch" that links to conversation-one-passage-3
etc etc, one "if" for each passage that you might want to link to.

Obviously this is a big pain and you don't want to have this massive pile of "if"s in every single passage, since it's unwieldy and makes changes really tedious to make! So a more sensible thing to do might be to put all those "ifs" in two separate passages, "switch to conversation one" and "switch to conversation two". You can then display whichever passage is relevant whenever you want to offer the option to switch, but keep all the annoying "if this then that" bits in one place so that you can edit them easily and you have fewer opportunities to make a silly mistake.

You can then just use "if passage X has been viewed at least once" conditionals to change what's displayed in certain passages in conversation one based on whether a particular passage in conversation two has been seen, etc.

There are probably better proper-programmer ways to do it, but this is what I'd try on the basis that it won't be too much of a pain, it doesn't give me too many opportunities to mess it up, and it lets me get to the point of playing through the conversations and seeing how they work quite quickly.

Two games that it might be interesting to look at:

Raik by Harry Giles - this isn't really what you want, but it's a game where you can switch between the story being told in two different languages (Scots and English) - so it has that key "switch" point and it's neat to see how it works as a player experience.

Silver and Gold by Rosencrantz. A story told from two points of view which advance mostly independently, with some intersections, affecting each other occasionally, very like what you want to do - but on a split screen rather than going between two different screens.
posted by severalbees at 1:53 PM on December 30, 2015 [1 favorite]


Quest might be good.
posted by St. Sorryass at 11:20 PM on December 30, 2015 [1 favorite]


Thanks so much! This was just what I needed.

For posterity, here's the implementation I settled on after some trial and error. BTW this is in Twine 2 / Harlowe (and also I'm a total beginner). For 2 example characters "Alice" and "Bob":

Each "Bob" passage begins with:
(set: $BobProgress to (passage:)'s name)
\(if: $AliceProgress is 0)[(set: $AliceProgress to "Alice Intro")]
\**Talking to Bob** | (link-goto: "Talk to Alice", $AliceProgress)


And each "Alice" passage has:
(set: $AliceProgress to (passage:)'s name)
\(if: $BobProgress is 0)[(set: $BobProgress to "Bob Intro")]
\(link-goto: "Talk to Bob", $BobProgress) | **Talking to Alice**


Really the second lines are only necessary if you want to be able to jump in at any page without breaking it (i.e. while testing/bugfixing). Otherwise you could omit it and just set $BobProgress and $AliceProgress once during the first Passage.

Anyways with link-goto, I get to cheat & use the variable as the link target so I can avoid that dreaded huge list of IF statements. So every page has a standard-format toggle at the top allowing you to hop back and forth that looks like either:

Talking to Bob | Talk to Alice
or
Talk to Bob | Talking to Alice

Real happy with this! Thanks a ton
posted by churl at 11:00 AM on January 8, 2016 [1 favorite]


« Older Getting Public Radio Stations to Respond to a...   |   I just started a job organizing people's email. I... Newer »
This thread is closed to new comments.