Chris Crawford on Interactive Storytelling (35 page)

 

A small set of these extensions to your sublanguage could increase its vocabulary without taxing players.

 
Grammars
 

Language equals vocabulary plus grammar. That’s a bit of a simplification, but for the purposes of sublanguage construction, it’s adequate. A grammar specifies the rules for putting words together into a sentence. Natural-language grammars are horridly complicated: The conjugations, declensions, voices, moods, and gender overwhelm the beginner, and then there are all the exceptions! English has, for example, sink-sank-sunk and drink-drank-drunk but wink-winked-winked. Clearly, you want to design a sublanguage with a clean grammar.

 

But what’s the best grammar to use? A cleaned-up version of English grammar? Spanish has a particularly clean grammar; perhaps it would be a better starting place. Fortunately, a clean, simple grammar already exists, and it appears to be wired into our brains. Throughout history, a number of revealing linguistic experiments have been carried out as the unintended consequence of immigration. If a large body of immigrants occupies a new territory, not as conquerers but as laborers, the first generation of their children finds itself handicapped by the incompatibility of the language spoken at home and the language of their playmates. In this social context, where neither language can assert itself as dominant, the children invent a new language called a
creole
. This new language borrows vocabulary from both parent languages, but its grammar is always the same,
no matter where or when it’s created. The core structure of creole grammars is simple: There are no conjugations, declensions, voices, moods, or genders. All these functions are handled with
auxiliary words
. For example, a hypothetical creole based on English might include statements such as:

 

 

Auxiliary words are simply tacked onto the existing words to modify their meaning. As Mr. Spock would say, “crude, but effective.”

 

A completely different approach relies on creating a square matrix with vocabulary words along the top and the left side. Each cell in the matrix represents one pairing of a column-word with a row-word; if that cell is marked True, the column-word is permitted to follow the row-word; otherwise, it is not. In
Figure 10.1
, for example, the row-word “Go to” can be followed only by the column-word “the house.” This approach to grammar is even cruder than a creole grammar, but it’s simpler to understand and implement.

 

A word connection matrix’s worst problem is its inadequacy to address contextual factors that might change the word sequence. You can partially address this problem by including special-case rules for these contextual factors. A clean sublanguage might have only a few such special-case rules, but as the language grows, the number of special-case rules explodes.

 
Meaning
 

Interactive storytelling demands a sublanguage that both computers and humans can use. The program must be able to read any valid expression in the language and understand what it means. But what does “understand” mean in this context? Surely a computer can’t understand language in the way that people do. What it can do in response to a sentence is change a storyworld’s components. Each sentence must somehow generate changes in the values of variables in the storyworld; presumably these changes will then trigger responses from other Actors.

 

 

FIGURE 10.1:
A word connection matrix.

 

Thus, “meaning” in the narrow sense I’m using here is nothing more than the changes engendered in the storyworld triggered by a verb. The verb “make” means a new prop will be entered into the database of props; its properties can be partly derived from other components of the sentence containing the verb. For example, “Joe makes a box” means that a new box is placed into the Prop database owned by Joe, and that the components used to make the box are removed from the Prop database.

 

This example, however, is simple because it’s merely mechanical. Verbs with more dramatic import demand more complex treatment. For example, consider the verb “to love.” It takes an Actor as its direct object. Carrying out this verb requires a change in the relationship between subject and direct object. It could also affect the relationships of each Actor with other Actors.

 

But it gets worse: What about verbs whose significance depends wholly on the context? The verb “invite home” provides an example. If this event takes place on the schoolgrounds where little Molly invites little Tommy over to her house, it means one thing; if Molly and Tommy are unattached 20-somethings, it could mean something entirely different. You can solve this problem by carefully
choosing the vocabulary to ensure that no ambiguities of this kind result. You can also tighten your storyworld to make sure it’s not populated by both schoolchildren and young singles.

 
Inverse Parsing
 

People automatically speak natural language in complete sentences. You frame the sentence in your mind, and then speak it as a unit. So when computers came along, programmers just naturally assumed people should talk to computers the same way they talk to each other—except they then designed abstruse languages too difficult for people to remember. There’s no reason that sentences in dramatic sublanguages must be created in their entirety; a sentence can just as easily be assembled word by word.

 

Why does it matter whether you construct sentences word by word or as entire units?

 

The difference lies in players’ interactions with the computer. If they compose sentences as complete units, they must be certain that every single word in the sentence is perfect. Suppose that a player is only 90% certain of each word in a seven-word sentence; the odds are even lower that the sentence as a whole will be correct. Requiring players to submit sentences in their entirety compounds the uncertainties.

 

The biggest benefit of word-by-word composition is that the computer can present players with a menu of all appropriate words that can be entered at that point in the sentence. Instead of guessing from memory, players need only select from a menu—a much simpler task.

 

But menus are so slow to use!

 

Pull-down menus are slow because they require three actions for each selection: click on the menu title, drag down to the menu item, and release. Menus for this kind of interface (which I call an
inverse parser
) can be kept front and center. The player looks directly at the menu choices, identifies the best choice, and clicks on it—just one action instead of three. The inverse parser then recalculates the sentence and, using the sublanguage’s grammar, determines all the words that might
fit into the next open slot. It displays those words in a new menu that replaces the previous menu.

 

What if there are so many words that they don’t fit into the available space?

 

Then you make the menu a scrolling window. This occurrence will be rare; with a vocabulary of less than 2,000 words, it’s unlikely that more than a dozen will fit into most slots. Indeed, the context of the situation often narrows down the choice to but a single word, which the inverse parser can fill in automatically for players.

 

Suppose you’re playing as Tom, occupying a Stage with just one other person: Diane. You enter “Tom” as the first word in the sentence (after all, Tom is the only Actor you control), and then you choose the verb “asks.” The inverse parser can figure out that Diane is the only Actor the question can be directed to, so it fills in “Diane” as the direct object of the sentence. This kind of one-word choice happens all the time with inverse parsers.

 

Every sublanguage must have grammar, and every sentence must be contextually appropriate. If you use a regular parser, you must write code that analyzes the grammatical and contextual appropriateness of players’ input—but you’ll have to disappoint players with error messages explaining that their sentence input makes no sense. With an inverse parser, you use the same code that analyzes grammatical and contextual appropriateness, but you execute that code
before
players make their decisions, not
after
they’ve made their mistakes. With an inverse parser, grammatical and contextual errors are impossible.

 
Semantic Networks
 

Realizing the problems inherent in language comprehension, computer scientists have been assembling a variety of
semantic networks
, which are data structures that connect words by their various meanings. The most advanced semantic network is WordNet
2,
also known as a
lexical database
: a huge database of more than 150,000 English words with all their logical connections. Each word is connected to each of its synonyms, antonyms, hypernyms, hyponyms, meronyms, and holonyms. You already know what synonyms and antonyms are. A
hyponym
is a specific instance of the word in question; thus, “spaniel” is a hyponym of
“dog.” A
hypernym
has the reverse relationship, so “mammal” is a hypernym of “dog.” A
holonym
is an object that includes the word in question as one of its parts; thus, “body” is a holonym for “toe.” The reverse case is that “toe” is a
meronym
of “body.”

Other books

Martha Washington by Patricia Brady
Sammy Keyes and the Skeleton Man by Wendelin Van Draanen
A Finely Knit Murder by Sally Goldenbaum
The Man Who Loved Children by Christina Stead
Ladder of Years by Anne Tyler
My Immortal by Erin McCarthy
Friends Like Us by Siân O'Gorman
The Fury by Alexander Gordon Smith


readsbookonline.com Copyright 2016 - 2024