§3.7. Lighting
At any place (room, or inside a container) light is either fully present or fully absent. Inform does not usually try to track intermediate states of lighting, but see The Undertomb 2 for a single lantern with varying light levels and Zorn of Zorna for multiple candles that can be lit for cumulative changes to the light level.
Light can be added to, but not taken away: rooms and things can act as sources of light, by having the "lighted" and "lit" properties respectively, but they cannot be sinks which drain light away. The reason darkness is not a constant hazard in Inform-written games is that rooms always have the "lighted" property unless declared "dark". (We assume daylight or some always-on electric lighting.) A "dark" room may well still be illuminated if a light source happens to be present:
The Deep Crypt is a dark room. The candle lantern is a lit thing in the Deep Crypt.
Hymenaeus allows us to explicitly refer to torches as "lit" or "unlit", or (as synonyms) "flaming" or "extinguished".
For light produced electrically we might want a wall switch, as in Down Below, or a portable lamp, as in The Dark Ages Revisited.
The fierce, locally confined light thrown out by a carried lamp has a quality quite unlike weak but ambient daylight, and Reflections exploits this to make a lantern feel more realistic.
When the player experiences darkness in a location, Inform is usually very guarded in what it reveals. ("It is pitch dark, and you can't see a thing.") Hohmann Transfer gives darkness a quite different look, and Four Stars heightens the other senses so that a player in darkness can still detect her surroundings. The first of the two examples in Peeled allows exploration of a dark place by touch.
It is sometimes useful to check whether a room that is not the current location happens to contain a light source or be naturally lighted. This poses a few challenges. Unblinking demonstrates one way of doing this, so long as there are no backdrop light sources.
Cloak of Darkness is a short and sweet game based on a light puzzle.
See Room Descriptions for an item that can only be seen in bright light, when an extra lamp is switched on
See Looking Under and Hiding for a looking under action which is helped by the fiercer brightness of a light source
See Going, Pushing Things in Directions for making it hazardous to walk around in the dark
See Electricity and Magnetism for batteries to power a torch or flashlight
See Fire for a non-electrical way to produce light
| ExampleHymenaeus Understanding "flaming torch" and "extinguished torch" to refer to torches when lit and unlit.
|
|
| ExampleReflections Emphasizing the reflective quality of shiny objects whenever they are described in the presence of the torch.
|
|
| ExamplePeeled Two different approaches to adjusting what the player can interact with, compared.
|
|
"Undertomb 2"
Section 1 - Procedure
Brightness is a kind of value. The brightnesses are guttering, weak, radiant and blazing.
A brightness can be adequate or inadequate. A brightness is usually adequate. Guttering is inadequate.
Temperature is a kind of value. 100C specifies a temperature.
A brightness has a temperature. The temperature of a brightness is usually 700C. The temperature of blazing is 1400C. The temperature of radiant is 1100C.
A dead end is a kind of room with printed name "Dead End" and description "This is a dead end, where crags in the uneven rock are caught by the [brightness of the lantern] flame you hold aloft. Despite [river sound] there is no sign of the stream." A dead end is usually dark.
A dead end has some text called river sound. The river sound of a dead end is usually "a faint whispering of running water".
Section 2 - Scenario
The Undertomb is a dark room. "From this dim cross-groined room, exits depart east, south, and northwest."
East is a dead end. South is a dead end with printed name "Collapsed Dead End".
Northwest is a dead end called the Tortuous Alcove. The Tortuous Alcove has river sound "a gurgle of running water".
The player carries a book. The description of the book is "[if the brightness of the lantern is adequate]Many secrets are now yours.[otherwise]No, the print's too tiny by this awful light."
In the Undertomb is a lantern. It is lit. The lantern has a brightness. The lantern is blazing. The description of the lantern is "The lantern shines with a flame at [temperature of the brightness of the lantern]."
After waiting in the Tortuous Alcove when the brightness of the lantern is not guttering:
now the lantern is the brightness before the brightness of the lantern;
say "You wait so long that your lantern dims a bit."
Test me with "east / west / get lantern / east / west / south / north / northwest / read book / x lantern / z / x lantern / read book / look / z / x lantern / read book / look / z / x lantern / read book / look".
|  ExampleThe Undertomb 2 Flickering lantern-light effects added to the Undertomb.
|
"Undertomb 2"
Section 1 - Procedure
Brightness is a kind of value. The brightnesses are guttering, weak, radiant and blazing.
A brightness can be adequate or inadequate. A brightness is usually adequate. Guttering is inadequate.
Temperature is a kind of value. 100C specifies a temperature.
A brightness has a temperature. The temperature of a brightness is usually 700C. The temperature of blazing is 1400C. The temperature of radiant is 1100C.
A dead end is a kind of room with printed name "Dead End" and description "This is a dead end, where crags in the uneven rock are caught by the [brightness of the lantern] flame you hold aloft. Despite [river sound] there is no sign of the stream." A dead end is usually dark.
A dead end has some text called river sound. The river sound of a dead end is usually "a faint whispering of running water".
Section 2 - Scenario
The Undertomb is a dark room. "From this dim cross-groined room, exits depart east, south, and northwest."
East is a dead end. South is a dead end with printed name "Collapsed Dead End".
Northwest is a dead end called the Tortuous Alcove. The Tortuous Alcove has river sound "a gurgle of running water".
The player carries a book. The description of the book is "[if the brightness of the lantern is adequate]Many secrets are now yours.[otherwise]No, the print's too tiny by this awful light."
In the Undertomb is a lantern. It is lit. The lantern has a brightness. The lantern is blazing. The description of the lantern is "The lantern shines with a flame at [temperature of the brightness of the lantern]."
After waiting in the Tortuous Alcove when the brightness of the lantern is not guttering:
now the lantern is the brightness before the brightness of the lantern;
say "You wait so long that your lantern dims a bit."
Test me with "east / west / get lantern / east / west / south / north / northwest / read book / x lantern / z / x lantern / read book / look / z / x lantern / read book / look / z / x lantern / read book / look".
|