January 8th, 2018

I’ve spent the last three days digging myself into ever-deeper holes. I’ll need to go over some theory to explain this. The starting point is the directed graph. This is an architecture in which nodes (positions) are connected by arrows (either one-way or two-way). Text adventures are all directed graphs. There are a great many mathematical refinements and special forms of directed graphs. If you like that kind of thing, splurge on the cited article.

State variables

Many games are organized as directed graphs with state variables. The simplest example of this is Pac-Man. The maze is a directed graph. The primary state variable is the set of eaten/uneaten dots that Pac-Man eats. The four ghosts present more complex state variables. Basically, as the player moves through the maze gobbling dots, he changes the values of the state variables. The player wins by setting all the dot state variables to false.

Text adventures are similar in structure. Each “room” in a text adventure is a node in the directed graph. The player uses the arrows in the directed graph to move from room to room. Inside each room, the player can change the values of state variables through various actions. An important point about text adventures is that the state variables are almost always boolean.

Interactive storytelling and Sappho

The full-blown SWAT technology created a complex weighted directed graph. A weighted directed graph differs from a regular directed graph in that the arrows leading out of a node have different weights — the likelihood or ease of using the arrows emerging from that node is variable. One arrow might have a high weight, and be more likely to be taken, while another arrow might have a low weight, and so will be taken rarely. The key notion in the SWAT technology is that the weight of each arrow is calculated based on personality and relationship variables. In SWAT technology, this weight is called the *inclination* to make that choice.

Text adventures have no weighted graphs because all decisions are made by the player. There is only one player. But in interactive storytelling, there are other characters who make dramatically significant decisions, and their decisions must be made on the basis of some algorithm. That’s what the inclination formulae are for.

The killer problem

The killer problem with Sappho’s technology is that none of the player’s decisions don’t affect the future direction of the story. The Encounter technology was never intended to be used standalone; it is only an adjunct to the larger game. It alters other character’s perceptions of the player, nothing more. So how do I adapt this system to make a playable standalone interactive storyworld?

Somehow the player’s decisions must change the weights of the arrows. That would require a major revision in the engine, but the larger problem is how to do so. Currently Encounters are chosen randomly, with some logical constraints. The directed graph must be completely redefined.