Port of Sand-dancer in Dialog

I’ve just created a first release of Sand-dancer for Dialog.

It’s is playable on the web and can also be downloaded separately.

Source code is on GitHub:

This is a re-implementation of Aaron Reed’s Sand-dancer game in Dialog, the subject of his excellent book Creating Interactive Fiction with Inform7.

This is a medium sized project, coming in at about 5K lines of code, compiling to 210K of bytecode. I’ve been working on it, very occasionally, for eight months (!).

I’m very interested in feedback about the game itself (bugs, improvements, and so forth) as well as the code I’ve written.

I’ve learned a lot even getting to this point; I hope others can learn something as well.

My next work will be somewhat more original!


Can you lob up the .aastory as well?

I haven’t built that yet. Let me see.

Ok, I’ve uploaded it but not tried it out yet.

(never mind, now I found it)

Interesting how a thing like inventory display can affect the way we interpret the information we’re given.

I can’t immediately put my finger on all the differences, but I can definitively say that these two things do not provoke the same reaction in me.

From the I7 Sand Dancer original:

You've got:
  a lighter
  a denim jacket (being worn)
  emotional baggage (empty)
  a wallet (closed)
  a folded photo (closed)

In Dialog (aa/C64):


Dialog version doesn’t seem to like either the term “sand-dancer” or “sand dancer” even though it looks like you want it to?

Dialog (z8):

> get sand-dancer
(I only understood you as far as wanting to take something.)

> get lizard
You can’t reach the brown lizard.

> get sand dancer
(I only understood you as far as wanting to take something.)

I7 original: (different blocker message but it seems to understand it as the same target)

>get sand-dancer

The pickup truck isn't open.

>get lizard

The pickup truck isn't open.

>get sand dancer

The pickup truck isn't open.

Some of that is preference; I don’t like listings for inventory, I want prose.

I think I just didn’t add a (dict *) for the lizard. I just added and it and no problems.

Hm. How much work do I want to make that “In your emotional baggage are your grandma’s stories”? I.e., (one item, but plural). Oh look, just need to add (plural *).

Not sure if you prefer the I7 approach, or the Dialog approach?

How does it play on C64?

I’m actually always a little put off by just how fast modern IF plays; I remember 2 - 4 second pauses (and some disk drive whirring) playing HHGG on my Atari 800.

1 Like

Inventory: Note also that the items listed are not identical. I see the photo in I7, but not Dialog. As for which I prefer or what I most-want-to-see-for-this-story I’m still not sure, but I know that the two things don’t look like A=B to me. (even leaving the photo out of it.)

Oldness: Yeah, old machines have that “ooh, it’s hitting the disk drive?! I must have done something that advances the story!” thing going for them. I have never really adjusted to the instantaneous response thing.

Performance: It’s almost exactly 1 minute to go from powering up the 64 to getting to the game’s first > prompt. That’s pretty fast, as C64 disk-load-text-adventures go. (Dialog uses a disk turbo, which helps. Also that timing reflects a setup without ram expansion. Extra RAM = faster gameplay but somewhat longer load time up-front.)

In-game performance is not stellar, but it does deliver the more-or-less stated goal of “worlds better than I7, and multiples better than unfettered I6.”

Each command in the startup sequence of:

>brood about stories
>x lizard
>x lizard

took about 20 seconds to parse/load/display. (again, these are non-REU timings.) That’s somewhat slower than I’d expect from Dialog C64 based on the limited range of prior stories.

With REU that becomes:

1:12 to start the game

2 seconds for inventory
7 seconds to brood about stories (Both timings don’t count realistic time to read the first page of text, this was mashing through the MORE prompt about as fast as it came up)
2-3 seconds for each x lizard

So, not quite instantaneous, some palpable Computing happens, but it’s minor.

edit: hey some C64 Zeugma .z8 timings because sure why not
startup time is a pain to calculate because starting up zeugma is a pain
8 seconds for inventory
28 seconds to brood about stories
15 seconds for each lizard examination

There’s probably ways to make the game more performant, and the need to support tune radio to 102.4 khz impacts performance a lot, I understand.

It’s all relative.

I7 Sand-Dancer, if I’m understanding this source code comment correctly, can’t even be compiled to Z-Machine at all (because I7.) So it was totally unavailable on 8-bit/severely constrained machines.

Dialog-Z8 SD running on Ozmoo on C64 takes five full minutes (5:05) to go from power-on to initial >

Inventory takes 4:12.

(So it could be worse!)

Yeah, I haven’t profiled it, but I wouldn’t be surprised if the machinery for the preprocessing and pattern-matching took up a decent part of the parsing time.

Are there any good profiling tools here?

Low-priority question, but can it be output as a .z5? I’d be curious to throw it at the official C64 Infocom interpreter (I’m guessing that the ckoba hack, at least, will work) and see what can be seen.

I mentioned the discrepancy with the photo in inventory before, but now I want to ask a different “is this how you want inventory to work?” question:

> open wallet

You open your wallet, revealing your driver's license, a receipt from Big Jimmy's, and a folded photo.

Something about the receipt from Big Jimmy's makes you want to brood about your shit job.

> i

You have your pack of cigarettes, a piece of jade, your lighter, your wallet, and your emotional baggage. You're wearing your denim jacket.

In your emotional baggage are your shit job and your grandma's stories.

So, even after I’ve opened the wallet, I don’t hear about the license/receipt/photo in inventory.


Whoa, mind-blowing:

> get out

Did you want to:
1. get out of the pickup truck, or
2. get out of the pickup truck?
(Type the corresponding number)


Both games have amusing responses to this, but they are not identical and I7’s includes the mechanics-hint while Dialog does not:


>give shit job to lizard
(first taking your shit job)
As if. All you can really do is BROOD ABOUT it.


> give shit job to lizard

You dangle your shit job in front of it, but it just flicks it tongue in and out a little faster, staying put.

Funny, there’s supposed to be a rule for that (give shit job to lizard), must be a precedence issue.

No idea what’s behind the get out issue.

I’m probably not going to be able to look at a lot of this until the weekend.

1 Like

Although I like having lots of small source files for the game, the disadvantage is that you’re at one level of remove from what order all the rules are in, and that can be critical.

This one’s more serious. This is through the aam interpreter on your site:

> give emotional baggage to lizard

(Technical trouble: Heap space exhausted. Attempting to recover with UNDO.)

Undoing the last turn (give emotional baggage to lizard).
Middle of Nowhere

(the I7 version doesn’t crash but also isn’t great with it)

>give emotional baggage to lizard
You dangle emotional baggage in front of it, but it just flicks its tongue in and out a little faster, staying put.

Update: The Dialog .z8 gives the same output as I7 on this command. So this error looks aam-specific. Tagging @lft


Inventory part the nth:

I7 calls the cigarettes in inventory “a pack of cigarettes you should have given up months ago”, Dialog just calls them “your pack of cigarettes” and that’s definitely different story information.


Did you attempt to implement the setting-specific error messages? ala


>take fewuiuwf

Uh, not sure about the noun there, brohim.

Not finding any sign of that line in the .dgs.


I7 makes it easier to smoke and has a detail about quantity that Dialog doesn’t. (Seems like you’re tracking the smoking count but not trying to display it?)


>light cigarette

You pull out a cigarette and flick it into life. Thoughts tumble through your head.

Well, you're still stuck here. It's dark outside the beam of your headlights. Maybe you could start by looking around the area, seeing if maybe there's a phone or something.

And you still haven't quit smoking. You've got five cigs left.


> light cigarette

(I'm sorry, I didn't understand what you wanted to do.)

> light up cigarette

You pull out a cigarette and flick it into life. Thoughts tumble through your head.

Well, you're stuck here. It's dark outside the beam of your headlights. Maybe you could start by looking around, see if there's a phone or something.

And you still haven't quit smoking. You crush the butt under your heel and wonder what to do next.


I was mostly interested in seeing if I would cause a stack overflow in either or both versions, but:


>knock knock

You don't really want to think about what you look like right now, especially when there's a totally legit likeness on the driver's license in your wallet.


> knock knock

(I'm sorry, I didn't understand what you wanted to do.)