the-infocom-files / amfv

A Mind Forever Voyaging
5 stars 2 forks source link

The PARTIAL routine looks a bit unsafe #93

Open eriktorbjorn opened 4 years ago

eriktorbjorn commented 4 years ago

The PARTIAL routine is used when Perelman has looked at your recordings if you've recorded enough from three of the simulations, but not enough from the fourth one. See I-RECORDINGS-VIEWED:

           (<EQUAL? .TOTAL 3>
        <TELL ,FINISHED-VIEWING "everyone ">
        <COND (<NOT .D>
               <TELL
"agreed that 2051, '61, and '71 all looked disturbing. But there wasn't">
               <PARTIAL ,2081-SCORE>
               <TELL "81. Perhaps things turn around" ,MAYBE-MORE CR>)
              (T
               <TELL
"there was incredibly disturbed by them, especially the scenes from 2081.
However, there was general agreement that you didn't show us">
               <COND (<AND .A .B>
                  <PARTIAL ,2071-SCORE>
                  <TELL "71">)
                 (<AND .A .C>
                  <PARTIAL ,2061-SCORE>
                  <TELL "61">)
                 (T
                  <PARTIAL ,2051-SCORE>
                  <TELL "51">)>
               <TELL
". We'd like to see a progression; the sentiment was that without the
missing link, it's difficult to tell if the simulations are really valid"
,MAYBE-MORE CR>)>)
<ROUTINE PARTIAL (SCOR "AUX" HALF-LEVEL)
     <COND (<EQUAL? .SCOR ,2081-SCORE>
        <SET HALF-LEVEL </ ,2081-MIN 2>>)
           (<EQUAL? .SCOR ,2071-SCORE>
        <SET HALF-LEVEL </ ,2071-MIN 2>>)
           (<EQUAL? .SCOR ,2061-SCORE>
        <SET HALF-LEVEL </ ,2061-MIN 2>>)
           (T
        <SET HALF-LEVEL </ ,2051-MIN 2>>)>
     <TELL " ">
     <COND (<EQUAL? .SCOR 0>
        <TELL "anything interesting">)
           (<G? .SCOR .HALF-LEVEL>
        <TELL "quite enough">)
           (T
        <TELL "anywhere near enough">)>
     <TELL " from 20">>

Maybe I'm missing something obvious here, but since you only give a recording score to it (e.g. 2051-SCORE) it can only guess which year you actually meant.

The mininum score you need to reach are:

<CONSTANT 2051-MIN 10> ;"out of approximately 30-40"
<CONSTANT 2061-MIN 20> ;"out of approximately 66-106"
<CONSTANT 2071-MIN 40> ;"out of approximately 193-242"
<CONSTANT 2081-MIN 14> ;"out of 43"

So it seems like it would be possible to come up with a scenario where you've for instance recorded enough from 2051, 2061 and 2081, and your score for 2071 is exactly the same as one of the other three. Then it might think you've reach the halfway mark for 2071 even though it's actually the halfway mark for a different year.

But since the worst that could happen (as far as I can tell) is that the game doesn't make the right decision on whether to print "quite enough" or "anywhere near enough", I don't think it's worth worrying about.

eriktorbjorn commented 4 years ago

I managed to set up the scenario I described. I added a debug "SCORE" command so that I could see exactly how much I had recorded:

>SCORE
2051 - 11 (min 10)
2061 - 21 (min 20)
2071 - 15 (min 40)
2081 - 15 (min 14)

When I showed the buffer to Perelman, the reaction was:

Perelman looks up. "PRISM, several of my colleagues and I have finished viewing
the recordings that you made, and everyone there was incredibly disturbed by
them, especially the scenes from 2081. However, there was general agreement that
you didn't show us quite enough from 2071. We'd like to see a progression; the
sentiment was that without the missing link, it's difficult to tell if the
simulations are really valid. Maybe you could collect some more data, make some
more recordings, and then report back to us. Well, I've got to run, but I'll
talk to you later." He leaves the room.

Since I had less than half the needed recordings from 2071, he should have said that I didn't show them "anywhere near enough from 2071", but he instead said I didn't show them "quite enough from 2071" since 15 is more than half of the needed 2081 recordings.

The PARTIAL routine checks the recording times in the order 2081, 2071, 2061, 2051. Maybe this particular case is the only one that can trigger the bug because 2081 is the only year that requires less recordings than the previous year? If so, it may be enough to reorder the tests to 2071, 2061, 2081, 2051.

But it's such a minor detail, and there's almost no way you'd ever trigger it without cheating...