Chris Crawford on Interactive Storytelling (26 page)

BOOK: Chris Crawford on Interactive Storytelling
12.94Mb size Format: txt, pdf, ePub
 

So the new formula becomes:

 

Inclination[BreakUp] = 52 – 46 – 25

 

This yields a -19 inclination to break up. Lucky for Boyfriend#1!

 

Subtracting 25 makes it a little harder for her to break up with Boyfriend #1. Now, if you want to model the decision to break up more precisely, you could throw in factors for her
Loyalty
, but if you want to keep it simple, this formula works.

 
Multiplicative Weighting Factors
 

Suppose an Actor must decide whether to respond angrily to an insult (a Retort), and you have already decided on the two factors that will control this decision: the affection the Actor feels for the insulter, and the anger the Actor feels as a result of the insult. Therefore, the inclination equation looks like this:

 

Inclination[Retort] = Anger[Actor] - Affection[Actor, Insulter]

 

If the Actor’s
Anger
is 18 and his
Affection
for the
Insulter
is 28, the formula gives this result:

 

Inclination[Retort] = 18 – 28

 

This yields -10; in other words, the Actor is not going to issue a retort.

 

But suppose you decide this formula isn’t quite right; the
Affection
component isn’t as important as the
Anger
component. You want to ensure that the
Anger
component plays the primary role in the decision, and the
Affection
component plays only a secondary role. To do this, insert a multiplicative weighting factor, like so:

 

Inclination[Retort] = 2 × Anger[Actor] - Affection[Actor, Insulter]

 

Here’s how the numbers work out now:

 

Inclination[Retort] = 36 – 28

 

This formula gives you an answer of +8, so the actor using this formula will issue a retort.

 

This weighting factor doubles the weight that Anger plays in the decision. Of course, you could accomplish almost exactly the same thing by halving the weight of the Affection component, like so:

 

Inclination[Retort] = Anger[Actor] - Affection[Actor, Insulter] / 2

 

See how the numbers work out to the same result:

 

Inclination[Retort] = 18 – 14

 

The result is +4, still positive, so the Actor still issues a retort.

 

You could also make the Anger component even stronger by using a larger multiplicative weighting factor, like so:

 

Inclination[Retort] = 5 × Anger[Actor] - Affection[Actor, Insulter]

 

Inclination[Retort] = 90 – 28

 

This means the Actor would retort even if Affection were much greater.

 

The general rule is that if two factors are being added or subtracted, and one deserves more weight than the other, multiply the more significant factor by a number.

 
Exponential Weighting Factors
 

What if two factors are being multiplied or divided? How do you weight one in relation to the other? Using a multiplicative weighting factor won’t work because it multiplies both factors equally. For example, suppose that, for some crazy reason, you multiplied the two factors in the previous example. Here’s what a multiplicative weighting would yield:

 

Inclination[Retort] = 5 × Anger[Actor] × Affection[Actor, Insulter]

 

Plugging in the numbers, you get

 

Inclination[Retort] = 5 × 18 × 28 The result equals +2520.

 

Suppose the situation is reversed, however. Suppose the Actor’s Affection value isn’t 28 but 18, and the Actor’s Anger is 28. Then the formula would look like this:

 

Inclination[Retort] = 5 × 28 × 18

 

The result equals +2520, exactly the same as the previous example. Multiplying by 5 doesn’t do anything to alter the weights of either factor; it just makes the end result five times larger. Therefore, this formula does nothing to distinguish the two factors; you need something else. That something else is an exponentiation, like so:

 

Inclination[Retort] = (Anger[Actor]
2
) × Affection[Actor, Insulter]

 

Here’s the formula with the numbers plugged in:

 

Inclination[Retort] = 18
2
× 28

 

The result is 9072. This time, however, if you reverse the values of the two variables (making
Anger
28 and
Affection
18), the formula gives this result:

 

Inclination[Retort] = 28
2
× 18

 

This formula yields 14,112—not the same as in the previous example. By squaring the
Anger
, you have doubled its overall weight in the formula. As with multiplicative factors, you can achieve the same effect by applying its opposite to the other factor:

 

Inclination[Retort] = Anger[Actor] × √(Affection[Actor, Insulter]

 

Now run through the same reverse-the-variables test. The first case (18 Anger and 28 Affection) looks like this:

 

Inclination[Retort] = 18 × √28

 

The result is 95.25.

 

The second case (28 Anger and 18 Affection) looks like this:

 

Inclination[Retort] = 28 × √18

 

The result is 118.79.

 

Here’s what happened: When Affection went down and Anger went up, the answer went up, not down; it followed the Anger, not the Affection. In other words, taking the square root deemphasizes a variable.

 

You can achieve more or less weighting by using larger or smaller exponents. However, be careful here: Exponentiation can yield astoundingly large numbers!

 
how to Set Values
 

How do you decide how big a weighting factor should be? There’s no simple answer to this question; it’s fundamentally an artistic decision. How prominently should a painter highlight the nose in a portrait? How many lines of dialogue should a playwright give a character? How close to the camera should a character stand? There are no mathematical answers here; you simply make a first guess
and see whether the formula behaves the way you want it to. Again, you don’t have to find the perfect formula, just one that’s close enough to satisfy your own artistic goals.

 

There’s one major difference between other artists and storybuilders: Other artists can experiment and immediately see the results of their efforts. A film director can position actors and look through the camera to see the frame that results; if it doesn’t look right, the director can reposition them. A painter can fiddle with the nose, step back, and evaluate the result; if it doesn’t look quite right, the painter can fiddle some more. A storybuilder working on an inclination equation, however, can’t step back and look at the formula and determine whether it looks right; the only way to try it out is to run a rehearsal and see how the decision comes out.

 

The difficulty of fine-tuning inclination formulas is another example of the degree of abstraction required to build storyworlds. It simply doesn’t do to write down a formula and leave it at that; the storybuilder must instead think in terms of huge ensembles of rehearsals. If you tell the computer to run through a storyworld a thousand times, what percentage of the time will an Actor reaching this decision choose the Retort option, for example? It’s easy if the Actors almost always go one way or the other; clearly, the inclination equation is out of balance and requires adjustment. But what if 25% of the Actors facing this situation choose the Retort option? This could be a good balance if all the Actors choosing the Retort option are fairly hot-headed people and all the Actors rejecting the Retort option are more level-headed. There’s no way to know from the single statistic, however. Therefore, the single statistic emerging from multiple rehearsals gives a rough gauge of the inclination equation’s performance, but for fine-tuning a storyworld, more detail is required.

 

You can obtain this detail in several ways. One way is using a statistical analyzer that permits detailed statistical analysis of a database of rehearsals. This technique permits the storybuilder to examine the circumstances under which each decision was made. For example, a storybuilder working on the problem described previously could examine all cases in which the inclination equation was used, the identity of each Actor who used it, and what that Actor’s Anger and Affection values were at the moment the decision was made. This detail would give the storybuilder the information needed to perform finer adjustments in the inclination equation.

 

There’s another way to adjust inclination equations, much more tedious but perhaps workable. This technique requires the storytelling engine to run through rehearsals in which the storybuilder can intervene after every decision and provide some correction. In this way, the storybuilder experiences the storyworld directly, and every time an Actor makes a decision, the storybuilder can look at the list of options, check the inclination values the actor produced, and then indicate which inclination values are too low and which ones are too high. The engine would then adjust the weighting factors correspondingly.

 

The difficulty with this technique is that thousands of rehearsals would be required to get the weighting factors balanced properly. Moreover, because this process would extend over many months, decisions the storybuilder makes late in the process might contradict decisions made early in the process.

 

I will discuss some of these issues in more detail in
Chapter 17
, “Development Environments.”

 
Wrapping Up
 

The two most fundamental components of all languages are nouns and verbs. Nouns are about existence; verbs are about action.

 

Choice lies at the heart of interactivity. You choose between verbs, not nouns. Therefore, good interactivity design requires verb thinking (thinking about things in terms of what they do, not what they are).

 

First rule of software design: Ask “What does the user DO?”

Other books

Lie by Moonlight by Amanda Quick
Charley's Web by Joy Fielding
Faith on Trial by Pamela Binnings Ewen
A Spell of Winter by Helen Dunmore
Absurdistan by Gary Shteyngart
Deadly Little Lies by Jeanne Adams
Some Assembly Required by Lex Chase, Bru Baker
Bucking Bear (Pounding Hearts #3) by Izzy Sweet, Sean Moriarty
Widows' Watch by Nancy Herndon