Phantasmal MUD Lib for DGD
|
Phantasmal Site > Design > Actions & Events Actions and Events in MUDsImagine a 'perfect' MUD, one that handles multiple languages, differing perceptions and event grouping, including everything that the Visibility document mentions, and does it all seamlessly and flawlessly. Let's describe what it actually does and start assigning some names to components. There are instant events going on all the time. Instant events are anything that can echo text to a player. For example, if somebody says something in a room, that's a simple instant event. If a cannon fires, or a man in a suit enters the room, those are also instant events. The text that is displayed may be different for different players. In some cases no text may happen at all. If no players' characters are in the room, or the event is too subtle for them to perceive, or if the event gets grouped with other events and echoed later, then no text will be displayed for the event. Different text will be sent to different players if the players speak different languages, and perhaps if the characters have different levels of some specific perception skill. Some events will have multiple components -- an obvious component and a hidden one, for instance, or components for multiple different senses such as hearing and sight. The player will receive different text in different circumstances for these events, and our perfect MUD will group the various components into a potentially smaller number of pieces of text. The cannon firing, despite the hearing and smell components, can still all be grouped together as "the cannon fires". Sets of events that are grouped together, and all go off together from the same trigger, are called Composite Events. They are the easiest kind of events to combine into less text since they are already lumped together. Every event will consist of some pieces of player-perceivable markup (PPM). A piece of PPM can appear differently to a character depending on skills known, light level, and other factors described here. Traditionally, instant events in MUDs consist of one chunk of PPM each for "to actor", "to victim", possibly "to self" for reflexive verbs, and "to others". Specific multi-targeted events might have more, and untargeted events will have fewer. Every PPM will effectively consist of a set of Phrases. A Phrase (in Phantasmal) is a string which can appear differently to different players, but not usually to different characters. A Phrase can often translate itself into different languages, so it will appear differently to a player who has requested an English interface than one who asks to view the MUD in Spanish. It may also contain simple markup like bold, italics, or color codes, which are individually translated by different players' terminals. Phantasmal doesn't yet support a separate PPM object, though it probably should. And it should name it something snappier :-) Each instant action will also carry information about what sense it occurs in (sight, sound, taste, touch, vibration, infrared, ESP, etc). This may be combined with information about what skills are required to perceive the event. Timed events are, in effect, scripted arrangements of instant actions. A timed event is an action that conceptually occurs over a significant period of time without changing. A buzzing sound, the sharpening of a blade, the smell of banana leaves and an army shuffling down a muddy slope could all be represented as timed events. The common factor is that each of these takes a nonzero period of time within the MUD. Timed events consist of an instant event to begin, another for people coming into range (walking into a room with the sound, for instance, or coming into view of the muddy slope), another for when the event stops, another for when you exit its field of influence and a final event for when it is interrupted. Thus, for the buzzing sound: > north You enter the aviary. You hear a buzzing sound here. > put in earplugs You put in earplugs. The buzzing sound is no longer audible. > remove earplugs You remove your earplugs. You hear a buzzing sound here. > south You head south. The buzzing sound is no longer audible. You enter the Boring Room. You should leave north. > north You enter the aviary. You hear a buzzing sound here. > listen There's a buzzing sound here. It might be coming from some bushes. > stomp on bee You stomp on the bee hidden in the bushes. The buzzing sound stops abruptly. The Continuing Action may have different 'ending' events depending on how it finishes. For instance, the action of drawing a sword might be an event designed to allow for interruption: > draw sword You draw your sword with a flourish. > sheathe sword You do. Odin enters. > draw sword You reach for your sword. Quick as a flame, Odin wields his spear. You draw your sword with a flourish. Note that the sword-drawing event has no starting sub-event (or else that event is silent). The event says that you draw your sword if the action completes successfully, but says that you reach for your sword if it's interrupted. An example of a complex action with several senses: An explosion rocks the hall, the first of many. It shakes you down to your toes. > close eyes You hear an enormous "boom!" and smell smoke and brimstone. You are shaken down to your toes. > hold nose You hear an enormous "boom!". You are shaken down to your toes. > curl up in a ball on the floor You hear yet another enormous "boom!". You smell smoke and brimstone. > am I holding my nose? No, your arms are around your knees. |