the-infocom-files / suspended

Suspended
8 stars 3 forks source link

Whiz can't query about objects inside closed containers, apparently #10

Open eriktorbjorn opened 5 years ago

eriktorbjorn commented 5 years ago

I noticed by chance that there are some object that have a CLC-TXT, but which Whiz can't query about at the start of the game, e.g. Fred.

>WHIZ, QUERY FRED
FC: Cryolink established to Whiz.
CLC: Hmm. That's a tough one. Hold on a minute while I try to locate a reference
...

CLC: This is very embarrassing, but I can't seem to find that one.

For reference, the object I found were CHIPS0, CHIP1, CHIP2, FLOWSWITCH, DEADBOT, SMASHED-BOX and FUSE.

But I could have sworn that I used to be able to query about Fred back when I originally played the game. And as it turns out, I can. But only after I open the cabinet he's inside.

Which led me to wonder... does this apply to all closed containers? Let's find out:

>WALDO AND WHIZ, REPORT LOCATION

FC: Cryolink established to Waldo.
WALDO: In the Central Chamber.

FC: Cryolink established to Whiz.
WHIZ: In the Technical Peripheral.

>WALDO, INVENTORY
FC: Cryolink established to Waldo.
WALDO: I am grasping...
  A hollow container
    The hollow container contains...
      A rough object
      A pebbled object
      A wavy object
      A bumpy object
      A smooth object

>WHIZ, QUERY SMOOTH OBJECT
FC: Cryolink established to Whiz.
CLC: Hmm. That's a tough one. Hold on a minute while I try to locate a reference
...

CLC: Here it is! I was beginning to think I was going senile.
TP: This chip is a replacement polarization processor (RX0).

>WALDO, CLOSE HOLLOW CONTAINER
FC: Cryolink established to Waldo.
WALDO: Closed.

>WHIZ, QUERY SMOOTH OBJECT
FC: Cryolink established to Whiz.
CLC: Hmm. That's a tough one. Hold on a minute while I try to locate a reference
...

CLC: Nope. Can't find any reference to that one in this mess. Sorry.

That makes no sense from a player perspective.

I'm still a bit fuzzy on the exact details, but I think what happens is this: The QUERY verb probably tries to match objects the standard way first. If that doesn't work, it calls GLOBAL-CHECK to check for local globals, pseudo objects, global objects etc.

If GLOBAL-CHECK still doesn't find any objects, it has a special case for when the current robot is Whiz, the verb is QUERY and Whiz is plugged in. That's when you get the "CLC: Hmm. That's a tough one ..." message.

It then uses MOBY-FIND, which apparently iterates through every room and calls SEARCH-LIST for each of them. Here's the condition for whether this routine will recurse into containers in the room:

               <COND (<AND <OR <VERB? QUERY>
                       <NOT <FSET? .OBJ ,INVISIBLE>>>
                   <OR <NOT <==? .LVL ,P-SRCTOP>>
                       <FSET? .OBJ ,SEARCHBIT>
                       <FSET? .OBJ ,SURFACEBIT>>
                   <SET NOBJ <FIRST? .OBJ>>
                   <NOT <EQUAL? .OBJ ,WINNER>>
                   <OR <FSET? .OBJ ,OPENBIT>
                       <FSET? .OBJ ,TRANSBIT>>>

NOBJ isn't actually used, so it's not a problem if this is never set.

I think the intention here is that the QUERY verb is always allowed to recurse through everything. But it won't, because the verb is just one of the conditions. Maybe it should be something like this instead?

               <COND (<OR <VERB? QUERY>
                  <AND <NOT <FSET? .OBJ ,INVISIBLE>>
                       <OR <NOT <==? .LVL ,P-SRCTOP>>
                       <FSET? .OBJ ,SEARCHBIT>
                       <FSET? .OBJ ,SURFACEBIT>>
                       <SET NOBJ <FIRST? .OBJ>>
                       <NOT <EQUAL? .OBJ ,WINNER>>
                       <OR <FSET? .OBJ ,OPENBIT>
                       <FSET? .OBJ ,TRANSBIT>>>>
eriktorbjorn commented 5 years ago

For reference, the objects that I weren't able to query about at the start of the game:

I was eventually able to query for all of them, by first discovering them, except for one: FLOWSWITCH. I'm not sure why that one's different.