Re: Limitations of Inform and TADS?


6 Nov 1995 21:17:25 GMT

In article <47k4d1$pgf@alcor.usc.edu>,
Jacob Solomon Weinstein <jweinste@alcor.usc.edu> wrote:

>Can Dave enlighten us as to what, exactly, was going on in the code? As
>I've stated before, the reason that I found the delay so frustrating was
>that I didn't see anything in the game that seemed to require more
>CPU time than, say, the things that were going on in Unkuulian II.

Well, the easy answer for me is that you can get the complete source
to _Legend_ from the IF archive and see for yourself. :)

The harder answer is that there are a few things that WorldClass does
as a matter of course that chew cycles. The big culprits include:

1) "Known" tracking. WorldClass keeps track of what game objects the
player has seen so far. Among other things, this allows the game
to intelligently respond to

>ask monk about dragon

when the player doesn't know about the dragon yet. It also
helps the hint system figure out (roughly) how far the player
is in the game.

Why does this use CPU resources? Because whenever the player
enters a room, the game has to mark everything in the room as
"known". This means it has to traverse the containment hierarchy
for the room, which is time-consuming.

2) Better contents listing. The contents lister is much more complex,
for the sake of better output and to support things like objects
that have a smell, but which you can't see. The dark is not
special in WorldClass --- you can still move around, get things,
and so forth. And you'll still get descriptions for things you
can hear, smell, and feel. New commands like "listen" and
"feel around" just call the standard contents lister with visual
contents listing turned off. You can see a few examples of this
in Legend --- while you're in the escape pod, for example,
"listen" when the engines start to roar.

3) No assumption that the current location is the player's sense
domain. When you use "key" as a direct object, WorldClass
considers every key in the whole game, not just those in the
current room. This allows many interesting things, but at
a fairly significant cost. (It also allows a first-class
distinction between verbs like "ask about" and versbs like "take",
where other systems handle this in an ad hoc manner.)

4) Sense reach checking. When you say "examine key", the game runs
a function called cansee on every key object. This function
(by default) checks with all containers between the player
and the key, seeing if any container objects to passing the
sense of sight. (e.g., a closed box won't.) If no container
objects, the command works. Otherwise, the container that
objected prints its failure message. (e.g., "You'll have to
open the box first.")

This makes some really cool stuff easy to do. E.g., the
vending machine in _Legend_ allows sight through, but not
smell, taste, touch, etc. One could do this with ad hoc
code, again, but WorldClass provides a *general* mechanism
for it.

One interesting use of this is tracking light sources.
To see if you're in the dark, WorldClass checks with the
player's location to see if it has an ambient light soruce.
If not, it then determines whether any light source in the
game has a line of sight to the room the player is in.

A consequence of this is that if the player takes his
lamp and locks it in a dark box, he won't be able to see
any more. Again, you could write ad hoc code to effect
this, but it simply falls out of a general mechanism with
WorldClass.

Are these things important enoguh to spend the cycles on them? I think
they could make for interesting new twists in adventure games. They also
cut down on the amount of ad hoc code you need to write, which in my view
is a wonderful thing.

>If the NPCs in Legend seemed unusually alive, or if there were a
>lot of complex interactions going on, I'd understand what was
>causing the delay--but as I said earlier, Legend seemed to have
>more text than the average text adventure, but I couldn't see
>what was requiring all of the CPU time.

You're still ignoring my general sentiment that features need not be
visible in the final product to make the use of CPU resources worthwhile.
If it takes me 3 months to write a WorldClass game where it would have
taken me 6 months to write the same game with ADV.T, is it not worth it to
use WorldClass, even if I don't use some of the more powerful features?

Dave Baggett
__
dmb@ai.mit.edu
"Mr. Price: Please don't try to make things nice! The wrong notes are *right*."
--- Charles Ives (note to copyist on the autograph score of The Fourth of July)