[Reality] Unsatisfactory Consequences

Allen Short reality@twistedmatrix.com
Thu, 06 Mar 2003 10:21:04 -0600 (CST)


----Security_Multipart(Thu_Mar__6_10:21:04_2003_661)--
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


This was my original writeup for the blow-verb example. Unfortunately,
almost none of this actually works at the moment.

To start with, the parser doesn't look at any of the participants'
interfaces before dispatch, so "blow whistle" results in ambiguity,
as do the other two commands. 

ToolActions DTRT when tool = None. However, there's no feedback to
indicate this, such as "(with the rocket)".

There's no code for picking up tools before using, but it has been
pointed out that this might be a feature.

Finally, events emitted by closed Doors do not propagate beyond the
Door itself. should Door.collectImplementors check whether asker is
self?

Another bothersome thing: formatTo methods get run only after
doAction. I can understand why -- you dont want to run them if the
action fails -- but this makes things look odd when the results of the
action print before the confirmation of its execution does. ("You
destroy the grid bug! You start bashing monsters with your pickaxe.",
etc.)

Thoughts on which bits needs to be fixed in the code and which bits
need to be fixed in the paper?

-------------8<----------------------------------------------------

EXAMPLE ONE: the 'blow' verb

There is a rocket launcher here.
There is a whistle here.
There is a lit birthday candle here.

> BLOW WHISTLE

For simplicity, parsing is currently done by looking up the first word
in a hashtable and calling each of a list of methods with the rest of
the string. Each parsing method returns a (potentially empty) list of
Actions. As the example will show, in this case only one action is
returned, PlayMusicalInstrument. The action is then dispatched, which
in the default case calls the toolActionPlayInstrument method on the
whistle.

- You blow a shrill burst upon the whistle.

> BLOW CANDLE

Here, the same parsing methods are run, but the Extinguish action is
returned instead, since the candle does not have an adapter for
IPlayInstrumentTarget, but does have an adapter for IExtinguishTarget.

- You blow out the birthday candle. Hope you made a wish.

> BLOW UP DOOR

- (with the rocket launcher)

Since the door is not itself explosive (does not implement
IBlowerUpper), the parser looks around for a tool to do the deed. It
finds one, and instantiates the BlowUp action, and dispatches it.

- [first taking the rocket launcher]

The dispatch notices the tool is not in hand, and runs a Take action
for the tool. It succeeds, and the dispatch continues, next creating
an ExplosiveDamage action targeted at the door.

- *BOOM*! The rocket hits the door and blasts it to smithereens.

In this case, the door obligingly explodes.

----Security_Multipart(Thu_Mar__6_10:21:04_2003_661)--
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQA+Z3V3Ed6n5DRBYM4RAnrlAJ9+6Lc77jSzFC9K/P8cbFxKJU2QSwCeOmkm
L2jV7aFILRvKUUxPRaPiyts=
=Iw+H
-----END PGP SIGNATURE-----

----Security_Multipart(Thu_Mar__6_10:21:04_2003_661)----