nightday

concepts
CONCEPT
    time server


LAST UPDATE
    Tune, 10-May-98, 14:00 MET

SYNOPSIS
    #include <config.h>
    #include <nightday.h>
    
    ------------------------------------------------------------
    This document simply describes the time model used in OSB.
    The file /doc/daemons/nightday explains how to use the
    model and the time server. Please read BOTH carefully and
    ALWAYS use the #defines! This helps us keep everything
    consistant, and that's very important.
    ------------------------------------------------------------

DESCRIPTION

    OSB uses a simplified model of the real world to approximate
    yearly seasons, weather, and daily time. The model is loosely
    based on real world time, but has been simplified somewhat.
    
    OSB time moves 3 times "faster" than real world time. This is
    so that players can experience more changes in mud time than
    would be possible if OSB time moved at the same speed as real
    world time. 
    
    One OSB day lasts 8 hours of real time; thus one real world
    day encompasses 3 OSB days. Likewise, one OSB year lasts only
    4 real world months. This was done so that OSB players could
    experience the changing of the seasons within a reasonable
    time period.
    
    The OSB year is divided into 4 seasons:
    
          winter :  "Darkfrost"
          spring :  "Awakening"
          summer :  "Great Heat"
          autumn :  "Harvest Moons"
    
    Every season has three sections, "early", "high" and "late", 
    lasting roughly 10 real world days each. You could think of
    these sections as being like our weeks.
    
    Each day is divided into what we call "time states". Since 
    this is a medieval fantasy mud, it doesn't make much sense to
    introduce precise clocks. The time states try to approximate
    the time changes a real person might notice over the course of
    the day. In your rooms, please do not try to be more precise
    or to use real time hours and minutes. It just doesn't fit 
    the theme.
    
    The time states are as follows. The second entry is about how
    long the state lasts in real world time, and the third entry
    is how much sunlight is available in outdoor rooms:
    
          Night            (2:23 hrs.)     (0% light) 
          Predawn          (:15 mins.)    (10% light)
          Dawn             (:10 mins)     (20% light)
          Sunrise          (:10 mins)     (40% light)
          Early morning    (:44 mins)     (80% light)
          Late morning     (1:06 hrs)    (100% light)
          Noon             (:44 mins)    (100% light)
          Early afternoon  (1:06 hrs)    (100% light)
          Late afternoon   (:44 mins)     (80% light)
          Sunset           (:10 mins)     (40% light)
          Twilight         (:10 mins)     (20% light)
          Evening          (:15 mins)     (10% light) 
 
    Note that the nightday server does not affect the amount of
    light available in indoor rooms.
    
    When a time state changes, every room which has a player in it
    is notified by the nightday server. By default, this message is
    then sent to the player. Any outdoor room can hook into this
    notification and use it for custom time messages, to clone special
    objects only available at certain times of day, or to block
    them totally, for example.
    
    If a player leaves a building, they are also notified about the
    current day state.
    
    It is also possible to make any object in the mud a client of
    the nightday server. Usually, only outdoor rooms which contain
    a player at the moment the time state changes is notified (it 
    would be _far_ too expensive to notify every object by default).
    However, any object can be programmed to be a client of the
    nightday server, and be notified each time the time state changes.
    
    Lastly, it is also possible to inherit the nightday server to
    facilitate custom time messages. Note that if the goal is just to
    have custom time messages, this can be achieved quite easily with
    one function in a standard room (a room which is inherited by all 
    the rooms in an area). Don't try to create your own system of 
    time - use the standard OSB time states and lengths. It's utterly
    illogical to travel to another area in the same world and
    suddenly have days which are twice as long. The only exception
    would be some separate dimension or plane, where it would make
    sense to have a different flow of time. Be warned, though, that
    creating a time server is not for the inexperienced wizard.
    

SEE ALSO
    light(C), room(S), weather(S)