Inform7 Size Limitations

Trying to learn inform 7 right now, and so far I’m really impressed. I’m a developer by trade with a long history in some of the “harder” languages, but the natural language syntax of inform is nevertheless very refreshing and exciting.

That said, while reading through the manual, it mentioned that there are some limits - I’m not sure whether it means memory limits or storage limits. In either case, whatever those limits happen to be it doesn’t explain.

In any case, could someone fill me in on this? I doubt I’ll hit the limits anytime soon, but I would like to be aware of where they are, even if they are far in the distance. Thanks.

As long as you’re compiling to Glulx rather than z-code, you basically don’t have to worry about it. If you’re compiling to z-code, the ultimate size of your compiled file can only be 512K, I think; if you’re compiling to Glulx, the ultimate size of your compiled file can be way larger than anyone has managed to hit. (There’s a multi-author project with 3.7 million words of source text that doesn’t exceed this limit, though it has caused some other problems with compiler bugs.)

There are other internal limits that can be exceeded if you do something weird, but with most of these it’s possible to change the settings to take care of it. I think one example might be that there’s a certain amount of memory set aside for tables, but if you exceed that, you can just add a line that tells Inform to set aside more memory for tables. In any case, it’s difficult to summarize these because are there are many cases, but you don’t need to worry about them; in the unlikely event that you encounter one it should be relatively easy to fix.

1 Like

Thanks matt w. That’s good to hear.

Glad to help! I noticed that I made a couple of nonsensical typos so my original message might make a little more sense if you read it again :slight_smile:

The main restrictions are that a z8 file can’t exceed 512K and that the dynamic+static memory regions of the file (stuff besides text strings and executable code) can’t exceed 64K. This latter constraint is because z-machine words are 16-bits long, so 64K is the max amount of memory that can be freely addressed by a z-machine pointer. There are more constrained pointers called packed addresses that allow certain instructions to call routines and print strings stored in the rest of memory. See the spec for details if you’re interested.

In short, Inform can pretty much handle any standard story you throw at it. If you’re familiar with IF, it will make an Infocom-sized work with no problem. It has been used to make novella and novel-length works as well. Most of the time exceeding the limits invariably means that the author is doing something weird and needs to re-scope what they are doing. A new author mistake is over-implementing, but soon you learn that nobody really needs to actually implement and simulate every leaf that the protagonist is raking up or force the player to carry out every step in brushing their teeth with a limited amount of toothpaste, a tube with a cap, a brush, separate sections of the mouth; when all this can be shortcut using prose >BRUSH TEETH. “You brush your teeth thoroughly, noting you’ll need to buy toothpaste soon.”

It is possible on occasion to hit limits if there are a lot of objects or relations or adjectives in a game. In most cases these are arbitrary limits set within Inform to keep things tidy which can be easily increased. The compiler will direct the author to do this when it happens.