Messages and Announcements

Motivation

Maintain a prosaic tone and delivery throughout interactions with the simulation.

Support gameplay elements that alter the character's perception of the world, and represent those effects to the player.

Ultimate Disposition

All messages are eventually disposed in one of two ways:

For the purposes of the following, the builtin function notify() delivers raw Markdown to the UI, which handles markup conversion and presentation. The method :notify(args...) applies unspecified transformations on args... before delivering the result to notify().

Kinds of Messages

Processing Models

Parallel Entry Points

In this model, there are separate entry point methods for diegetic and for non-diegetic messages. Each entry point performs appropriate processing, then calls into internal methods shared by both message forms to deliver messages to the UI.

This model requires more names and is slightly more complex to explain, but splits the responsibility for output delivery from the responsibility for accepting non-diegetic messages, leaving each piece conceptually simpler.

Diegetic Filter Methods

In this model, the internal methods are the entry point for non-diegetic messages directly, as they have no processing to perform. Diegetic messages instead call the non-diegetic machinery after performing any diegetic message effects.

This model requires fewer names, and avoids what will in practice be a layer of "do-nothing" methods where non-diegetic entry points blindly call internal helpers, but combines the responsibility for non-diegetic output with message delivery.

APIs

Primary Diegetic Verbs

These methods are designed to be chained, to make it simpler to simulate partial impairment while allowing the game's prose to focus on the most appropriate "available" sense for each character.

player:you_hear(spoken_message) || player:you_see(lips_moving_message);

In spite of the names, these methods do not prepend "You hear" to the output. The naming distinguishes single-recipient messages meant to be sensed by a single object from messages to be delivered to the occupants of a container or room:

As with the single-recipient methods, these are meant to be chained, but the structure of a chain is different:

player:you_hear(you_say_message) || player:you_feel(your_lips_move_message);
unsensed = room:hear(heard_say_message);
unsensed = room:see_only(unsensed, lips_moving_message);
unsensed = room:smell_only(unsensed, smelly_breath_message);

Primary Non-Diegetic Verbs