Understanding Story Solver

Story Solver does two things: it’s a tool for designing quests, and it’s a tool for making sure those quests work.

Story Solver works under the principle that progression through a branching story can be represented in two ways:

  • the actual state of the game, meaning the individual variables that determine whether or not a certain fact is true (for example, a variable called “dragon is slayed” that becomes true when the player slays the dragon.)
  • the overall structure of the story and how different parts of the game’s progression relate to each other (for example, when the dragon is slain, the village has been saved.)

Quest Graphs

A quest graph is a flowchart that represents the high-level state of a story.

In Story Solver, you build quest graphs that describe the high-level structure of the story. As part of doing that, you create variables that represent the individual facts that are involved, and link them to the story graph.

Here’s a simple example of a quest where the player is given the quest “Deal With The Dragon”. When the player successfully slays the dragon, the game sets the variable $dragon_is_dead to true, and the player enters a new state, “Village is Saved”.

flowchart TD

a("Deal With The Dragon")
b("Village is Saved")

a -->|"<code>$dragon_is_dead</code>"| b

At the start of the quest, the player’s objective is to slay the dragon. When the variable $dragon_is_dead is true, the player has saved the village.

Quest graphs are a useful way to design the structure of a game’s story on its own. With a quest graph like this, you can use Story Solver’s Explore Mode to visualise what happens to the story state when the $dragon_is_dead variable is toggled on and off - the quest’s state moves from “Deal With The Dragon” to “Village Saved”.

Logic Solvers

The real power of Story Solver comes from the fact that we can turn this relationship upside down: if the village is saved, it must be the case that the dragon is dead. So, we can work in reverse: you can tell Story Solver that you want to be in the “Village Saved” state, and it will figure out that $dragon_is_dead must be true.

The way it does this is by taking the structure of your quest graph and producing a collection of logical equations.

For example, given this quest graph:

flowchart TD

a("Deal With The Dragon")
b("Village Saved")
c("Reward Received")

a -->|<code>$dragon_is_dead</code>| b
b -->|<code>$returned_to_village</code>| c

We can represent ‘Reward Received’ is complete as the equation:

$dragon_is_dead && $returned_to_village == true

The only possible values that $dragon_is_dead and $returned_to_village can have is true, so Story Solver sets that state - either by showing it to you in Explore Mode, or by sending it to the game.

The really exciting thing about Story Solver is that this also works with complex, intertwining quests. Let’s update our example: in addition to saving the village by slaying the dragon, let’s also add in another possible outcome. We can befriend the dragon, but only if we’ve slain another enemy: the necromancer.

flowchart TD
hunt_dragon("Deal With The Dragon")
dragon_dead("Dragon Dead")
befriend_dragon("Befriend the Dragon")
dragon_befriended("Dragon is Befriended")

hunt_necro("Hunt the Necromancer")
necro_dead("Defeated the Necromancer")

hunt_dragon -->|<code>$dragon_is_dead</code>| dragon_dead
hunt_dragon -->|<code>$necromancer_is_dead</code>| befriend_dragon
befriend_dragon -->|<code>$dragon_is_befriended</code>| dragon_befriended

hunt_necro -->|<code>$necromancer_is_dead</code>| necro_dead

If we want to be at the story step “Dragon is Befriended”, we can follow the connections up through the quest graph and note that it depends on both $dragon_is_befriended and $necromancer_is_dead being true. We can also note that in the other quest, the story state “Defeated the Necromancer” also depends on $necromancer_is_dead being true. This means that if we’ve befriended the dragon, then the necromancer must be dead - there’s no possible way to befriend the dragon without doing it. Thus, when we ask Story Solver to put the game in a state where we’ve befriended the dragon, it will automatically defeat the necromancer at the same time.