Craverly Heights in PunyInform

Craverly Heights (PunyInform)

Recently Ryan Veeder’s game Craverly Heights has been ported from Inform 7 to Dialog and ZIL, and I thought it would be interesting to compare this with a PunyInform version too. It turns out that most I7 concepts are straightforward to map to PunyInform, but some special constructs had to be created to implement the one-of/stopping construct. To make it easy to compare my PunyInform code to Dialog, Inform 7 and ZIL I’ve kept the code layout with the comments denoting various sections and blocks in the source code.

The game and its source code is here .

The original Inform 7 z8-version is 258 kB, the Dialog z5-version 127 kB, the ZIL z5-version 48 kB, and the z3-version PunyInform version is 50 kB.

The original can be played online here .

The Inform 7 and Dialog source code are compared here . The ZIL version can be found here

11 Likes

Very nice!

Craverly Heights is becoming the Rosetta Stone of interactive fiction.

6 Likes

Great!

I like the Rosetta aspect of it. Currently I’m mostly fluent in ZIL (believe it or not!) and this helps me understand I6, I7 & Dialog so much better.

Nice that you compiled a z3-version. I didn’t bother, because the statusline is fixed, but now I’m curious what changes, if any, I would have to make to the ZIL code.

One question:
When I made the ZIL version I had some intial problem with “the pair of glasses”. It’s “a pair of …” in the inventory but the pronoun for “a pair …” is “them”. i.e. I wanted it listed in the inventory as “a pair of …” but have the player refer to them as “them” - “get them”. In your port you have to refer to last item (the IT item) with “it”. Is this inherited in Puny or can you modify it? (long-winded text about a miniscule thing…)

Bonus question:
“get all” doesn’t see the things on the shelves and “get all on shelf” isn’t recognized. As far as I see you have to pick each object individually. Is this possible to modify?

1 Like

Thanks for having a look at the game. The z3-version works fine except for not having support for unicode (so no fancy em-dash) and the statusline will show score and turns. It is a bit annoying, but I can’t do anything about it. There is always the z5-version if that’s a deal breaker.

You seem to have found a few bugs:

  • There is support for them in PunyInform. This is just a bug/oversight. I’ll fix it.
  • “get all from shelf” works, but not “get all on…”. This should probably be fixed.

I also noticed that you dutifully reproduced the original “stack overflow” bug when you:

point gun at gun
shoot

(lol)

Yes, the statusline in z3 is what it is. That’s why I didn’t bother with it and opted with the z5. (but now I might…)

1 Like

ahem… perhaps in your post is a typo ?

ls -l bin/
totale 116
-rw-r--r-- 1 pigi pigi 57344 lug  7 15:02 craverly-puny.z3
-rw-r--r-- 1 pigi pigi 58368 lug  7 15:02 craverly-puny.z5

Best regards from Italy,
dott. Piergiorgio.

Yep. Saw several bugs in the original but I didn’t fix most of them. I wanted to keep the sources easy to compare.

1 Like

I think 57.344 is 56kB. Remember on computers a kilo = 1024.

1 Like

Looks like a slight oversight. I think the pair of sunglasses should have the pluralname attribute, article "a pair of" and the name “sunglasses” and the library will let you refer to them as “them”.

“get all from shelf” works. Adding support for “get all on shelf” is trivial. If the set of shelves had been given the scenery attribute, “get all” would have taken all from the shelves as well.

1 Like

Henrik, of course I know. I’m a gentlemen, and the typo is a bit embarassing… and isn’t about the z3 file.

Hope that you understand my discretion, and
Best regards from Italy,
dott. Piergiorgio.

1 Like

Fredrik just pointed out that I forgot to add the -e (economy mode) option in the Makefile. Using -e makes the z3-version shrink to 50 kB. Thanks Fredrik.

2 Likes

mh… let’s a bit more explicit:

ls -lh bin/
totale 116K
-rw-r--r-- 1 pigi pigi 56K lug  7 15:02 craverly-puny.z3
-rw-r--r-- 1 pigi pigi 57K lug  7 15:02 craverly-puny.z5

ls -lh --si bin/
totale 119k
-rw-r--r-- 1 pigi pigi 58k lug  7 15:02 craverly-puny.z3
-rw-r--r-- 1 pigi pigi 59k lug  7 15:02 craverly-puny.z5

so, I know the difference between 1000 and 1024, and the typo is around here:

The original Inform 7 z8-version is 258 kB, the Dialog z5-version 127 kB, the ZIL z5-version 48 kB, and the z3-version PunyInform version is 50 kB.

hope that I have kept enough gentlemanly…

Dott. Piergiorgio.

See the post above. I’ve updated the binaries with the -e switch, which made them much smaller. It is a moving target anyway, so see it as a relative comparison.

I don’t remember offhand exactly what the limit was when you wanted to make a Ozmoo z-file that was loaded into memory on a C64 (as it was loaded from tape), but it was around 53.000 bytes. So you are way under that bar now. This was something I wanted to achieve with the ZIL version, you know - open “Craverly Heights” up to the whole 8-bit market (I jut need to set up the Puddle BuildTools environment)…

1 Like

I have fixed the two things that were discussed yesterday (get all on, and pair of glasses), and made a few minor improvements in the text styling routines for the z5-version. The source and binaries have been updated on my github page, see link in the first post above.

3 Likes

I recompiled with 96 abbreviations and Inform 6.36, compiled from source. This version contains a recent patch (28 June) to improve application of the abbreviations. The z3-version is now 49 KB (49232 bytes in the z-machine), and the z5-version 50KB (50664 bytes). That’s good enough for me.

5 Likes

Just wanted to add that Fredrik Ramsberg converted my PunyInform version to standard Inform 6. See Craverly Heights in Inform 6

2 Likes