Playable version of Mini-Zork II

Is it a classic Infocom release without a hands-related bug?

It is a classic bug, I guess, but in this case I introduced it myself by removing the code that fixed it. The idea here was to fix bugs, not cause them! :stuck_out_tongue:

2 Likes

I noticed another bug I had introduced. I thought non-player characters couldnā€™t die in the game, but I was wrong so Iā€™ve put back the code that dealt with that. (I hate it when that happens.)

So itā€™s time for a new release again. Fortunately I found some other code that could be removed, so the game shouldnā€™t have grown since the last one.

3 Likes

Release 11 with better abbreviations, here.

Without abbrv       60,154 bytes
Zilf abbrv          54,068 bytes
Improved abbrv      53,388 bytes
1 Like

Interesting that while the version with the best abbreviations still grew slightly compared to the previous release. Oh well. If it becomes a problem, thereā€™s always the debug commands that can be easily removed by changing the line <SETG DEBUGGING? T> to <SETG DEBUGGING <>> in mini2.zil. I donā€™t think Ozmoo handles command recording and playback anyway, does it?

The abbreviations are not the ā€œbestā€. You would, for example, save 3 bytes if you move ā€œreceptaclā€ to before ā€œe.ā€ and change it to ā€œreceptacle.ā€. Iā€™m struggling to make the algorithm to identify it, thoughā€¦

No.

Have updated the C64 disk image on Drive.

2 Likes

Thereā€™s a Release 12 now. Iā€™m done with my own testing, so unless someone else finds something this may very well be the final release. (And hopefully the end of me doing force pushes to the repository. Sorry about that!)

Edit: Annoyingly, Iā€™ve made one change since that, but it was something the compiler should have complained about but apparently didnā€™t. So I guess it didnā€™t make any difference?

3 Likes

Release 12 with better abbreviations, here.

                    Size         Diff release 11
Without abbrv       60,140 bytes (- 14 bytes)
Zilf abbrv          54,032 bytes (- 36 bytes)
Improved abbrv      53,370 bytes (- 18 bytes)
1 Like

Updated c64 disk image at Minizork 2 - Google Drive to use release 12 too.

2 Likes

I tried playing it for a bit, but after a while it started printing corrupted text. The first I noticed was that it printed ā€œzzz.ā€ where I think it was supposed to say that the Wizardā€™s ā€œFreezeā€ spell wore off, and then ā€œZā€ started responding with ā€œopenojlojszTime passesā€¦ā€.

Is that a problem with the game or with the C64 emulator (VICE) that I used?

(In the meantime, I did make one tiny change that I think ZILF should have flagged as an error but didnā€™t. But I donā€™t see that making any difference. At least I hope it wouldnā€™t.)

Hm, interesting. The best way to tell would be to try the game in Frotz with the exact same commands.

I havenā€™t noticed any such problems while testing in Frotz. In Ozmoo, I canā€™t think of any way the ā€œwaitā€ command would print garbage because of a ZIL error, and it worked at the beginning of the game (and I havenā€™t reproduced it since). So it felt more like some sort of memory corruption, but whether that was Ozmoo or VICEā€¦ who knows?

I donā€™t know if this is a bug or if itā€™s intended, but:

>i
You have:
  A china teapot
  The china teapot contains:
    A quantity of water
  A elvish sword
  A brick
  The brick contains:
    A black string
  A matchbook
  A package of candy
  A red crystal sphere
  A lamp (providing light)

>drop all but lamp
china teapot: Dropped.
elvish sword: Dropped.
brick: Dropped.
black string: You're not carrying the black string.
matchbook: Dropped.
package of candy: Dropped.
red crystal sphere: Dropped.

But the message with the string, inserted in the brick, is a bit strange.

Having spent hundreds of hours debugging Ozmoo problems using Vice, I have never found Vice to be the problem. So most probably itā€™s Ozmoo this time as well.

My best guess is that this has to do with the buffer used to access RAM hidden under I/O and ROM. Itā€™s 4-5 pages by default, but I set it to 2 pages for this build. Sometimes one of them holds the page where the PC (program counter) points, and that page canā€™t be changed. Perhaps thereā€™s a scenario where the other page shouldnā€™t be changed either but when thereā€™s only two pages to choose from itā€™s changed anyway.

Iā€™ll try to reproduce the problem.

This is the type of bug that scares me, but I guess itā€™s somewhat reassuring that it also happens in the full game.

On the other hand, I canā€™t reproduce it with Zork Iā€™s sack. I think it may have something to do with the containers in Zork II having SEARCHBIT. Many containers in Zork I do as well, but not the sack. Adding it causes a similar bug:

>DROP ALL
brown sack: Dropped.
lunch: You're not carrying the lunch.
clove of garlic: You're not carrying the clove of garlic.

But without it, itā€™s fine. Removing it from the brick fixes this particular problem as well, but what does that do? This is what Marc Blank had so say about SEARCHBIT in his ZIL manual:

12.1.5 SEARCHBIT

Means that one can see things inside of things inside the container that has this flag set. The
default is that one can only see things through one level of containment. OBJECTs with the
SURFACEBIT act as if they have the SEARCHBIT as well.

Steve Meretzky was a bit more passionate about the subject in his:

SEARCHBIT: A very slippery concept. It tells the parser to look as deeply into a container as it can in order to find the referenced object. Without the SEARCHBIT, the parser will only look down two-levels. Example. Thereā€™s a box on the ground; thereā€™s a bowl in the box; thereā€™s an apple in the bowl. If the player says TAKE APPLE, and the box or the bowl have a SEARCHBIT, the apple will be found by the parser and then taken. If the player says TAKE APPLE, and the box and bowl donā€™t have the SEARCHBIT, the parser will say ā€œYou canā€™t see any apple right here.ā€ Frankly, I think the SEARCHBIT is a stupid concept, and I automatically give the SEARCHBIT to all containers.

Iā€™ll play around with it later to see if I can find any downside to removing that bit. There arenā€™t many ways to get deeply nested containers in Mini-Zork II anway.

Yeah, I noticed there was a difference between the teapot and the brick. The only objects that have the SEARCHBIT are the receptacle, the purple book and the brick. The receptacle shouldnā€™t be a problem because you canā€™t pick it up. The purple book, but not the brick, have the CONTBIT set. Does this make a difference? Or do the purple book acts in the same way?

I never noticed that! I guess CONTBIT isnā€™t required for the object to act as a container. Maybe itā€™s so that you canā€™t open and close the brick, but it also means that ā€œFIND STRINGā€ will cause the game to respond ā€œBeats me.ā€ instead of ā€œItā€™s in the brick.ā€

Apparently it does:

>INVENTORY
  A lamp (providing light)
  A purple book
  The purple book contains:
    A Flathead stamp

>DROP ALL
lamp: Dropped.
purple book: Dropped.
Flathead stamp: You're not carrying the Flathead stamp.

Edit: By the way, this may have changed in later games because I canā€™t reproduce this in, say, The Hitchhikerā€™s Guide to the Galaxy.

I just looked a bit closer at The Hitchhikerā€™s Guide to the Galaxy. There does indeed seem to be some code in MAIN-LOOP which checks if found objects are still relevant for the current command when dealing with multiple objects.

Itā€™s probably overkill to introduce anything like that to Mini-Zork II, unless the SEARCHBIT thing absolutely, positively will not work.

Edit: It seems that Mini-Zork II does have a limited form of that. See the ā€œmultiple exceptionsā€ comment. In The Lurking Horror, to pick an even later game at random, this logic was moved to a separate MULTIPLE-EXCEPTION? routine that ā€œreturn[s] true if an object found by all should not be inclued when the crunch comesā€.

Edit: And in some other games, that separate routine is called DONT-ALL. I guess that may be interesting if you were trying to trace which games were based on which older games.

Can you tell if the texts that should have been printed contain abbreviations?