Wartbed:Data structures

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(wartbed namespace)
(wartbed namespace)
Line 1: Line 1:
==WARTBED Data Structures==
==WARTBED Data Structures==
Atm I (Mikademus) am using this article to jot down structures and ideas about the internal functioning of (OMG-)WARTBED. Please feel free to partake and discuss.  
Atm I (Mikademus) am using this article to jot down structures and ideas about the internal functioning of (OMG-)WARTBED. Please feel free to partake and discuss.  
 +
 +
==Unit characteristics==
 +
 +
===The Warhammer attributes===
 +
In Warhammer, units are defined by a set of attributes ranging from 1 to 10 (where humans average at 3).
 +
 +
{|style="margin-left:2em; border:1px solid black;" cellspacing="1" cellpadding="2"
 +
|+'''Warhammer unit attributes'''
 +
|-style="background:rgb(225,225,225)"
 +
|'''M'''|| Movement (in inches per turn)
 +
|-style="background:rgb(225,225,225);"
 +
|''' Ws'''||Weapon Skill
 +
|-style="background:rgb(225,225,225);"
 +
|''' Bs'''||Ballistic Skill
 +
|-style="background:rgb(225,225,225);"
 +
|''' S'''||Strength (punching power)
 +
|-style="background:rgb(225,225,225);"
 +
|''' T'''||Toughness (resistance to strength of attack == save against wounds)
 +
|-style="background:rgb(225,225,225);"
 +
|'''W'''||Wounds (hit points, usually only 1)
 +
|-style="background:rgb(225,225,225);"
 +
|'''I'''||Initiative
 +
|-style="background:rgb(225,225,225);"
 +
|'''A'''||Attacks (# of attackes per turn)
 +
|-style="background:rgb(225,225,225);"
 +
|'''Ld'''||Leadership (save against routing, fear etc)
 +
|}
 +
<div style="margin-left:2em; padding-top:1em; width:37em;"><small>''Warhammer 40K adheres to this set too, but units there lack the '''M'''ovement attribute and has a '''Sv''' (armour saving throw) as part of the set (in fantasy battle armour saving throw is contingent on which armour you equip the unity with).''</small></div>
 +
 +
While the Warhammer attribute set is tested and refined, there are two issues at hand. (1) WARTBED will be able to accommodate more games than "just" Dark Omen and those games might not easily lend to the Warhammer set; and (2) it might not be wise to use the Warhammer set straight off for reasons of IP rights (meh).
 +
 +
===Issues and shortcomings with the Warhammer attributes===
 +
* '''Stupidity''' in Warhammer is a racial attribute (a boolean switch). This could be better represented as an analogue value.
 +
* '''Training''': Some manoeuvres might be too difficult for certain units. Experience and leadership reflects these. Perhaps units could try difficult manoeuvres but need to pass both a leadership and stupidity test or be confused?
 +
* '''Fear''': Warhammer system good: units can cause fear and terror; terror > fear; terrific creatures are unaffected by terror or fear and fearsome creatures feat terrific ones. We can generalise this to a ''fear'' attribute, which is usually zero, but in Warhammer, undead and trolls would have 1 ("cause fear") and dragons 2 ("cause terror").
 +
 +
===Suggested set===
==<tt>wartbed</tt> namespace==
==<tt>wartbed</tt> namespace==

Revision as of 18:28, 25 July 2008

Contents

WARTBED Data Structures

Atm I (Mikademus) am using this article to jot down structures and ideas about the internal functioning of (OMG-)WARTBED. Please feel free to partake and discuss.

Unit characteristics

The Warhammer attributes

In Warhammer, units are defined by a set of attributes ranging from 1 to 10 (where humans average at 3).

Warhammer unit attributes
M Movement (in inches per turn)
WsWeapon Skill
BsBallistic Skill
SStrength (punching power)
TToughness (resistance to strength of attack == save against wounds)
WWounds (hit points, usually only 1)
IInitiative
AAttacks (# of attackes per turn)
LdLeadership (save against routing, fear etc)
Warhammer 40K adheres to this set too, but units there lack the Movement attribute and has a Sv (armour saving throw) as part of the set (in fantasy battle armour saving throw is contingent on which armour you equip the unity with).

While the Warhammer attribute set is tested and refined, there are two issues at hand. (1) WARTBED will be able to accommodate more games than "just" Dark Omen and those games might not easily lend to the Warhammer set; and (2) it might not be wise to use the Warhammer set straight off for reasons of IP rights (meh).

Issues and shortcomings with the Warhammer attributes

  • Stupidity in Warhammer is a racial attribute (a boolean switch). This could be better represented as an analogue value.
  • Training: Some manoeuvres might be too difficult for certain units. Experience and leadership reflects these. Perhaps units could try difficult manoeuvres but need to pass both a leadership and stupidity test or be confused?
  • Fear: Warhammer system good: units can cause fear and terror; terror > fear; terrific creatures are unaffected by terror or fear and fearsome creatures feat terrific ones. We can generalise this to a fear attribute, which is usually zero, but in Warhammer, undead and trolls would have 1 ("cause fear") and dragons 2 ("cause terror").

Suggested set

wartbed namespace

enum FLOCKING_BEHAVIOUR
{
    FLOCK_none     = 0,
    FLOCK_mill     = 1,
    FLOCK_formate  = 2,
};

This enum will determine which algorithm that controls the immediate movement behaviour of an unit.

enum UNIT_STATE
{
    STATE_normal    = 0,
    STATE_routing   = 1,
    STATE_fleeing   = 2,
    STATE_inactive  = 3,
    STATE_destroyed = 4, 
    STATE_gone      = 4,
};

Both "destroyed" and "gone" (left battle field) are the same for in-battle purposes.

enum TARGET_MODE
{
    TARGET_position,
    TARGET_unit,
};

Control enum for all targeting, which is relevant for orders.

struct Position;
struct Unit;

class Target
{
    TARGET_MODE target_type;
    union
    {
        mutable Position *pPos;
        Unit const *pUnit;
    }

public:

    Target( Position const &rPos ) : target_type(TARGET_position)
    {
        pPos = new Position( rPos );
    }

    Target( Unit const &rUnit ) : target_type(TARGET_unit)
    {
        pUnit = &rUnit;
    }

    ~Target()
    {
        if (TARGET_position == target_type)
            delete pPos;
    }

    Vector3 operator* () const 
    {
        return (TARGET_position == target_type) ? **pPos : pUnit->getPosition();
    }
};

Might seem as a complex class for its purpose, but it will be very convenient for a uniform interface when issuing orders.

class Unit
{
    FLOCKING_BEHAVIOUR flocking_mode;
    UNIT_STATE state;

    Target target;
};

Very preliminary stub.

orders namespace

Sub-namespace to wartbed. Contains control structures and values for all orders that can be issued to units.

enum MOVE_ORDER
{
    MOVE_no_order      = 0,
    MOVE_to            = 1,
    MOVE_approach      = 2,
    MOVE_avoid         = 3,
    MOVE_keep_distance = 4,
    MOVE_face          = 5,
    MOVE_continuous    = 0xF0000000,
};
enum HOLD_ORDER
{
    HOLD_no      = 0,
    HOLD_grounds = 1,
    HOLD_pursue  = 2,
};
enum ATTACK_ORDER
{
    ATTACK_no_order     = 0,
    ATTACK_await_charge = 1, 
    ATTACK_at_will      = 2,
    ATTACK_charge       = 3,
    ATTACK_fire_missile = 4,
    ATTACK_continuous   = 0xF0000000,
};
enum FIRE_ORDER
{
    FIRE_no_order = 0,
    FIRE_hold     = 1,
    FIRE_at_will  = 2,
    FIRE_normal   = 3,
    FIRE_force    = 4,
};
Personal tools
communication