We’ve added a bunch of new features to the Dialog compiler in the last year, and I’m very happy with how it looks now! The $8000 bug in particular removed the most important RAM limitation from the Z-machine backend, allowing much larger games to be made.
But those larger games are starting to hit other limits now. Wise-Woman’s Dog is at about 97% of the total file size limit for Z-machine version 8, most of that in ROM—strings and routines. My next priority is getting that ROM usage down through new optimizations.
There’s not much to be done for routines, because the compiler guts are horrifically complicated and I don’t grok them well enough to make fundamental changes there. For strings, though, the Z-machine has two optimizations built in that Dialog doesn’t currently use: abbreviations and custom alphabet tables.
For the abbreviations, I want to start with the most basic possible implementation, so people can go in and make further enhancements later. In particular, I want to start with:
- A default stock of abbreviations, not customized per game but built into the compiler
- A greedy matching algorithm to apply them, not Wagner’s perfect match algorithm
Once this is implemented, we (probably meaning other people, not me) can go back and add other enhancements, like automatically calculating abbreviations for each game and using a better matching algorithm. But the basic implementation should help in the meantime, and it’ll give people a base to build from.
Which means first, I need a basic set of abbreviations that should be broadly applicable across games: things like " the " and "You " that are common in library messages and parser IF descriptions. There are tools like ZAbbrev to compute these automatically, but they need a set of strings to optimize.
And that’s where you come in! I’m going to be making a debug build of the compiler that dumps all its ZSCII strings to an external file, compiling a whole bunch of different Dialog games with that debug build, sticking the files together, and feeding that to ZAbbrev to make the standard abbreviation set. I already have all of my games—Miss Gosling, Familiar Problems, Wise-Woman’s Dog, Stage Fright—as well as Impossible Stairs, which is open-source. But if you’d like to contribute to this endeavor, let me know, and you can either send me your full source, or build the debug compiler and send me the output. My goal is to get a representative sample of Dialog games so that the default abbreviations will be widely applicable to anything people write.
If you’re interested, let me know here or in DMs. I don’t know when this project will really take off (possibly not for a month or two), but I think once a basic implementation is in place, people will be well-equipped to improve it.