Re: Limitations of Inform and TADS?
Sat, 4 Nov 1995 11:52:38 -0500
msphil@aardvark.cc.wm.edu (Michael S. Phillips) writes:
> In article <GDR11.95Nov3143447@stint.cl.cam.ac.uk>, gdr11@cl.cam.ac.uk (Gareth\
> Rees) writes:
> |> Object Dam
> |> with ...,
> |> daemon [;
> |> if (self.water_level > 5 && FloodGates has open)
> |> ! release the water
> |> ];
>
> I have been working on an adaptive hints drop-in library for Inform, and
> I have been tinkering with daemons and the like. On my piddly 386SX20,
> the above solution (with the amount that the hints module has to do to
> check game status) is significantly slower than, say:
>
> ! Note that this is declared as part of the player, but concealed,
> ! so the each_turn *is* done each turn.
> Object Dam_Checker selfobj
> with concealed...
> each_turn [;
> if (Dam.water_level > 5) && FloodGates has open)
> ! release the water
> ];
>
> *Is* this solution faster than such a daemon?
Of course it is. each_turns are only executed when you're in the same
room (really, in scope). So if you have a bunch of your examples in
many different rooms, only one will be executed per turn. Whereas all
active daemons execute every turn.
The question, of course, is whether it's acceptable for the water to
only release when you're in the dam room.
--Z
"And Aholibamah bare Jeush, and Jaalam, and Korah: these were the borogoves..."