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

> Some games provide a FULL SCORE command that gives more information about the player's achievements than SCORE alone. Supposing we wanted to include a FULL SCORE in our game that gave the kind of score reading described in this chapter: "Goat-Cheese and Sage Chicken" The story headline is "An interactive recipe" Table of Tasks Achieved
> Points | Citation | Time
> 3 | "sauteeing onions" | a time
> 3 | "reconstituting apricots"
> 1 | "flattening chicken"
> 1 | "unwrapping goat cheese"
> To record (T - text) as achieved: choose row with a citation of T in the Table of Tasks Achieved; if there is no time entry: now time entry is the time of day; increase the score by the points entry. Requesting the full score is an action out of world. Understand "full" or "full score" as requesting the full score. Carry out requesting the full score: if the score is 0, say "You have achieved nothing towards supper." instead; repeat through the Table of Tasks Achieved in reverse time order: say "[time entry]: [citation entry] ([points entry])." Table of Rankings
> Score | Rank
> 0 | "Rank Amateur"
> 2 | "would-be Bobby Flay"
> 5 | "Alton Brown"
> 8 | "Julia Child"
The Kitchen is a room. The description of the Kitchen is "Equipped with many familiar friends: refrigerator, stove, oven; countertop; cabinet for pans and bowls, and a drawer for your tools." The stove is scenery in the kitchen. It is a supporter. The oven is a container. It is part of the stove. It is closed and openable. The stove's switch is a device. It is switched on. It is part of the stove. The oven's dial is a device. It is switched off. It is part of the oven. A thing can be heatproof. Instead of putting something which is not heatproof on the stove when the stove's switch is switched on: say "You catch yourself just at the last minute: not a good idea to put [the noun] directly on the stove while it's turned on." Instead of switching on the stove, try switching on the stove's switch. Instead of switching off the stove, try switching off the stove's switch. Instead of switching on the oven, try switching on the oven's dial. Instead of switching off the oven, try switching off the oven's dial. Before switching on the oven's dial when the oven is open: say "(closing the oven so that it will heat properly)[command clarification break]"; try closing the oven. The frying pan is a heatproof unopenable open container on the stove. The cabinet is a closed openable container in the kitchen. It is scenery. It contains an open unopenable container called a mixing bowl. It contains a portable supporter called a platter. An open unopenable heatproof container called a Calphalon baking dish is in the cabinet. The baking dish has the description "One of those marvelous pieces of kitchen equipment which goes on the stove or in the oven, as you will. The chief thing is never ever to touch it when it is hot, since the handles are metal and the heat retention excellent." The counter is a supporter in the kitchen. It is scenery. The kettle is a heatproof openable closed container on the counter. Some water is in the kettle. The water can be cool, warm, or boiling. The printed name of the water is "[water condition] water". The refrigerator is a closed openable container in the kitchen. It is scenery. Understand "fridge" as the refrigerator. An ingredient is a kind of thing. Some onions, some apricots, and some sage are ingredients on the counter. A chicken breast, an egg, and goat cheese are ingredients in the refrigerator. The goat cheese can be wrapped, snipped open, or unwrapped. The printed name of the goat cheese is "[goat cheese condition] goat cheese". The sage can be unwashed, clean, or julienned. The sage is unwashed. The printed name of the sage is "[sage condition] sage". The apricots can be dried, reconstituted, or chopped. The apricots are dried. The printed name of the apricots is "[apricots condition] apricots". The chicken breast can be whole, flattened, stuffed, rolled, coated, browned, or baked. The printed name of the chicken breast is "[chicken breast condition] chicken breast". The onions can be unpeeled, peeled, diced, sauteed, or burnt. [The printed name of the onions is "[onions condition] onions".] The can of chicken broth is a closed container on the counter. The bottle of white cooking wine and the bottle of Thurston Wolfe PGV are a closed containers in the refrigerator. The description of the Thurston Wolfe is "A Washington State Pinot Gris-Viognier, 2003. It is said to have 'peach aromas', and, startlingly, the untutored person can detect these without resorting to fantasy. (It is also supposed to possess a delicate perfume and a moderate body; the label author at least stopped short of 'good sense of humor and likes long walks on the beach')." Understand the commands "wash" and "rinse" as "clean". Instead of rubbing the unwashed sage: now the sage is clean; say "You rinse off the sage. There -- ready to slice." Instead of cutting the sage: say "You'd need to have a knife in hand, first." Instead of cutting the clean sage when the player is carrying the butcher knife: now the sage is julienned; say "You slice the sage into thin strips." Instead of cutting the unwashed sage: say "It came from the garden, so it won't have any strange chemicals on it, but you should still give it a rinse for dirt and bugs and so on before using it." Instead of doing something other than examining or rubbing with the unwashed sage: say "It needs to be washed off." Understand "peel [something]" as peeling. Peeling is an action applying to one thing. Instead of peeling the unpeeled onions: now the onions are peeled; say "You tear away the shining outer skin of the onions, leaving them pale and nekkid. Poor things." Instead of cutting the diced onions: say "That seems unnecessary now." Instead of cutting the sauteed onions: say "Too late; you're well past that stage." Instead of cutting the burnt onions: say "There's no rescuing 'em -- the carbon isn't going to flake off, you know." Instead of cutting the unpeeled onions: say "It would help to peel them first." Instead of cutting the peeled onions: say "You'd need to have a knife in hand, first." Instead of cutting the peeled onions when the player is carrying the butcher knife: now the onions are diced; say "You dice the onions neatly. Your own skill brings tears to your eyes." Instead of opening the goat cheese: try peeling the goat cheese instead. Instead of peeling the unwrapped goat cheese: say "The goat cheese is already unwrapped. (Stay focused, stay focused...)" Before peeling the wrapped goat cheese when the shears are held by the player: try cutting the goat cheese. Instead of peeling the snipped open goat cheese: now the goat cheese is unwrapped; record "unwrapping goat cheese" as achieved; say "Ah, success. The goat cheese is now free of its packet." Instead of peeling the wrapped goat cheese: say "It would help to have a pair of scissors or something -- the packet resists being torn." Instead of cutting the goat cheese: say "No need, at this point." Before cutting the wrapped goat cheese when the shears are not held by the player and the shears are visible: say "(first picking up the shears)[command clarification break]"; try taking the shears. Instead of cutting the wrapped goat cheese: say "Something to cut with would be useful." Instead of cutting the wrapped goat cheese when the shears are held by the player: now the goat cheese is snipped open; say "You neatly snip through the packaging with the shears." Instead of examining the whole chicken breast: say "It is still entire and has yet to be pounded flat." Instead of examining the flattened chicken breast: say "It has been hammered to a thickness of about a half inch. (The recipe said a quarter inch but you're pretty sure it was joking. You have never been able to achieve a quarter inch.)" Instead of attacking the whole chicken breast: say "You need something heavy enough to flatten it with." Instead of attacking the whole chicken breast when the player is holding the wooden mallet: now the chicken breast is flattened; record "flattening chicken" as achieved; say "You hammer away at the chicken breast, turning all your aggressions into culinary goodness. Several minutes pass. When you are done you have a broad flat chickeny pancake suitable for wrapping about a stuffing." Before printing the name of onions: say "[onions condition] ". The drawer is an openable closed container. It is part of the counter. A tool is a kind of thing. A spatula, a spoon, a wooden mallet, some shears, and a ball of twine are tools in the drawer. A butcher knife is a tool carried by the player. Understand "scissors" as the shears. Instead of burning something: say "You'll have to do that the hard way." Some steam is fixed in place. "Dense clouds of steam fill the room." Some smoke is fixed in place. "Smoke is beginning to collect near the ceiling." Sauteeing Onions is a scene. Sauteeing Onions begins when the diced onions are in a hot container. Definition: a container is hot if it is on the stove and the stove's switch is switched on. Instead of touching the hot pan: say "Ow!" Scorching Onions is a scene. Preheating the Oven is a scene. Preheating the Oven begins when the oven's dial is heating. Definition: a oven's dial is heating if the oven's dial has been switched on for exactly one turn. Preheating the Oven ends when the time since Preheating the Oven began is five minutes. When Preheating the Oven begins: say "The oven begins to warm up." When Preheating the Oven ends: say "The oven beeps to inform you that it has reached the desired hotness." Every turn during Sauteeing Onions: say "The onions sizzle in the pan." Every turn during Scorching Onions: say "The onions are past their prime and are getting blacker by the moment." Every turn during Hearing the Kettle Whistle: say "The kettle continues to whistle." Instead of listening to during Hearing the Kettle Whistle: say "The only thing you can really hear just at the moment is the kettle." Instead of smelling the Kitchen during Sauteeing Onions: try smelling the onions. Instead of smelling the onions during Sauteeing Onions: say "The onions smell marvelous." Instead of opening the oven during Preheating the Oven: say "It'll never heat if you open it up while it's warming." Heating Kettle is a scene. Heating Kettle begins when the hot kettle contains cool water. Before printing the name of the kettle when the kettle is hot: say "hot " When Heating Kettle begins: say "The kettle begins to heat up." Heating Kettle ends when the time since Heating Kettle began is 7 minutes. Hearing the Kettle Whistle is a scene. Hearing the Kettle Whistle begins when Heating Kettle ends. Hearing the Kettle Whistle ends when the kettle is not hot. When Hearing the Kettle Whistle begins: now the water is boiling; say "The kettle begins to burble and whistle shrilly." When Hearing the Kettle Whistle ends: say "The kettle's screaming dies off." Idling is a scene. Idling begins when play begins. Idling ends when Sauteeing Onions begins. Sauteeing Onions ends in disaster when Scorching Onions begins. Sauteeing Onions ends in success when the onions are sauteed and onions are not in a hot container. Definition: a thing is alone if it is in a container which contains exactly one thing. Sauteeing Onions ends in mixture when the sauteed onions are not alone. When Sauteeing Onions ends in mixture: say "The mixture of things in [the holder of the onions] stops them cooking quite so fast." When Sauteeing Onions ends in success: say "Nice work with the onions." Every turn: if diced onions have been in a hot pan for ten turns: say "The onions are starting to look ready."; now the onions are sauteed. Scorching Onions begins when Sauteeing Onions ends in disaster. Scorching Onions begins when the alone sauteed onions are in a hot container. Scorching Onions ends horribly when the time since Scorching Onions began is three minutes. Scorching Onions ends in reprieve when the sauteed onions are not in a hot container. Scorching Onions ends in mixture when the sauteed onions are not alone. When Scorching Onions ends in mixture: record "sauteeing onions" as achieved; say "The mixture of things in [the holder of the onions] stops them cooking quite so fast." When Scorching Onions ends horribly: move smoke to Kitchen; now the onions are burnt. When Scorching Onions ends in reprieve: record "sauteeing onions" as achieved; say "You've got the onions off heat before they can scorch -- a good sign." Instead of taking the onions when the onions are in the pan: try taking the pan. Instead of smelling in the presence of the smoke: say "The scent of the late disaster lingers in the air." Reconstituting the Apricots is a scene. Reconstituting the Apricots begins when the dried apricots are in a container which contains boiling water. When Reconstituting the Apricots begins: say "The apricots slowly begin to plump up again." Reconstituting the Apricots ends when the dried apricots are not in a container which contains boiling water. Every turn: if dried apricots have been in a container which contains boiling water for ten turns: say "The apricots have turned plump(ish)."; now the apricots are reconstituted; record "reconstituting apricots" as achieved. Test sautee with "peel onions / cut onions / get onions / put onions in pan / get sage / wash sage / cut sage / wait / wait / wait / wait / wait / wait / wait / get pan". Test apricots with "get kettle / open kettle / get apricots / put apricots in kettle / put kettle on stove / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait / wait". Test chicken with "open refrigerator / get chicken / open drawer / get mallet / hit breast". Test cheese with "get scissors / get cheese / unwrap cheese". Test me with "full score / test sautee / full score / test apricots / full score / test chicken / full score / test cheese / full score". And... at that point you're a lot less close to being done than you think. The filling -- onions, sage, apricot, and cheese -- must be assembled and put in the chicken breasts; these tied up in string; each roll dipped in egg yolk and rolled in panko crumbs; these arranged in the Calphalon pan and baked. Then later, the whole retrieved from the oven, and the breasts transferred to a plate while we deglaze the pan and concoct the sauce with the chicken broth, wine, butter, etc. Then the chicken is sliced and plated, and the sauce poured over top. Usually one also wants a side dish or two. A number of things can go interestingly wrong in this process, of course, and implementing it would require, among other things, an intelligent management of all the possible mixtures that result.

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

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