the-infocom-files / trinity

Trinity
23 stars 5 forks source link

Double messages when listening while in the Nagasaki bomb shelter #15

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago
>LOOK
Shelter

You wouldn't want to spend much time in this wretched hole. The bare floor is
damp and filthy, and the corners reek of urine. Luckily, there's an opening to
the west.

A spade is leaning against the wall.

The little girl is in the corner, clutching an umbrella.

The girl turns the umbrella over and over in her hands.

You've noticed a faint sound coming from somewhere outside. The girl turns to
stare at the ceiling.

>LISTEN
The sound outside grows louder. There's no mistaking the drone of aircraft.

The girl looks at you expectantly and crouches down in a corner of the shelter.

The sound outside grows louder. There's no mistaking the drone of aircraft.

The girl looks at you expectantly and crouches down in a corner of the shelter.

>LISTEN
The drone of the aircraft outside increases. It sounds as if they're in a power
dive.

The girl covers her ears with her hands and whimpers.

The drone of the aircraft outside increases. It sounds as if they're in a power
dive.

The girl covers her ears with her hands and whimpers.

>LISTEN
All at once the shelter is lit by a terrifying flash of light. You dive to cover
the screaming girl, and feel the earth shudder beneath a crushing blast wave.

Your body absorbs much of the deadly radiation that might otherwise have reached
the child. Years later, she recalls to her grandchildren the tale of a
mysterious stranger who shielded her life at Nagasaki.

This is probably because "LISTEN" is implemented (by PLANES-F) as simply calling I-NAGASAKI:

           (<VERB? LISTEN>
        <I-NAGASAKI <>>
        <RTRUE>)>

This is ok if you're outside, because the teachers will catch you and the game will be over. But in the shelter you are safe, and since the I-NAGASAKI timer is still running the routine will be called twice. Perhaps simply return RTRUE here and let the timer handle it?

Though then there would probably be an extra blank line before the response, so I-NAGASAKI would have to be slightly modified. Perhaps check <VERB? LISTEN>? I've seen other games do that in timer routines, so it might work here too. Though it'd probably have to check that the player is listening to the planes and nothing else.

eriktorbjorn commented 4 years ago

This is how Wishbringer solved the blank line problem in SCREEN-F ...

               (<VERB? EXAMINE LOOK-ON>
                <COND (<NOT <ENABLED? ,I-FILM>>
                       <BLANK-SCREEN>)>
                <SETG NO-CR? T>
                <RTRUE>)

...and I-FILM:

                       <COND (,NO-CR?
                              <SETG NO-CR? <>>)
                             (T
                              <CRLF>)>

I.e. if the film is playing, examining the screen does nothing and the description is printed by I-FILM, except there is no blank line at the start of the message.

So it could be argued that this is the "Moriarty way". I haven't yet seen if there is any "Trinity way".

Edit: Now I think I've seen the Trinity way. In MAGPIE-F, it does this:

           (<VERB? WATCH LISTEN>
        <UNMAKE ,PRSO ,SEEN>
        <I-MAGPIE <>>
        <RTRUE>)

And I-MAGPIE does some checking of the SEEN bit that I haven't yet gotten around to investigating. But it does seem to prevent the double messages.

eriktorbjorn commented 4 years ago

Note that I-NAGASAKI has a CR parameter for this purpose.

eriktorbjorn commented 4 years ago

The crabs at the Ivy Mike test site behave the same way:

>EXAMINE CRABS
The crabs snap their claws at you.

The alert crabs glare at you with beady little eyes.

That's because CRABS-F does this:

           (<VERB? EXAMINE WATCH>
        <UNMAKE ,PRSO ,SEEN>
        <I-CRABS <>>
        <RTRUE>)

So maybe it's by design?

eriktorbjorn commented 4 years ago

Actually, there is some code in I-CRABS that looks like it's meant to prevent the duplicate messages. The CRABS-F routine always marks the crabs as SEEN, and I-CRABS does this:

<ROUTINE I-CRABS ("OPTIONAL" (CR T))
     <COND (<OR <NOT <HERE? WSAND>>
            <IS? ,CRABS ,SEEN>>
        <UNMAKE ,CRABS ,SEEN>
        <RFALSE>)
           (<ZERO? .CR>
        T)
           (<PROB 50>
        <RFALSE>)
           (T
        <CRLF>)>

But I forget... does <RFALSE> here only return from the COND or does it return from the entire routine?

eriktorbjorn commented 4 years ago

LANDING-F too:

>LISTEN TO LANDING
The landing emits a wooden moan of discomfort.

The landing is sagging dangerously. It's not going to last much longer!
           (<VERB? WATCH LISTEN CLIMB-OVER CROSS STAND-ON CLIMB-ON
               KICK KNOCK HIT MUNG>
        <I-MILL <>>
        <RTRUE>)

(Also, LANDING-F has two different cases for LISTEN. Of course, only this first one is actually used.)

eriktorbjorn commented 4 years ago

MILK-F too:

>EXAMINE MILK
Liquid dribbles out of the cracked coconut.

The last drops of milk dribble out of the cracked coconut.
     <COND (<VERB? EXAMINE WATCH>
        <I-MILK <>>
        <RTRUE>)
eriktorbjorn commented 4 years ago

And MCRANE-F:

>WATCH CRANE
The giant bird turns to look at you. Though the paper face is utterly
featureless, you somehow get the feeling that it likes you.

The giant bird beckons to you with a friendly wing.
           (<VERB? WATCH>
        <I-MCRANE <>>
        <RTRUE>)
eriktorbjorn commented 4 years ago

And BOY-F:

>EXAMINE BOY
The boy pulls the bubble wand out of the dish, puts it to his lips and blows a
big soap bubble.

The boy kicks his feet to the headphone music as the soap bubble bursts with a
flabby pop.
           (<VERB? EXAMINE WATCH>
        <I-BOY <>>
        <RTRUE>)

(At this point, we might as well search the code for '<I- ... <>>' and see what turns up. Of course, even some of the ones I've pointed out may be deliberate.)

eriktorbjorn commented 4 years ago

Same thing in SHADE-F:

>WATCH SHADE
The ghostly shades begin to converge on the dory. One by one, they step into the
vessel, hand the oarsman a silver coin, and take a seat.

The last of the shades seats itself in the crowded dory.
           (<VERB? WATCH>
        <I-STYX <>>
        <RTRUE>)
eriktorbjorn commented 4 years ago

DORY-F:

           (<VERB? WATCH>
        <I-STYX <>>
        <RTRUE>)
eriktorbjorn commented 4 years ago

LEMMINGS-F is another example of where you don't get double messages:

           (<VERB? WATCH>
        <UNMAKE ,RODENTS ,SEEN>
        <I-RODENTS <>>
        <RTRUE>)
           (<VERB? EXAMINE>
        <COND (<IS? ,RODENTS ,CHILLY>
               <UNMAKE ,RODENTS ,SEEN>
               <I-RODENTS <>>
               <RTRUE>)>

I-RODENTS, like I-CRABS, checks if RODENTS has the CHILLY bit.

eriktorbjorn commented 4 years ago

LEM-F also doesn't give a double message:

           (<VERB? WATCH>
        <COND (<AND <HERE? IN-ORBIT ON-SAT>
                <ZERO? ,SUITED?>>
               <TELL "It isn't looking well." CR>
               <RTRUE>)>
        <UNMAKE ,PRSO ,SEEN>
        <I-LEM <>>
        <RTRUE>)

So it seems there is no standard bit to use to suppress messages in time routines. In I-LEM the CHILLY bit is used for other things.

eriktorbjorn commented 4 years ago

CHARON-F:

           (<VERB? WATCH>
        <I-STYX <>>
        <RTRUE>)
eriktorbjorn commented 4 years ago

FILM-F:

           (<VERB? EXAMINE LOOK-INSIDE SEARCH WATCH>
        <COND (<HERE? ON-SAT>
               <TELL CTHEO " is anchored to the " D ,XRAY
                 " with the " D ,LUMP ,PERIOD>
               <RTRUE>)
              (<HERE? IN-SKY IN-ORBIT ON-SAT>
               <TELL CTHEO " strains against the ">
               <COND (<HERE? IN-SKY>
                  <TELL "passing wind." CR>
                  <RTRUE>)>
               <TELL "surrounding vacuum." CR>
               <RTRUE>)>
        <I-BUBBLE-SUIT <>>
        <RTRUE>)
eriktorbjorn commented 4 years ago

I-GIRL:

           (<VERB? WATCH>
        <I-GIRL <>>
        <RTRUE>)>
eriktorbjorn commented 4 years ago

F-MEEP is another example of a routine that doesn't print double messages:

           (<VERB? WATCH>
        <UNMAKE ,PRSO ,SEEN>
        <I-TMEEP <>>
        <RTRUE>)