Memory economy for Inform 6?

I have encountered the memory limit for an Inform 6 game I am creating. The error given is, “This program has overflowed the maximum readable-memory size of the Z-machine format”. I’ve looked into this, and for Inform 7, it looks like you can buy yourself a bit more readable memory by using the command “Use memory economy” in the source. But Inform 6 doesn’t use the “use” format, and I can’t figure out how this is done for Inform 6.

I know the alternative is to cut out objects, but I’d rather not do that unless I have to. If anyone knows a way to use memory economy I’d be grateful!

The memory economy option just removes some data for some debug/test commands, so there’s no parallel for Inform 6.

I’d have thought that the first alternative would be to compile to Glulx instead of Z-code.

You might be able to cut properties or arrays. But, yes, this is what Glulx is for.

I admit, I don’t know about Glulx except for a few references to it. My Inform skills are several years old and I just brushed them off to make this game. Do I need to change the source code at all to compile to Glulx? Or is it just a matter of downloading and running a different compiler?

Here’s a short answer from Roger Firth’s I6 FAQ: “When you’re ready to try Glulx, you just need to use the -G compiler switch.”

There are, IIRC, some other differences if you’re using font coloring effects. Also if you’re accessing arrays directly. But no, you don’t have to use a different compiler.

There a few differences in Glulx:

  • No colors (although styles can have colors assigned).
  • No font 2 or font 3.
  • You must set up the windows first, before it will do anything.
  • If you are using assembly language codes, you will need to change them to use Glulx instead.
  • You cannot have graphics in text grid windows or text in graphical windows (although you can have graphics in the TTY window).
  • Like colors, margins are also only supported with styles.
  • No built-in support for beep sounds (numbered 1 and 2 in Z-machine) (you need to make up a sound file instead).
  • No menus (it is provided by some Glk libraries, but it is not standard).
  • No joystick.
  • No output stream 4.
  • Numpad isn’t supported (presumably they are treated as plain numbers inatead).
  • Piracy check is not supported.
  • No “sentence space” (although in Z-machine, only version 6 supports it anyways).
  • Glulx is less portable than Z-machine (although it is in general more powerful, and more powerful systems are generally less portable anyways, so this is to be expected; what it does mean, though, is that Z-machine should be used if it is suitable).

However, many of these things are rarely used anyways so you probably need not worry about it.

There are things that can be done to reduce the memory usage in Z-machine, although Inform doesn’t support these things. If you are using Inform, you will need to either use Glulx, remove some things from your program, or modify the Inform compiler.

This is a misleading phrasing, I think. Starting out, a normal Glulx user doesn’t have to worry about windows at all.

Maybe it is; maybe Inform or the standard library or something will automatically do it for you.