Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Version 9 and Version 10 of code/doc/SpaceBoundaries


Ignore:
Timestamp:
May 12, 2011, 2:23:37 PM (13 years ago)
Author:
kmaurus
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/SpaceBoundaries

    v9 v10  
    55
    66== Implementation ==
    7 A new class that is derived from static entity will be written that
    8 checks for any other entities that are in danger of getting out of range
    9 of the center of the map. It will be called SpaceBoundaries.
     7SpaceBoundaries is a class that is derived from static entity. It checks if
     8there is a pawn that is outside of a defined area or tries to leave this area
     9and reacts on such events.
    1010
    11 A map creator can then add the boundaries to a level via its XML file and
    12 specify the attributes necessary for it to work.
     11The reaction to such events can be defined by the map creator, who can add
     12boundaries to a level via its XML file. At the moment there are two implemented behaviors:
     13 * Let the Pawns that want to cross the boundaries bounce back.
     14 * Let the Pawns cross the boundaries but decrease their health when they do so.
    1315
    14 The SpaceBoundaries object will do its work in the tick function, using an
    15 Iterator of type MobileEntity. Via the interface of MobileEntity, we can then
     16The SpaceBoundaries object does its work in the tick function, using an
     17Iterator of type Pawn. Via the interface of Pawn, we can then
    1618control the pawns away from the boundary or do damage to them.
    17 
    18 Goals of the implementation:
    19  * Detection of pawns exiting the allowed range
    20  * Reaction to those pawns
    21  * Preliminary distance measurement: 2-norm
    22  * (Later: maybe max-norm or 1-norm)
    23  * Graphical representation of boundaries
    2419
    2520== Attributes ==
    2621These attributes can be set for a SpaceBoundaries static entity in the XML file:
    27  * position - absolute position of the space boundaries in the level (usually 0,0,0)
    28  * maxdistance - maximum distance pawns can move away from this point
    29  * warndistance - distance at which pawns receive some kind of warning that they're about to reach
     22 * position - absolute position of the object of SpaceBoundaries in the level (usually 0,0,0)
     23 * maxDistance - defines the area, where a pawn is allowed to be (radius of a ball with center 'position').
     24 * warnDistance - If the distance between the pawn of a human player and 'position' is bigger than 'warnDistance', a message is displayed to inform the player that he's close to the boundary.
     25 * showDistance - If the distance between the pawn and the boundary of the allowed area is smaller than 'showDistance', a graphical representation of the boundary is displayed.
     26 * reactionMode - Integer-Value. Defines what effect appears if a space ship has crossed receptively wants to cross the boundaries.
     27  * 0: Reflect the space ship (default).
     28  * 1: Decrease Health of the space ship after having left the allowed area.
     29 * healthDecrease - a measure to define how fast the health of a pawn should decrease after leaving the allowed area (unnecessary if 'reactionMode' == 0). Recommended values: 0.1 (slow health decrease) to 5 (very fast health decrease).
    3030
    31 == Actions taken when a pawn reaches the boundary ==
    32 Several measures can be taken when something reaches the boundaries of the level:
    33  * Damage - the entity could take constant damage over time as long as it is outside the borders
    34  * Acceleration changes - some kind of invisible wall or acceleration away from the boundary
    35  * Visual impairment - darkness, fuzziness or something along those lines
     31=== Notes to above attributes ===
     32Until now, warnDistance has no effect because the function to display a message (void SpaceBoundaries::displayWarning(const std::string warnText)) hasn't been implemented yet.
     33