the-infocom-files / trinity

Trinity
24 stars 5 forks source link

CAVE-F doesn't seem to be used (if we need to save space) #61

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago

This is not so much a bug as there is code here that could be salvaged. The CAVE object looks like it was intended to be local-global to AT-FALLS and ICE-CAVE, and its action routine CAVE-F handles standard verbs like "ENTER" and "EXIT" on it.

Now, it makes sense that in the final game it's not local-global to AT-FALLS because as far as I can tell the cavern is never actually mentioned there. (Only the opening.) Instead, there is an ICAVE object that's local-global to ICE-CAVEonly, But it uses HERE-F as action routine, so it's pretty bare-bones. E.g. "EXIT CAVE" won't work.

The CAVE object is still used in the following routines:

But, assuming I didn't miss something, it's only used to print the name of the object. And since both ICAVE and CAVE have the same short name ("cavern"), we could combine them into one object.

It might be worth fixing the "EXIT CAVE" thing, and if we start running out of space while fixing bugs we could eliminate one of the objects completely.

eriktorbjorn commented 4 years ago

Another place to possibly save a few bytes is HEDGE-F, which checks the FOLLOW action twice:

           (<VERB? FOLLOW>
        <COND (<HERE? DOCKSIDE>
               <DO-WALK ,P?WEST>
               <RTRUE>)
              (<HERE? FCLEARING>
               <DO-WALK ,P?EAST>
               <RTRUE>)>
        <V-WALK-AROUND>
        <RTRUE>)
           (<VERB? FOLLOW>
        <V-WALK-AROUND>
        <RTRUE>)