Re: Liquids (and Inform)


14 Mar 95 04:54:06 GMT

nelson@vax.oxford.ac.uk (Mathematical Institute, (0865) 2-73525) writes:

>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.

This sounds remarkably like the system that was used in GC. I've
rejected this approach for my project, principally because it keeps
liquid contents seperate from conventional contents. It is a nice
elegant approach, though.

>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 part interests me. In particular, I'd like to know how you handle
mixtures of arbitrary liquids. Do you have special "mixture" liquids?
I'm a bit wary of making it necessary to specify the properties of each
possible combination of liquids, you see.
Abstracting the mixing away from specific verbs is a good idea. In fact,
abstracting actions in general is a good idea. It can only make your
code more robust - if you want a bucket of whitewash to fall down when a
door is opened, you really want a single routine that gets called no
matter what caused the door to open.

-- 
Carl Muckenhoupt | Is it true that Kibo habitually autogreps all of Usenet
baf@tiac.net     | for his name?  If so:  Hi, Kibo.  Like the sig?