MikeTaylor / scottkit

Scott Adams adventure toolkit: compile, decompile and play 80s-style adventure games
30 stars 10 forks source link

Terp fails to correctly handle undeclared nouns #43

Open ahope1 opened 3 years ago

ahope1 commented 3 years ago

This issue is written up in full, with screenshots, on intfiction.org:

https://intfiction.org/t/scott-adams-interpreter-discrepancies/48864/98

Yet another discrepancy in the behaviours of various Scott Adams interpreters.

There's a problem in the way that some terps handle a player-command that contains a noun that hasn't been explicitly declared in the game data.

This time, only ScottFree exhibits the desired "correct" behaviour, while PerlScott, ScottKit, and the versions of ADVENTUR/CMD and ADV/CMD that I referred to earlier in this thread [on intfiction.org] all behave "incorrectly" when they play the following example (also attached [on intfiction.org]), which is an adapted extract from a ScottKit-decompilation of the TRS-80-format datafile (adv05.dat) of The Count:

start workroom 

room workroom "workroom"

item file "Large tempered nail file"
    called FIL

item bolt "Lockable slide bolt"

item lock "Broken slide lock"
    nowhere

verbgroup CUT BRE FIL TRI
noungroup FIL NAI

action CUT:
    print "Tell me with what? Like: `WITH FIST`"

action WIT FIL when present file and here bolt
    swap bolt lock
    look2
    print OK

action WIT FIL when !present file
    print "Sorry I can't do that"
    print "I've a hunch I've been robbed!"
    comment "NO FILE"

ScottFree allows the player to enter the command BREAK BOLT, even though no such noun as BOLT (or BOL) has been declared. That behaviour accords with the solution to The Count that can be found at CASA, and with this walkthrough video of a TRS-80 version of the game, both of which specify the command BREAK BOLT.

ScottFree matches the command BREAK BOLT with the “action CUT” handler. (In this example, BRE(AK) is a synonym for CUT.) In fact, ScottFree will activate that handler whenever the player's command consists of the verb BREAK followed by any word at all (even a gibberish one!).

But in the ScottKit terp, and in PerlScott, and in my found versions of ADVENTUR/CMD and ADV/CMD, the only way to break the bolt is to type the word BREAK on its own -- i.e. you have to type the verb without a noun (which isn't exactly intuitive!).

MikeTaylor commented 3 years ago

Thanks for writing this up. I'll get to it when I can.

ahope1 commented 2 years ago

Further analysis suggests that the real issue here is that when decompiling .DAT files, ScottKit seems to silently drop "unreferenced" nouns from the vocab list. That behaviour is probably wrong.

ScottKit also silently drops unreferenced nouns when compiling a .sck file. That behaviour is probably wrong too.

More info at intfiction.org:

https://intfiction.org/t/scott-adams-interpreter-discrepancies/48864/102

MikeTaylor commented 2 years ago

Appreciated!