11.4. Scoring

| Chapter 11: Out Of World Actions and Effects |

| 11.4. Scoring

Not every work of IF allots a numerical score to the player: for some authors, this emphasises the idea of a game rather than a narrative. The simple sentence

> Use no scoring.

abolishes the concept. Otherwise, Inform will provide built-in support for a single number measuring progress ("score"), and will expect to measure this against a maximum possible ("maximum score", which can either be set by hand or worked out automatically from a table of ranks).

In a game in which scoring exists, the player may choose to turn score notifications (such as "[Your score has just gone up by one point.]") on or off. The commands to do this are NOTIFY ON and NOTIFY OFF; the actions are called switching score notification on and switching score notification off. In the event that we need to amend the behavior of notification, we could do so by adding, removing, or modifying the elements of the check and carry out rulebooks for these commands; as in

> Check switching score notification off:
> if the turn count is less than 10:
> say "You are still a novice, grasshopper. Allow your teacher to give you advice until such time as you are ready to go on alone."

If we wish to change the wording of the default message ("[Your score has..."), we may want to resort to extensions available from the Inform website which allow access to all the default messages in a game.

An especially insidious style of bug allows the player to type the same sequence of commands over and over, earning score endlessly for the same insight, and to avoid this it is usually safest to write source like:

> After taking the Picasso miniature when the Picasso miniature is not handled:
> award 10 points; say "As they say in Montmartre: dude!"

We might also write our condition with "for the first time", like so:

> After jumping for the first time:
> award 5 points;
> say "Boing! That was certainly entertaining."

But we should be careful not to use "for the first time" in scoring situations where it's possible for the player to try the action but fail. Inform counts even unsuccessful attempts towards the number of times an action is understood to have occurred, so if the player tries to jump and fails, his "for the first time" will be used up and he will never receive the score points.

If there are many "treasure" items like the Picasso miniature, it is best to be systematic, as in No Place Like Home. Bosch takes another approach to the same idea, by creating a table of point-earning actions that the player will be rewarded for doing; the FULL SCORE command will then play these back.

Mutt's Adventure demonstrates how we might add a scored room feature, such that the player earns a point when he first arrives at a special room.

A single number does not really sum up a life, or even an afternoon, and Goat-Cheese and Sage Chicken and Panache offer more detailed citations. Works that are more story than game may prefer to offer a plot summary of the player's experience to date in lieu of more conventional scoring.

Finally, Rubies provides a scoreboard that keeps track of the ten highest-scoring players from one playthrough to the next.

137
| Example No Place Like Home Recording a whole table of scores for specific treasures. |
WI

219
| Example Bosch Creating a list of actions that will earn the player points, and using this both to change the score and to give FULL SCORE reports. |
WI

136
| Example Mutt's Adventure Awarding points for visiting a room for the first time. |
WI

269
| Example Goat-Cheese and Sage Chicken Implementing a FULL SCORE command which lists more information than the regular SCORE command, adding times and rankings, as an extension of the example given in this chapter. |
WI

166
| Example Panache Replacing the score with a plot summary that records the events of the plot, scene by scene. |
WI

If we have a plot that branches and has multiple kinds of outcome, we might well want to assemble these into a plot summary in place of the more traditional score. One way to approach this is to build the scene information into a table, adding information when each scene ends. We begin with a bit of setup: "Panache" The player is in a room called Beneath Roxane's Balcony. Christian is a man in the Balcony. "Christian stands in a spot of moonlight and tries to avoid too obviously glancing at the shadows that conceal you." The description of Christian is "Like you, Christian loves Roxane. Unlike you, he is handsome enough to receive her favor in return. He is the beauty to your brain." Roxane is a woman in the Balcony. "Above you in the night is Roxane." Roxane can be wooed, skeptical, confused, or annoyed. Roxane is skeptical. The description of Roxane is "The brightest, the most radiant of women -- and in love with an utter fool." Empty Street is a room. "No one is about at this hour, all alone under a pale moon." Telling someone about something is speech. Asking someone about something is speech. Answering someone that something is speech. This next portion borrows from the Advanced Actions chapter to allow us to command Christian to do things: A persuasion rule for asking Christian to try speech: persuasion succeeds. Carry out Christian answering someone that something: now Roxane is wooed; say "'[noun], [the topic understood].'" Carry out Christian answering the player that something: say "Christian parrots your words back to you." instead. Carry out Christian telling a skeptical Roxane about something: now Roxane is confused; say "Christian turns to [the noun]. 'I must tell you about [the topic understood],' he says, and comes to a halt, looking at you for further direction. Perhaps you'd better give him exact lines to say. Surely he can't mess up an instruction like 'say hello to Roxane.'" instead. Carry out Christian asking a skeptical Roxane about something: now Roxane is confused; say "'So,' says Christian nervously to [the noun]. 'Did you know about [the topic understood]?' But Roxane merely seems puzzled." instead. Carry out Christian telling a confused Roxane about something: now Roxane is annoyed; say "Christian begins rambling on witlessly about [the topic understood]." instead. Carry out Christian asking a confused Roxane about something: now Roxane is annoyed; say "Christian puts another confused question about [the topic understood]." instead. And now we have enough material to begin writing the scenes: Courting Roxane is a scene. Courting Roxane begins when play begins. Courting Roxane ends in success when Roxane is wooed. Courting Roxane ends in failure when Roxane is annoyed. When Courting Roxane ends in success: record "Seduction by Proxy" in the Table of Events; say "Roxane, deeply moved by this sentiment, invites Christian up to her balcony. He scrambles up the ivy and disappears into her bedroom; the last thing you hear is a girlish giggle from above."; remove Roxane from play; remove Christian from play; move the player to Empty Street. When Courting Roxane ends in failure: record "Ruining Christian's Chances" in the Table of Events; say "Roxane sighs heavily and goes back into her room, slamming the door behind her. 'Thanks very much,' says Christian to you, striding off down the street."; remove Roxane from play; remove Christian from play; move the player to Empty Street. Sulky Ramble is a scene. Sulky Ramble begins when Courting Roxane ends in success. Sulky Ramble ends when the time since Sulky Ramble began is 2 minutes. When Sulky Ramble ends: record "Wandering the Streets, Sulking" in the Table of Events. Every turn during Sulky Ramble: say "You find yourself kicking fenceposts quite without thinking about it." Smug Ramble is a scene. Smug Ramble begins when Courting Roxane ends in failure. Smug Ramble ends when the time since Smug Ramble began is 2 minutes. When Smug Ramble ends: record "Wandering the Streets, Exultant" in the Table of Events; say "Of course, you will regret this soon enough." Every turn during Smug Ramble: say "You find yourself smiling fiercely at the moon." To record (occurrence - text) in (target table - a table name): choose a blank row in the target table; now the event entry is the occurrence. Table of Events event "A Duel of Insults" with 30 blank rows. The plot summary rule is listed instead of the announce the score rule in the carry out requesting the score rules. This is the plot summary rule: say "The Plot So Far: [paragraph break]"; let act number be 0; repeat through the table of Events: increment act number; say " Act [act number]: [event entry][line break]". Test me with "christian, ask roxane about love / christian, say your breath smells like ripe taleggio to roxane / score / z / z / score".

431
| Example Rubies A scoreboard that keeps track of the ten highest-scoring players from one playthrough to the next, adding the player's name if he has done well enough. |
WI

Previous | Contents | Next