Re: Liquids (and Inform)


13 Mar 95 15:29:03 GMT

In article <baf.794275999@max.tiac.net>, baf@max.tiac.net (Carl Muckenhoupt) writes:
> I've started writing a library for TADS with Worldclass that will handle
> liquids sensibly, to the level of detail we expect from WorldClass.
> I fully intend to make this public, so I'm looking for suggestions.
> Some of the pricipal additions I have in mind are:
> * New verbs 'fill' (fill with) and 'pour' (pour on, pour into)
> * Divisibility of liquids, using TADS 2.2 dynamic object creation
> (so it isn't nearly the headache it used to be)
> * Sensible interpretation: some verbs (like 'take') will refer to the
> liquid's container, others will refer to the substance. (This will
> probably be the hardest part.)
> * Possibly a liquid-specific container class or two
> What would you, as programmers and as players, like your liquids to
> do?
>

Interestingly, I've just implemented such a library for Inform, so
I've been thinking about just this problem. I've not used the ordinary
containment system for liquids, so I don't need to dynamically allocate
objects: one prototype object is needed for each different liquid in the
game. An amusing set of parsing rules moves the names of liquids into
scope at the right times.

Broadly speaking, I whittled down the requirements to a minimum:
drinking, filling a container, pouring onto something, and pouring away.

Each liquid-container has a capacity, which can be "infinite" (e.g.
a fountain is inexhaustible, a bottle is not).

Finally, actions are generated when liquid 1 is added to liquid 2
(and this is not assumed to be symmetrical), when a liquid is added
to a solid (e.g. water added to a beanstalk plant) and vice versa
(e.g. a lump of sodium dropped into a bucket of water). These last
three can all happen in various different ways, so I think it's useful
that the rules can be written once only. For instance, the prototype
"water" object contains a generic rule for what happens when water is
added to oil.

This is minimal, but I can't think of any way it's restrictive, given
the usual library rules. It more or less works now; I'll post it soon
for anyone who's interested.

Graham Nelson
Oxford, UK