Scott Adams interpreter discrepancies

page 2-5:

3 Likes

Thanks! Wow, that’s a very different version of the guide. The one i originally copied was ~54 pages, whereas that one is ~136 pages. There’s a lot of good information in there.

I think I’ll quickly OCR that and put it up in the same GitHub repository. Even without proofreading I’m sure it can be useful for me at least.

1 Like

Out of curiosity, and if you don’t know, you can also consult the files advdb.txt and ADV_HLP.txt

2 Likes

I’ve added the following to scott2zil.

  • A new constant that determines how AutoGet/Drop should be handled
;"Sets if AutoGet/Drop should be handled as defined in 'The Adventure System' manual or handled as in ScottFree
  THE ADVENTURE SYSTEM
	If a verb-noun match was found in at least one action entry, but the conditions were not true in any of the 
	matched actions, then the message 'I can’t do that…yet' is displayed after all of the action entries have 
	been checked.
	AutoGet/Drop is only called if there is no verb-noun match found.
  ScottFree
	Does the same as above but tries to do an AutoGet/Drop before the message 'I can’t do that…yet'."
<CONSTANT AUTOGET-AS-SCOTTFREE <>>

The relevant part in the code that handles this is then in the routine RUN-ACTIONS and reads like this:

        ;"Word action"
		<COND (<G? .VERB-ID 0>
			<COND (<=? .ACTION-VERB-ID .VERB-ID>
				<COND (<NOT .WORD-ACTION-DONE>
					<SET CONTINUE-FLAG <>>
					<COND (<OR <0? .ACTION-NOUN-ID> <=? .ACTION-NOUN-ID .NOUN-ID>>
						<SET FOUND-WORD T>
						<COND (<EVALUATE-CONDITIONS .I>
							<EXECUTE-COMMANDS .I>
							<SET .WORD-ACTION-DONE T>
							<COND (<NOT ,CONTINUE-FLAG> <RETURN>)>
						)>
                    )>
                )>
            )>
        )>
	>

	<COND (<0? .VERB-ID> <RETURN>)>

	<COND (.WORD-ACTION-DONE <RETURN>)>

	<COND (<OR <NOT .FOUND-WORD> ,AUTOGET-AS-SCOTTFREE>
		<COND (<HANDLE-GET-DROP .VERB-ID .NOUN-ID> <RETURN>)>
	)>

	<COND (.FOUND-WORD
		<TELL ,MSG-CANT-DO-THAT-YET CR>
	)
	(ELSE
		<TELL ,MSG-DONT-UNDERSTAND CR>
	)>	

This means that the default behaviour for games built with scott2zil is to handle AutoGet/Drop as defined in “The Adventure System” manual. But this behaviour can be changed by setting the constant AUTOGET-AS-SCOTTFREE to true before compiling.

The code in scott2zil is based on PerlScott and follows it pretty closely so if @pdxiv want to do something similiar in PerlScott you probably can find the corresponding code part to change easily.

2 Likes

Cool, I might just do that! (Doing that in PerlScott/tensodoct will have to wait a little while, until I finish exploring how hard it is to make an alternative to the ScottKit compiler from scratch.)

Also, I uploaded a horribly un-proofread version of the The Adventure System manual: LuaScott/doc/The_Adventure_System_Manual_(1982).md at master · pdxiv/LuaScott · GitHub

1 Like

An alternative to ScottKit… Fascinating…

Another mystery, that I stumbled over again while trying to make a ScottKit compiler, is if an “autogetable” object needs to have an entry present in the noun table. In The ADVENTURE Data Base Format Allan Moluf mentions that:

The name does not have to be a noun in the vocabulary for this pick up or drop to work.

ScottFree doesn’t agree with this, and the following game file refuses to let me pick up an object, because it’s name isn’t present as a noun in the vocabulary table:

 0 
 0 
 1 
 18 
 1 
 6 
 1 
 0 
 3 
 125 
 2 
 1 
 300 
 2 
 0 
 0 
 0 
 0 
 150 
 0 
 300 
 5 
 0 
 0 
 0 
 0 
 300 
 0 
"AUT"
"ANY"
"GO"
"NOR"
"LOO"
"SOU"
""
"EAS"
""
"WES"
""
"UP"
""
"DOW"
""
""
""
""
""
""
"GET"
""
""
""
""
""
""
""
""
""
""
""
""
""
""
""
"DRO"
""
 0 
 0 
 0 
 0 
 0 
 0 
""
 0 
 0 
 1 
 0 
 0 
 0 
"forest"
""
"There are some keys on the ground"
"There's nothing here"
"Ring of skeleton keys/KEY/" 1 
""
""
 416 
 1 
 0

ScottKit automatically adds the noun for every “autogetable” object to the noun table. Since ScottKit’s interpreter is based on ScottFree which requires this, it makes sense. Every game out there works fine in ScottFree, which implies that this behavior is “as designed”. At the same time, the number of nouns is a limited resource, and it would be nice to be able to save space in this table.

Oddly, The Adventure System Manual contradicts Allan Moluf’s statement:

The name of the object must be a noun in the list of vocabulary entries for the automatic pick up and drop feature to work. The object name must also be a primary noun, not a synonym.

There are errors, contradictions and approximations in all the documentations. And they do not all refer to the same interpreters and versions of them. It is best to choose a reference interpreter and test it.

1 Like

Yeah, again ScottFree is probably as close as we can get to a “gold standard” implementation. PerlScott/Tensodoct (and probably a few other terps) are more tolerant to this specific scenario, but it doesn’t hurt, so it doesn’t need fixing.

Tanks for the testcode! I noticed that scott2zil didn’t handle this correctly but it is now fixed.

It would be nice if your future compiler have the option to both create an entry in the noun-table or don’t do it (to save noun entries).

ADVENTUR/CMD behaves in the same way as ScottFree here (i.e. the player isn’t allowed to pick up the KEYs):

(A slightly (but not materially) modified version of my BBC BASIC port of BYTE’s v4.6 Pirate terp also behaves in the same way as ScottFree in this case.)

I’m attaching a copy of the test game data file, which has been converted to TRS-80 .DAT format.

ADVENT.D1.zip (344 Bytes)

Has anyone tried to calculate the first number in the information Header: “The number of bytes required to contain the text of the verbs, nouns, messages, room descriptions and object descriptions.”
The result of my calculation is always 1 less than the expected result.

Done. I meant to add that as an optional commandline flag, but forgot about about it.

1 Like

I haven’t tried this for a long time, and when I actually did, I couldn’t work out exactly how it worked. I would very much like to be able to do this :slight_smile:

If it’s always off by exactly -1, it sounds to me like you’ve cracked it! :champagne:

Yes, but now ScottKit’s output is problematic!:

Whereas the output from ADVENTUR/CMD looks okay:

testlight3.sck.zip (1.1 KB)
testlight3.dat.zip (998 Bytes)

“The number of bytes required to contain the text of the verbs, nouns, messages, room descriptions and object descriptions. This number includes a fixed number of bytes for each verb and noun (one more thean the max word length). It includes one more than the number of characters between quotes in the messages and room and object descriptions. It also includes one more byte for each object than can be carried and dropped.”

HEADER:
BYTES
#OBJ
#ACT
#VOC
#RM
MAX
BEG
#TR
WLEN
TIME
#MSG
TR_RM

BYTES =  (#VOC+1) * 2 * (WLEN+1)
BYTES += (#RM+1) + length of all non-empty Room Description
BYTES += (#OBJ+1) + length of all non-empty Object Description + 1 for all objects with a name ('/name/')
BYTES += (#MSG+1) + length of all non-empty Message 
BYTES += 1 (Because I am lacking 1!)

The comment strings (Title) for actions are not accounted for.

I wonder if the reason has anything to do with this line from a BASIC version of the Adventure Editor which I found somewhere?:

1880 CLS:A!=S+1:PRINT"STRING USED:";A!:PRINT"POINTER AREA NEDDED:";S1:PRINT"TOTAL MEMORY NEEDED:";S1+A!:MA=S2-(S1+A!)

Notice the “A!=S+1” bit – it literally adds one to the string-storage size for no apparent reason!?

ADVEDIT BASIC.bas.zip (4.6 KB)

Surely modern terps will be running on machines that have more than enough RAM to be able to accomodate an extra noun or ten…?

So saving noun-entries is only important on older machines like the 8-bits. But the problem there is that even the “official” 8-bit TRS-80 terp ADVENTUR/CMD requires that every autogettable object should have an entry in the noun table!

So in what circumstances would saving a noun-entry be possible and useful?

The number of nouns in a game file is limited to 150 entries, because in the TRS-80 text file format, verbs and nouns are encoded as a single integer in every action as follows: 150*verb + noun.

This effectively means that, while there is no upper limit to the number of verbs (other than the number format implementation of the terp), you can only specify 150 noun entries before you start to cause corruption in the game file.

3 Likes

Ah, I see. So it’s worth bearing in mind that if you want your newly authored game to be compatible with ADVENTUR/CMD (and perhaps with other vintage 8-bit terps?) then every autogettable object must have an entry in the noun table, but, at the same time, you have to limit the number of noun-entries to 150.