Sunday, June 21, 2020

Ballyhoo Sample Transcript Game

After finally getting my Hugo library addition to a place I was happy with, I returned my attention to ZIL and have completed (at least, to my own satisfaction) my coding of the sample transcript included with the Infocom game "Ballyhoo."

It's not perfect.  There are response differences that I imagine would require more REPLACE-DEFINITION stuff to fix, some spacing differences that I was just too lazy to look into, and some commands which aren't supported at all (and changing the library is pretty much beyond my abilities).

Some commands from the transcript that don't work:
PICK UP THE CANDLEPIN THEN GIVE IT TO THE JUGGLER
GIVE THE LACROSSE BALL AND THE APPLE TO THE JUGGLER

I also didn't do a "The dog runs around you playfully." QUEUE routine for the dog in the park at all.  I figured I had spent enough time on QUEUEs with the juggler.

I also didn't go to great lengths to fix up all of the responses to things so it's probably still very easy to get a nonsensical response to a command.  If this actually were a game, it'd probably be half done just implementation-wise.

The current ZIL library doesn't support the EVERYWHERE token for commands like ask and tell, so I had to create a bunch of topic objects and put them in GENERIC-OBJECTS and redirect the parser as necessary.

Of the new content I added just to make it feel more like a game, I think this is my favorite:

> n
By the Magician
Park Street continues north and south here. A hedge to the east runs 
parallel to Park Street.

A woman wearing a black top hat and a tuxedo is here. She is waving 
colorful handkerchiefs around, which turn into flowers, and then turn 
back into handkerchiefs.

> x flowers
Whoops, they are handkerchiefs now.

> x handkerchiefs
Whoops, they are flowers now.

Originally, I had hoped to code the juggler objects with some fancy table, but eventually, I just gave up.  Also, I felt there was an implied randomness to the juggler in the transcript, so I had to guess at the logic there as best I could.

Beyond the creation of ZILF (and the ZILF library) itself, this definitely would not exist without the help of Jesse McGrew, who both supplied code for some of the trickier parts and coached me through the rest.

That said, if anybody wants to clean up my code and polish it off (I also never added any kind of scoring system)- feel free to do so!

The source and game can be found here:

https://drive.google.com/file/d/1rULu34qfPSptkL2MAoH8dNH-fuMNxPeK/view?usp=sharing

Originally, I had plans to also do the Lurking Horror sample transcript (possibly for the Halloween Ectocomp, now that it allows 3+ hour coded games).  I'm not sure how likely that is now, though.  For now, I'll be going back to some of my Hugo projects.  Nice to get this one done, though!