[All] The problem of default library messages

4 views
Skip to first unread message

Cardinal Teulbachs

unread,
Dec 7, 1997, 3:00:00 AM12/7/97
to


One of the difficulties, it seems to me, in making one's text
adventure parser seem intelligent in its replies to the player, lies
in the area of default action failure messages, which most i-f systems
employ as a means of reducing the work involved in writing adventure
games. For instance, the familiar "You can't go that way" is a default
action failure message given in response to the "go <object>" command
in cases where "go <object>" doesn't yield a successful move. In the
universality of its application, it relieves the programmer of the
not-insignificant burden of having to code separate responses for
every single <object> the player might attempt to "go" (to). Likewise,
"<act>ing the <object> has no effect" and "you can't <act> the
<object>" are extremely common responses found in the library of every
contemporary text adventure authoring system that has a library.
Indeed, it will be noted by anyone, I think, who has actually written
a few of these messages, that every default failure response is in
fact of one of these two forms: either the message says to the player
(in effect) that "that's unreasonable" or that "that's impossible,"
and all failure responses are finally only a variation or an
embellishment of one of these two fundamental judgments. (With the
word "unreasonable" I here mean to encompass the sense "useless" or
"fruitless" as well.)

Note that I am not including in this characterization any responses
made in regard to administrative matters like "score" and "save" and
so on, but rather only those that are uttered by the parser in its
narrative, "storyteller" capacity. For every action a player might
unsuccessfully undertake within the game world, the parser can and
must reply either that the action is, as it were, ridiculous or that
it is impossible. And it is because there are these two potential
responses instead of just one that parsing engines can end up seeming
dumb, dumb, dumb, even when great care has been otherwise exercised to
make them seem smart, witty, and (deliver us, O Lord) even urbane.

A good, clear example of this can be seen in the case of the verb
"read." In many instances, an author will want to refuse a "read"
action because it is being attempted against something that can't by
its nature ever be read--say, a pure spirit or a sound--but then too
he'll often want to refuse such an action simply because it's being
attempted against an object that has nothing on it or in it to read--a
newly whitewashed fence or a blank piece of newsprint or
what-have-you. When only one default message is available for use, it
can become quite a tricky matter to decide which sense should carry
the day. If the author goes with the "impossible" sense, then the
illusion of intellect he's trying to create for his parsing engine
will be destroyed when the player is told, in response to a "read the
newsprint" command, that "that's impossible." Reading *blank
newsprint* is, of course, precisely impossible in the sense that it's
impossible to read words that aren't there. But reading *newsprint*,
which is what the player asked to do, isn't in itself impossible, and
for this reason our normal tendency as human beings is to respond with
something like "but there aren't any words on it" rather than the less
forthcoming and too-terse "that's impossible." Conversely, if we go
with the other sense when designing our response, we run into trouble
when the player tries to (for example) "read the idea," since the most
fundamental reason why a player can't read an idea isn't that there's
nothing written on it, but rather that nothing could ever be written
on an idea in the first place.

The question, then, is what can an author do about this state of
affairs? One solution is to make extensive use of attributes--for
instance, to make objects that are not impossible to read "readable"
and then code up one failure message for the set of "readable" objects
and another one for the set of non-"readable" objects. But the problem
with this is that, a) practically every verb will require its own
corresponding attribute to be set aside for this singular purpose, and
b) a lot more condition testing will have to be done in the verb
routines in order to determine which message is appropriate to display
under which circumstance. Alternately, one might perhaps be able to
code up the grammar tables in such a way as to do these tests "a
priori," but then in that case the number of distinct verb routines
will be exactly doubled, since there will be one routine for the case
in which the player reads a "readable" object and a separate one for
the case in which he reads a non-"readable" object. There are some
other possible approaches that have occurred to me as well, but since
I'm tired of typing and I want to hear from others on the
subject--that's the whole point of this exercise, believe it or
not--I'll shut up now and listen to what anyone who's interested in
replying has to say.

His Most Extreme Effluence,

--Cardinal T

Daniel Shiovitz

unread,
Dec 7, 1997, 3:00:00 AM12/7/97
to

In article <348aef05...@news.cwia.com>,
Cardinal Teulbachs <card...@cwia.com> wrote:
[..problems with "impossible" vs "not useful" in the parser's default
messages..]
>what-have-you. When only one default message is available for use, it
>can become quite a tricky matter to decide which sense should carry
>the day. If the author goes with the "impossible" sense, then the
>illusion of intellect he's trying to create for his parsing engine
>will be destroyed when the player is told, in response to a "read the
>newsprint" command, that "that's impossible." Reading *blank
>newsprint* is, of course, precisely impossible in the sense that it's
>impossible to read words that aren't there. But reading *newsprint*,
>which is what the player asked to do, isn't in itself impossible, and
>for this reason our normal tendency as human beings is to respond with
>something like "but there aren't any words on it" rather than the less
>forthcoming and too-terse "that's impossible." Conversely, if we go
>with the other sense when designing our response, we run into trouble
>when the player tries to (for example) "read the idea," since the most
>fundamental reason why a player can't read an idea isn't that there's
>nothing written on it, but rather that nothing could ever be written
>on an idea in the first place.
>
>The question, then, is what can an author do about this state of
>affairs? One solution is to make extensive use of attributes--for
>instance, to make objects that are not impossible to read "readable"
[..]

Verbs are something TADS does very well. In this case, the way to
handle it is something like this:

class item: thing // item is the base class for most objects in the game
...
verDoRead( actor ) = // if this function prints anything, the
{ // parser interprets it as a failure to
"You can't read that!\n"; // read the thing
}
...

class readable: item // readable is a subclass of item
...
verDoRead( actor ) = // fail, but with a different message
{
"There's nothing of interest written on <<self.thedesc>>.\n";
}


blank_wall: item // "read wall" will say "You can't read that!"
...

unimportant_newspaper: readable // "read newspaper" will say
... // "There's nothing of interest ..."

important_newspaper: readable // this gives its own message for reading
...
verDoRead(actor) = {}
doRead(actor) =
{
"You read the important stuff on the newspaper.\n";
}


The point here, I suppose, is that if the parser is written in proper
OO style, most problems of this type become relatively trivial to
solve.

>--Cardinal T
--
(Dan Shiovitz) (d...@cs.wisc.edu) (look, I have a new e-mail address)
(http://www.cs.wisc.edu/~dbs) (and a new web page also)
(the content, of course, is the same)


Jeff Hatch

unread,
Dec 7, 1997, 3:00:00 AM12/7/97
to

Cardinal Teulbachs wrote:
>
> One of the difficulties, it seems to me, in making one's text
> adventure parser seem intelligent in its replies to the player, lies
> in the area of default action failure messages, which most i-f systems
> employ as a means of reducing the work involved in writing adventure
> games.
[snip]

Imho, the real problem is that too many authors aren't willing to do
work to create intelligent replies for intelligent actions. Most
players never try to read sounds or jump over buildings. They do try to
break down locked doors or climb fences, and it's irritating when the
default response for an obvious tactic is "I don't know how to climb the
fence," or simply, "A valiant attempt."

Of course, no author can possibly think of everything, so better parser
default action failure messages would certainly be beneficial.

-Rúmil

Andrew Plotkin

unread,
Dec 7, 1997, 3:00:00 AM12/7/97
to

Cardinal Teulbachs (card...@cwia.com) wrote:

> For every action a player might
> unsuccessfully undertake within the game world, the parser can and
> must reply either that the action is, as it were, ridiculous or that
> it is impossible. And it is because there are these two potential
> responses instead of just one that parsing engines can end up seeming

> dumb, dumb, dumb [...]


>
> Reading *blank
> newsprint* is, of course, precisely impossible in the sense that it's
> impossible to read words that aren't there. But reading *newsprint*,
> which is what the player asked to do, isn't in itself impossible, and
> for this reason our normal tendency as human beings is to respond with
> something like "but there aren't any words on it" rather than the less
> forthcoming and too-terse "that's impossible." Conversely, if we go
> with the other sense when designing our response, we run into trouble
> when the player tries to (for example) "read the idea," since the most
> fundamental reason why a player can't read an idea isn't that there's
> nothing written on it, but rather that nothing could ever be written
> on an idea in the first place.

Well, my solution is to bite the bullet and write special messages for
every verb in common use and every object which could conceivably be
verbed. Don't rely on default messages at all. Leave the default message a
very terse "You can't" or "That makes no sense". Whenever I create an
object, I go through a quick checklist: the player will try to examine,
search, push, pull, turn, touch, rub, smell, hit, take, and probably put
something on or in it. Do any of those produce special responses? Then
you make sure you have fanatical beta-testers.

One weakness with this system is that if you invent a new verb, you
really have to go through every object in the game and decide whether to
give it a special response. I hate that.

Your example of an "idea" is actually a bit misleading, I think. I expect
most default responses to be meaningful for a featureless *physical*
object -- the classic white cube. If I create an "idea", or even a
"breeze", I'm going to override all the responses anyhow.

(It is convenient in Inform that you can override *every* verb action,
with specific exceptions. If you make every verb except "examine" respond
"You can't do anything to an idea," you'll very often have acceptable
behavior.)

Contrariwise, I expect most verbs to be applicable to all physical
objects. You can "touch" anything. If there's a special verb like "plug
in" or "write on", which applies to only a subset of the objects in the
world, then I'll use an attribute, property, or class membership test to
distinguish between "That's absurd" and "That doesn't work." There are
typically not many of these verbs.

--Z

--

"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the
borogoves..."

Neil K.

unread,
Dec 7, 1997, 3:00:00 AM12/7/97
to

d...@coyote.cs.wisc.edu (Daniel Shiovitz) wrote:

> Cardinal Teulbachs <card...@cwia.com> wrote:
> >what-have-you. When only one default message is available for use, it
> >can become quite a tricky matter to decide which sense should carry
> >the day. If the author goes with the "impossible" sense, then the
> >illusion of intellect he's trying to create for his parsing engine
> >will be destroyed when the player is told, in response to a "read the
> >newsprint" command, that "that's impossible." Reading *blank
> >newsprint* is, of course, precisely impossible in the sense that it's
> >impossible to read words that aren't there. But reading *newsprint*,
> >which is what the player asked to do, isn't in itself impossible, and
> >for this reason our normal tendency as human beings is to respond with
> >something like "but there aren't any words on it" rather than the less

> >forthcoming and too-terse "that's impossible." [...]


> >
> >The question, then, is what can an author do about this state of
> >affairs? One solution is to make extensive use of attributes--for
> >instance, to make objects that are not impossible to read "readable"

> [..]
>
> Verbs are something TADS does very well. In this case, the way to
> handle it is something like this:
>

> The point here, I suppose, is that if the parser is written in proper
> OO style, most problems of this type become relatively trivial to
> solve.

Agreed. Tedious to implement, but trivial. :) That's basically the
technique I've used in my TADS game in (sort of) progress - a combination
of setting attributes and defining new classes - for coming up with
appropriate error messages.

Thus all liquids are, in theory, drinkable. But if the player tries to
drink something nasty like, say, battery acid, then a custom error message
could be defined - "you're not about to kill yourself today." or whatever.
Or the game could kill the player horribly if desired. Drinkable liquids
would simply call a drinkable code that would bump down the player's
internal thirst counter, then move the liquid into nil. (ie: make it
inaccessible) Drinking a solid would bring up the default error message
"You can only drink liquids."

A whole ton of verbs get the same treatment and have appropriately
variable error messages. Read is another of course. So are listen, smell,
taste, throw, etc. The downside is that I have 580K of standard
definitions, versus the TADS adv.t 120K. Like anything, it really all
comes down to the amount of work you're willing to put into the thing.

- Neil K.

--
t e l a computer consulting + design * Vancouver, BC, Canada
web: http://www.tela.bc.ca/tela/ * email: tela @ tela.bc.ca

Neil Brown

unread,
Dec 8, 1997, 3:00:00 AM12/8/97
to

At 15:25:29 on Sun, 7 Dec 1997, Jeff Hatch wrote:

>Cardinal Teulbachs wrote:
>>
>> One of the difficulties, it seems to me, in making one's text
>> adventure parser seem intelligent in its replies to the player, lies
>> in the area of default action failure messages, which most i-f systems
>> employ as a means of reducing the work involved in writing adventure
>> games.
>[snip]
>
>Imho, the real problem is that too many authors aren't willing to do
>work to create intelligent replies for intelligent actions.

I don't believe that's the case at all. I can't remember ever thinking
"oh stuff it, I can't be bothered to code object x properly". Coding can
be such a complicated exercise at times that it is all too easy to
overlook fairly reasonable actions - and even beta testers can miss
them.

>Of course, no author can possibly think of everything, so better parser
>default action failure messages would certainly be beneficial.

Default messages have to sensibly cover all possibilities - eg a default
CLIMB message would have to cover CLIMB ROPE, CLIMB MOUNTAIN, CLIMB
PEBBLE, CLIMB AUNT MARY'S CORPSE, CLIMB MIST etc. They can't afford to
be too specific.

- NJB

Den of Iniquity

unread,
Dec 8, 1997, 3:00:00 AM12/8/97
to

On Sun, 7 Dec 1997, the effluent Cardinal Teulbachs wrote:

>One of the difficulties, it seems to me, in making one's text
>adventure parser seem intelligent in its replies to the player, lies
>in the area of default action failure messages

I've been wondering about that myself - if the parser can easily be told
whether an object is singular or plural, male or female, why do some of
the messages sound stilted as they try to avoid referring to things
improperly.

OTOH, I suppose for messages like 'You can't see any such thing' you have
to stick to the stilted reply because anything else might give away what
objects are available to the player...

-> TAKE THESIS
- You can't see any such thing.

-> TAKE DIAMONDS
- You can't see any.

--
Den


Joe Mason

unread,
Dec 9, 1997, 3:00:00 AM12/9/97
to

In article <erkyrathE...@netcom.com>,

Andrew Plotkin <erky...@netcom.com> wrote:
>
>Your example of an "idea" is actually a bit misleading, I think. I expect
>most default responses to be meaningful for a featureless *physical*
>object -- the classic white cube. If I create an "idea", or even a
>"breeze", I'm going to override all the responses anyhow.
>
>(It is convenient in Inform that you can override *every* verb action,
>with specific exceptions. If you make every verb except "examine" respond
>"You can't do anything to an idea," you'll very often have acceptable
>behavior.)

My current game in progress does exactly that - it makes extensive use of
sounds, smells, etc. Anything which isn't associated with a physical object
is given the class "Intangible", which is set up to respond differently to
verbs taking purely physical objects.

(Thank you, Cardinal, for pointing out some other behaviour I'll need to add
to the Intangible class - as written, it probably won't respond at all well to
read and certain other actions. I'll have to take a closer look at the default
library messages.)

BTW, this system is also better for adding new verbs, even without having to
modify the Intangible class - simply check if the object is "ofclass
Intangible" before printing an error message.

Joe

Brian C. Lane

unread,
Dec 21, 1997, 3:00:00 AM12/21/97
to

On Mon, 8 Dec 1997 12:56:33 +0000, Den of Iniquity
<dms...@york.ac.uk> wrote:

>On Sun, 7 Dec 1997, the effluent Cardinal Teulbachs wrote:
>

>>One of the difficulties, it seems to me, in making one's text
>>adventure parser seem intelligent in its replies to the player, lies

>>in the area of default action failure messages
>
>I've been wondering about that myself - if the parser can easily be told
>whether an object is singular or plural, male or female, why do some of
>the messages sound stilted as they try to avoid referring to things
>improperly.

Lazy programming <G> -- Hey, I'm guilty of it too. One of my
favorite things is when there are 3 or more replies that are either
rotated or selected randomly when a user tries to do something
illegal. This gets the point across to them without making the game
boring as they repeatedly try silly things.

Brian

======================================================================
Nexus Computing http://www.eskimo.com/~nexus

Reply all
Reply to author
Forward
0 new messages