Craverly Heights: Inform 7 and Dialog side by side

Ryan Veeder has kindly allowed me to port his game Craverly Heights to Dialog, and show the two implementations side by side:

https://linusakesson.net/dialog/craverly/craverly_side_by_side.html

Don’t miss this unique opportunity to compare and contrast two IF programming languages while simultaneously enjoying the brilliance of Ryan’s writing!

In addition, this serves as an example of what the Dialog source code of a complete, small game can look like.

11 Likes

That was a wonderful read! Thank you to you and Mr. Veeder for this! I definitely learned a few things.

2 Likes

Brilliant.

As is all of your work.

Thank you.

1 Like

This is absolutely fantastic! Recently I’ve been thinking about the development of Inform 7 and Dialog, possibly using both together in some classes I conduct. (Personally, I see Dialog as an interesting “different path” that gives Inform 7 some viable friendly competition for thought space.)

One of my upcoming classes will be focused on showcasing different modes of expression for providing narrative via interactive fiction. I literally could not ask for a better example to help me think about that class than this!

1 Like

I somehow missed this until browsing the lft homepage.

Because I enjoy this sort of thing I just ran a time trial between C64 Å-Machine (compiled on currently-newest Dialog and bundler) and the original published I7 .z8 on Ozmoo (.d81 build mode, it was either that or dual-1541 and .d81 feels cleaner).

I picked the first ten meaningful commands from the ClubFloyd transcript of Craverly and my intention was to do a head-to-head comparison, but unfortunately the usual “I7 games take several minutes per move” guideline is holding true.

So, on VICE x64sc NTSC with stock ROMs (and no carts/REU/etc.), the Å-machine variant took:

boot to initial prompt: 43 seconds
initial prompt through first ten moves: 54 seconds

examine pauline
examine me
i
Hug pauline
Talk to pauline
E
examine shelves
Take all
examine glass 
     (magnifying glass)
examine sunglasses

Not the insta-scroll of today’s supercomputers, but an 8-bit experience I feel comfortable endorsing as “plenty good.”

As for the I7 side, it took just under 6 minutes to get to the > prompt and about 4 minutes per command so at 30 minutes in and only about half of the commands run, I’m calling off the contest.

But it’s nice to have perspective!

2 Likes

And I think I just discovered a bug.

I7/Parchment:

>examine satchel
It's a small suede pouch, as luxurious as the prize it comtains.

>open satchel
Yes, they're all in here. The jewels that caused you so much trouble, trouble that caused you to commit so many crimes, crimes that caused you to spend so long in prison.

Dialog:

1 Like

Thank you for this benchmark! It is very gratifying, of course.

May I suggest one more point of reference: The Dialog version, compiled for the Z-machine, running on Ozmoo? That would indicate how much of the performance boost is due to Dialog and how much is due to the Å-machine. I have no idea what the outcome will be.

Thanks! I’ll take a look.

Dialog-based craverly.z5 on Ozmoo vs I7 craverly.z8 on Ozmoo, same test environment as before:

boot to initial prompt: 192 seconds (vs. about 360 for I7 .z8)
initial prompt through one move (EXAMINE PAULINE):144 seconds (vs. about 240 for I7 .z8)

1 Like

Curious geometric-ish filesize trivia:

.aastory binary: 64k
.z5 Dialog binary: 128k
.z8 original I7 binary: 264k (so close!)

Edit: More benchmarks

I decided to go back to gameplay benchmarking and preload to REU, taking the brutal disk I/O out of the equation. Still very slow, but not so slow that I lost tolerance for the process.

From initial prompt through first 10 commands as shown above:

.z5 Dialog binary: 140 seconds
.z8 I7 binary: 385 seconds

2 Likes

May also want to look at what’s (not) happening with that (no space) on the dead-body interaction:

}, but it's too late,” you announce, your voice weighed by the burden of monstrous regret brought on by the enormity of the fact that you have brought from the realm of the unspeakable into the realm of the true: “(no space)
	(if) (male $Obj) (then) He's (else) She's (endif) dead.”

still outputs

> touch pauline
“I wish... I wish I could touch Pauline, but it's too late,” you announce, your voice weighed by the burden of monstrous
regret brought on by the enormity of the fact that you have brought from the realm of the unspeakable into the realm of the
true: “ She's dead.”
1 Like

Thanks! I stumbled over the same bug a few days ago, and a fix is on its way in the next release. The bug only affects the Z-machine backend.

Do you know the source of the unsatisfactory satchel situation?

Was my later REU-based benchmark at all interesting?

For a full comparison it would be interesting to see Inform 6 and ZIL ports. But I’m not volunteering :wink: .

1 Like

I know the printed (description/response) text substitution would be pretty easy in ZIL. What I’m wondering about would be the handling of

#script
.
.
.
(name *)
	(if) (backstage) (then)
		script
	(elseif) (prog 0) (then)
		couple sheets of paper
	(else)
		set of test results
	(endif)

because I don’t know if you can pass an item name off to a routine, or if you’d have to bludgeon the name manually every time the player transitioned between these states.

(update: oh yeah, Suspended does this sort of thing for a living, using a table based on the robot holding the item…)

<OBJECT CHIP2
	(IN PANEL)
	(SYNONYM CHIP CHIPS DEVICE DOS)
	(ADJECTIVE NOISEL BRAIN BUMPY SMALL FILTERING YELLOW CX2)
	(OBJDESCS <PLTABLE 1 1 1 0 1 1 "small yellow chip""bumpy device"
"filtering device" "noiseless device""brain dos""CX2 chip"0 0 0 0 0 0 >)
	(FLAGS TAKEBIT TOUCHBIT)
	(DESC "obj")
	(CLC-TXT <PLTABLE "This chip is a filtering processor (CX2)." 0 0>)
	(ACTION CHIPFILTER-FCN)>
1 Like

Yes, I see it. The code redirects [open #satchel] to [look #in #satchel], and defines a rule for (perform [look #in #satchel]). But the library provides some default rules to prevent [look #in $] when the object isn’t an open or transparent container. What the story code can do is to define an instead-of rule rather than a perform rule. I have made an updated version of the code, fixing the bug. Thanks for reporting it!

Yes, data is always nice. Thank you! So far, we have data for a couple of different scenarios (time to first prompt, time of first command, time of first ten commands, …) so it’s a bit tricky to compare the figures. It would be great to have a table of times, with scenarios on one axis, and the different combinations of language and interpreter on the other. But I’m not sure if the forum has syntax for tables.

1 Like

Easy to find out:

column a column b column c
some random text
2 Likes

Aha, thanks for the explanation. I tried to look at it in the debugger but A. I’m overmatched, as usual and B. for some reason the win32 debugger is now running extraordinarily slowly in wine, when it used to perform just-fine.

As for the stats, yeah I can prettify them, and/or run more extensive trials if there’s a particular department of performance you care more about. Right now I’m just throwing out figures which seem potentially interesting to me.

(Also, is there a reason not to put the playable C64 build out there, as you have with Tethered and Pas de Deux?)

Just that I haven’t brought it up with @Afterward. It’s his game.