Event Propagation
Event propagation is the means by which events are sent from their creators to their receivers. When an event is created, propagation is the thing which assures that it will get to where it needs to go. Since the locational relations of objects in the FærieMUD world are expressed through one kind of containment or another, the types of propagation which need to be implemented can also be expressed (for the most part) by which direction in the containment heirarchy they move.
Outward or Search Propagation
http://www.faeriemud.org/attachment/wiki/EventPropagation/outward-event-propagation.png?format=raw
The movement of events upward in the containment heirarchy is outward propagation, also called "search propagation" because it is used to trigger a search for applicable targets. Events which expand or travel use outward propagation.
In the diagram above, the clock object is generating an AuralEvent; perhaps its chime is sounding or its second-hand is ticking. This is the means by which the other objects in that area will be informed of the clock's action.
When an event is dispatched in this manner, it will move to the generating object's container, and that object's contents will be searched for objects which match the event's target criteria. If objects which match the criteria are found, the event will be re-propagated to them using inward propagation. The event is then queried by the container to see if it needs to move outward again, using the container as an argument. The event may test the container for variables which affect its propagation, such as the size of the container; hard, soft, or ephemeral container boundaries; strength of event effect, etc. The event may also at this point apply itself to the container to achieve effects like explosion, damage to inside surfaces, reflection, etc. If the event indicates that it should continue its outward propagation, it is dispatched to the next outward container, and the propagation process begins anew.
Inward or Targeted Propagation
http://www.faeriemud.org/attachment/wiki/EventPropagation/inward-event-propagation.png?format=raw
Inward propagation, on the other hand, is the movement of events downward in the object containment heirarchy of the world: from container to contents. Damage events, for example, will tend to propagate inward. Setting a bag on fire would perhaps propagate damage events to the bag's contents; lesser events first, and then greater and greater ones as time goes on and the fire does more damage.
In this diagram, the AuralEvent generated by the clock in the first diagram is now being propagated back to the containing Area's contents, including the clock itself. The objects aren't obligated to respond to the event at all, and the clock probably wouldn't.
Lateral and Special Propagation
There are times when an event may not be modelled adequately using the directional propagations. For these situations, a special sort of propagation may be called for.
- Propagation outside of the world object?
— GedTheGreysHain - 13 Aug 2001
Attachments
- outward-event-propagation.png (18.2 kB) -
Outward event propagation illustration
, added by ged on 05/24/05 11:16:44. - inward-event-propagation.png (21.4 kB) -
Inward event propagation illustration
, added by ged on 05/24/05 11:46:18.
