Is there any reason to pick Z Machine Version 4 over 5?

Okay, so the key differences:

V3: 6 letter dictionary, 255 object limit, 8 bytes per property, 31 properties, 32 attributes. Calls have up to 3 parameters. 128k max story size.

V4: 9 letter dictionary, 64k object limit (you’ll exhaust dynamic memory long before that), 64 bytes per property, 63 properties, 48 attributes. Calls have up to 7 parameters. High memory multiplier is 4 instead of 2. 256k max story size.

V5: More instruction permutations (like calls that implicitly drop their return) and no longer have one word per parameter at the start of every routine.

I mean, unless a story used the BNOT instruction thousands of times and used very few routine parameters, I can’t think of a situation where v4 would be better than v5. The only reason I can think of v4 being a win is if for whatever reason a v5 interpreter didn’t exist on some platform while v4 did.

-Dave

I would say no. v4 was superseded by v5. v5 is much more widely used. My impression is that there is no platform that only supports v3 and v4; and not v5.

3 Likes

I also believe that is true.

1 Like

Yeah, the only commonly-used Z-machine versions nowadays are 3, 5, and 8; 1-2, 4, and 7 are mostly seen as transitional forms that don’t really have anything to recommend them. Any (commonly-used) platform that can play 1-2 can play 3, anything that can play 4 can play 5, and anything that can play 7 can play 8, so using them just limits you—and doesn’t generally limit you in fun and interesting ways, like trying to fit your game into version 3 does.

(6 is its own weird thing; it would have plenty of reasons to use it, but basically no interpreters support its unique features.)

3 Likes

For a comprehensive list of differences, see:

I started out targeting V4 with Rascal, just because I wanted to use the minimum version necessary on principle, until I needed to use @catch and V5 became necessary.

4 Likes

In V4, the initial text scrolls up from the bottom of the screen. In V5, it starts at the top of the screen. I prefer the V4 way (also in V1..V3).

3 Likes

That’s from 8.7.3.3. Though note that many interpreters (particularly Glk ones) won’t strictly follow that paragraph and will use the same behaviour for all Z machine versions.

2 Likes

You probably meant something like “basically no Glk interpreters”. Frotz is a great interpreter (with a great Emscripten port.)

Your point still stands, though.

1 Like

Is there any reason to pick Z Machine Version 4 over 5?

An abiding urge to discover really obscure interpreter bugs for its own sake, maybe.

4 Likes

Windows Frotz is the only one I know of, though; is there an interpreter for Linux that has full support? I thought the various descendants of Unix Frotz didn’t handle graphics properly.

Viola does support v6 as well. That should work on most operating systems that support Python.

4 Likes

I can’t check at the moment, but I’m pretty sure sfrotz/sdlfrotz has full support for graphics and sound on Linux (as long as the necessary blorb file is found.) See for example:

1 Like

Yes, sfrotz works for me (on a quick go starting up Journey).

Also, one of the headline features in the recently-announced Gargoyle 2026.1 was “support (more or less) for Infocom’s graphical version 6 games”. (I haven’t tried it.)

Full version 6 support is by no means universal, but there are options.

1 Like

I stand corrected! I thought support was still fairly minimal.

Now we just need people to actually write version 6 games…

Bocfel’s (Gargoyle’s) support is special cased for the Infocom Z6 games, newer Z6 games would have much reduced compatibility. Stick to Glulx if you want graphics etc.

I agree with Danii, Z6 should stay as a “legacy” format and is best avoided for new games.