Inform 6: Maximum Boolean Amount for Objects

Does anybody know what the maximum amount of boolean variables can be for an object? I like boolean variables vs an array because I can give them meaningful names, and I’m wondering how many I can get away with within one object.

Thanks for the help - D

Are you asking about object properties, like “obj.foo = 1”, or object attributes, like “give obj fooattr”?

In Z-code you can use a whole lot of object properties – about 16000 is the limit. Attributes are limited to 48 (but the library uses many of those already).

Glulx goes somewhat higher.

I’m trying to do something like this with my own version of topic variables:

aunt.tpcmurder = true;

In this object:

Object aunt “Mildred”
with name ‘mildred’,
description [;

],
tpcaunt false,
tpcuncle false,
tpcmurder false,
has animate female proper;

At around 20 the list starts to look long, and I’ve already funneled off my conversation topics into another object. If 16,000 is the limit, which is incredible, should this work in all interpreters like Frotz and Parchment?

Thanks - D

That will work in all interpreters.

(The limit is 16000 property names across all objects. But it looks like you’re sharing the same set of property names across many objects, so that’s okay.)

These properties do use up Z-machine memory, which is a separate limit. However, it doesn’t look like you’re really using a lot of memory for this purpose. If you defined twenty properties on every object in the game, it might start to be a problem.

Thanks for the help Zarf.

With this amount of flexibility I’ll be able to control conversations the way I want to.

Hopefully my characters will feel a bit more real. :smiley:

  • D