Testing Dialog

I want to do some testing of my game (really, the threaded conversation library I’m building).

My idea was to pipe a transcript into frotz and capture the output.

Problem: frotz really expects to be run interactively; I have to add quit and y to end of each transcript, and it still expects an input before terminating.

So is there an interpreter that runs on OS X that is command-line compatible?

How about dumbfrotz? It’s a Z-code interpreter that’s designed to be used on a dumb terminal, which makes it very good in pipelines (since it doesn’t try to do any fancy IO, just reads lines from stdin and prints lines to stdout).

Thanks! That might be the thing, or I’ll experiment with dgdebug.

I don’t know if this is in any way helpful to you, but I have a project working currently that uses a Python (3.x) script to drive dfrotz, and you’re welcome to adapt it as you see fit.

Much of it’s specific to the project I’m working on, but the code that handles the connection to dfrotz is bundled into an object that starts around line 750 of that file, and it might save you some time on initial scaffolding if you’re working in Python.

https://eblong.com/zarf/plotex/regtest.html also does this. I’ve used it with DumbFrotz.

2 Likes

I use a combination of dumbfrotz and dgdebug in my test scripts. Dgdebug is deliberately designed to use the same random number generator as dumbfrotz, so both methods should give the same output for the same input (for a given random seed).

Dgdebug is generally faster. To run from a script, do something like:

dgdebug -q -w 80 -s 1234 story.dg stdlib.dg <input.txt >output.txt

Dumbfrotz is slower, but can be used to verify that the game actually works on a Z-machine:

dfrotz -R mp -R lt -R ch1 -s 1234 -w 80 -h 999 story.z8 <input.txt >output.txt
1 Like

Thanks for the help. I’m having trouble finding dumbfrotz for OS X (and I don’t want to shave the yak of figuring out how to build it), so I’m going with dgdebug.

2 Likes