Wartbed:Data structures

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(wartbed namespace)
(The attribute set)
 
(26 intermediate revisions not shown)
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. Both the discussion page and this article can be used, use your judgement.
==Unit characteristics==
==Unit characteristics==
===The Warhammer attributes===
===The Warhammer attributes===
 +
In Warhammer, units are defined by a set of attributes ranging from 1 to 10 (where humans average at 3).
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"
+
{{transclude|The Warhammer Attributes}}
-
|+'''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).  
+
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).
 +
 
 +
===Dark Omen Boolean Regimental Abilities===
 +
'''Please help me fill in this list!!!'''
 +
"Boolean" means things that can be either ON or OFF. In Warhammer these are things such as the ability to be unhindered by difficult terrain or causing fear. All available in Dark Omen are can be found in WH2EDIT.
 +
 
 +
{{transclude|DO/ARM/Regiment attributes}}
===Issues and shortcomings with the Warhammer attributes===
===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.
* '''Stupidity''' in Warhammer is a racial attribute (a boolean switch). This could be better represented as an analogue value.
 +
* '''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").
 +
* '''Solidity'''. Units can be of different size. IIRC in Warhammer v3 or 4 push-backs were determined by comparing #wounds dealt in a round. In Dark Omen there are no push-backs. However, in 3D units could (should?) have weight.
* '''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?
* '''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").
+
* Which leads us to '''Leadership''': the Warhammer notion is a gross simplification for the sake of making a table top game manageable. It subsumes things such as training, experience, discipline, psychological stability, cultural disposition and "anti-stupidity" (it all boils down (1) manoeuvres, (2) save against rout and (3) roll to rally). It reminds a bit of Black Adder's Lord Wellington who believes that leadership is all about shouting. Really, things like psychological stability, stoicism, fatalism, bravery, training, discipline and much more all would weigh in.
 +
* Other RTT games, such as Close Combat and Total War, includes '''other attributes''' not part of orthodox Warhammer, These include '''fatigue''', '''morale''' and '''ammunition'''. Provisos for using these should be made, but these are types of attributes that shouldn't be necessary to be used. Having them optional would also allow difficulty and realism settings.
===Suggested set===
===Suggested set===
 +
# Multiply the Warhammer values by 10, giving us a range of 0--100, with humans averaging at 30. This gives us more room to adjust values.
 +
# Renaming certain (all?) attributes. If we assume that size equals strength, and size can be used as solidity, then '''S''' can be called "power" or "might" or something, and used for both weapon power and unit solidity.
 +
# Add '''Fearsomeness''' as an attribute.
 +
# Change '''Ld''' from being an kitchen-sink attribute to a bonus to the attributes below.
 +
## Add '''Tactics''' attribute that represents unit level of training (manoeuvres and formations; resist pursuing)
 +
## Add '''Steadfastness''' attribute that represents unit discipline and psychological stability (resistance against feat and routing; rallying) - basically anti-cowardice.
 +
## Add '''Ferociousness''' attribute that represents an unit's disposition to charge and pursue - basically anti-discipline.
 +
## Add '''Stupidity''' attribute - much better in game context than an "intelligence" attribute.
 +
# Add optional attributes
 +
## '''Stamina''', '''recovery rate''' and '''fatigue'''
 +
## '''Morale'''
 +
## '''Ammunition''' - this rather belongs with the weapons definition and as a game play option than an unit attribute!
-
==<tt>wartbed</tt> namespace==
+
====The attribute set====
-
 
+
{{transclude|Wartbed:Unit data/Attributes}}
-
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.
+
-
 
+
-
===<tt>orders</tt> namespace===
+
-
Sub-namespace to <code>wartbed</code>. 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
+
==Future extendibility==
-
{
+
Let's face it, WARTBED will (hopefully) grow to include more games over time, which will mean adding additional features and rules. At the same it should continue to support existing modules without they too needing to be updated. Thus, all game rules should be kept in some kind of set where they can be toggled. All additional rules after the first stable release should also default to OFF so older modules will not be affected by them.
-
    HOLD_no      = 0,
+
-
    HOLD_grounds = 1,
+
-
    HOLD_pursue  = 2,
+
-
};
+
-
enum ATTACK_ORDER
+
Perhaps it is possible to device some clever add-on or scripting systems for rules, so that modules will register themselves and their rules with WARTBED. Worth contemplating. [[User:Mikademus|Mikademus]] 20:24, 2 August 2008 (UTC)
-
{
+
-
    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
+
==Game engine structures==
-
{
+
{{see|WARTBED/Game Engine Structures}}
-
    FIRE_no_order = 0,
+
When making a game it is extremely important to as far as possible separate the "logic" from the "view" or "presentation" (what this means in simple terms is basically that the game should be able to run without graphics). If nothing else, a huge advantage of this is that the game can easily be ported to other rendering contexts (==platforms).
-
    FIRE_hold    = 1,
+
-
    FIRE_at_will  = 2,
+
-
    FIRE_normal  = 3,
+
-
    FIRE_force    = 4,
+
-
};
+
 +
==OGRE Rendering engine structures==
 +
{{see|Rendering Engine Structures}}
 +
Overview and discussion of the rendering engine data structures.
[[category:WARTBED]]
[[category:WARTBED]]

Current revision as of 18:11, 16 March 2009

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. Both the discussion page and this article can be used, use your judgement.

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).

Transcluded from The Warhammer Attributes

Warhammer unit attributes
Physical attributes
Attribute Full name Description
M Movement Allowance This represents the speed at which a regiment can manoeuvre, and is also used as a basis for

calculating their charge distance.

WsWeapon Skill This defines how skilled a warrior is with his weapons, or how vicious a monster is. The higher

the value the more likely the fighter is to hit a hand-to-hand combat opponent.

BsBallistic Skill This defines how skilled a warrior is with ranged weapons such as bows or crossbows, or how

accurate a ranged war machine such as a cannon is.

SStrength This shows how strong a creature is, and therefore how hard it can hit. Strength is used to

determine how easily a creature can hurt an opponent it has struck. The strength of the weapon is also taken into account.

TToughness This is a measure of a creature's or a machine's ability to resist damage when hit. The higher the value, the lower the chance of landed blows actually inflicting wounds.
WWounds This shows how much damage a creature or machine can take before it dies or falls unconscious (or in the case of machines, before it is ruined).
IInitiative This indicates how fast a creature can react. In close combat this is used to determine the order in

which creatures strike.

AAttacks This defines how often a creature attacks during close combat. A creature with more than one attack can potentially strike more than one enemy creature in the same round.
LdLeadership This shows how brave and solid a creature is. A creature with a high leadership is less likely to

flee from close combat (rout), and is more likely to rally if they do rout. Also, all regiments with a leader use his Leadership in any tests.

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).

Dark Omen Boolean Regimental Abilities

Please help me fill in this list!!! "Boolean" means things that can be either ON or OFF. In Warhammer these are things such as the ability to be unhindered by difficult terrain or causing fear. All available in Dark Omen are can be found in WH2EDIT.

Transcluded from DO/ARM/Regiment attributes

Note: The Bits in this table are going from lowest to highest bit. So the lowest bit is 1 and the highest 8.

Bit BYTE 1 BYTE 2 BYTE 3 BYTE 4
1
Will never rout
Flagellants, steam tank and most undead have this
Immune to fear, can be routed
Most undead have this
Inflicting casualty causes fear
Screaming skull, undead chariot and Nagash has this
Goblin Flag (Trading Post Map only)
Only Night Goblins in B1_01 have this
2
Unused
Regenerates wounds
Only trolls have this
Cowardly
Only ghouls have this
Impervious to Magic
Only necromancer in B1_03 has this
3
Cause fear
Most undead have this
Never rally/regroup
Villagers and B1_04 Mage has this. When a regiment has been broken it will get the white flag immediately
Destroyed if routed
Wights, wraiths, zombies, Carstein and dummies have this
No retreat, no surrender!
No regiment uses this. Unit will never rout, retreat button without any use. Banner of Defiance and cheat code DONTMESSWITHME and Ctrl+C+I have the exact same effect
4
Cause terror
Black Grail, Dread King, Hand of Nagash and Wraiths have this
Always Pursue
No regiment has this; Regiment will follow retreating enemy until it is defeated
Flammable
Treeman and mummies have this
No Item slots
Treeman, scorpion, spider, and wraiths have this
5
Elf racial flag
Only elves have this
"Engine of War" Rule
Steam tank and goblin fanatics have this
360 Degree Vision
Only giant spider has this
Can't be selected
Only goblin fanatics have this
6
Goblin racial flag
Goblins and goblin fanatics have this
Indestructible
Only necromancer in B1_03 has this
Unit contains fanatics
Only goblin with fanatics has this
Fear Elves
Which unit has this- Goblins?
7
Hate Greenskins
Elves and treeman has this
Unused
Aetherial "racial" flag
Only wraiths have this
Unused
8
Unimpeded by difficult terrain
Elves, treeman, spider, black grail, skel horsemen and wraith
Suffer additional wounds
Only skeletons and training dummy have this.
Giant
Only Treeman has this
Unused
Certain and tested
Highly likely but not tested
Function basically undeterminable... :(
Guess and/or untested
I changed "psychology" to "attribute". I originally used the term psychology when I started mapping out the .arm files, and I thought that only the Warhammer psychology stuff (like hatred, saga animosity, fearless, etc) were stored there. But as also physical stuff like terrain striding etc are represented here "attributes" is a more descriptive term. Mikademus 23:24, 18 September 2008 (UTC)

I have started colour-coding the above table. Since it has been a while I am not certain which attributes I definitely determined and which I merely surmised. Ghabry is the the current authority on unit attributes, and I hope he will be able to complete the chart. Mikademus 12:43, 19 September 2008 (UTC)

Certain or likely flags

Flag #9 (byte 2 bit 1): In DO only skeletons have this set. It seems to be the undead army list rule that skeletons (which are immune to fear and don't take rout tests) take additional wounds from being pushed back

Flag #24 (byte 3 bit 8): This is an adaptation of Warhammer's special Screaming Skull Catapult rule. The Screaming Skulls fired by the catapult cause fear, so if even one casualty is dealt the receiving unit must take a rout test. Since Hand of Nagash also has this is is surmised that is is also used to give extra oomph to his attacks, and in extension, to the attack of any unit with this flag.

Uncertain flags

Flag #3 (byte 1 bit 3): Only goblins have this set. It could simply to indicate race, or it could be to indicate goblins' racial traits. The WHTTv4 rules about goblins are:

Races/Warhammer/Goblins/WHTT4

logo4thedminimalrn6.png

Relevant WHFB TT goblinoid rules v4. Goblins

  • have animosity toward other goblinoids
  • hate dwarves (and gnomes)
  • fear elves (of numbers > half the goblins)
  • and some special stuff about being led by snotlings and substituting spells.

Flag #4 (byte 1 bit 4): Only elves have this set. It could simply to indicate race, or it could be to indicate elves' racial traits. The WHTTv4 rules about elves are:

Races/Warhammer/Elves/WHTT4

logo4thedminimalrn6.png

Relevant WHFB TT v4 elves rules. Elves

  • are feared by Goblins if less than twice the numbers
  • have double encumbrance from armour

Wood elves

  • Suffer no movement or manoeuvre penalties in wooden areas
  • have 6" longer range with bows
  • and some special stuff about being substituting spells.

Are elves equipped with the same longbow (missile weapon type) as f.i. Helmgard Longbowmen? If so then we know that at least the additional distance rule applies.

Flag #18 (byte 3 bit 2): Only wraiths have this set. It could simply to indicate race, or it could be to indicate wraiths' special traits. The WHTTv4 rules about wraiths are:

Races/Warhammer/Wraiths/WHTT4

logo4thedminimalrn6.png

Relevant WHFB TT v4 wraith rules. Wraiths

  • are immune to all psychology (seems not to be true in DO)
  • cause fear 12" +2 in all living creatures regardless of size
  • can only be damaged by magic, magic weapons, daemons, or undead chill attacks
  • have chill attacks that automatically cause 1 wound, no save and no armour
  • are bound to a particular place and dematerialise if they leave this zone or the thing they're attached to is destroyed
  • can pass through any material obstacle unhindered

Flag #12 (byte 2 bit 4): This units can't fight in Closed Combat and can drive over other regiments while charging.


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.
  • 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").
  • Solidity. Units can be of different size. IIRC in Warhammer v3 or 4 push-backs were determined by comparing #wounds dealt in a round. In Dark Omen there are no push-backs. However, in 3D units could (should?) have weight.
  • 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?
  • Which leads us to Leadership: the Warhammer notion is a gross simplification for the sake of making a table top game manageable. It subsumes things such as training, experience, discipline, psychological stability, cultural disposition and "anti-stupidity" (it all boils down (1) manoeuvres, (2) save against rout and (3) roll to rally). It reminds a bit of Black Adder's Lord Wellington who believes that leadership is all about shouting. Really, things like psychological stability, stoicism, fatalism, bravery, training, discipline and much more all would weigh in.
  • Other RTT games, such as Close Combat and Total War, includes other attributes not part of orthodox Warhammer, These include fatigue, morale and ammunition. Provisos for using these should be made, but these are types of attributes that shouldn't be necessary to be used. Having them optional would also allow difficulty and realism settings.

Suggested set

  1. Multiply the Warhammer values by 10, giving us a range of 0--100, with humans averaging at 30. This gives us more room to adjust values.
  2. Renaming certain (all?) attributes. If we assume that size equals strength, and size can be used as solidity, then S can be called "power" or "might" or something, and used for both weapon power and unit solidity.
  3. Add Fearsomeness as an attribute.
  4. Change Ld from being an kitchen-sink attribute to a bonus to the attributes below.
    1. Add Tactics attribute that represents unit level of training (manoeuvres and formations; resist pursuing)
    2. Add Steadfastness attribute that represents unit discipline and psychological stability (resistance against feat and routing; rallying) - basically anti-cowardice.
    3. Add Ferociousness attribute that represents an unit's disposition to charge and pursue - basically anti-discipline.
    4. Add Stupidity attribute - much better in game context than an "intelligence" attribute.
  5. Add optional attributes
    1. Stamina, recovery rate and fatigue
    2. Morale
    3. Ammunition - this rather belongs with the weapons definition and as a game play option than an unit attribute!

The attribute set

Transcluded from Wartbed:Unit data/Attributes

Suggested WARTBED unit attributes
Attribute Full name Value range Human std Description
Physical attributes
Mov Movement 0+ 1.5 In game units per game time unit (meters/second?)
WSk Weapon Skill 0--100 30 Melee prowess
RSk Ranged Skill 0--100 30 Missile accuracy
Pow Power 0--100 30 Strength and weight
Tgh Toughness 0--100 30
HP Hit Points (wounds) 1+ 1
Ini Initiative 0--100 30
Att Attacks 0+ 1
Sta Stamina 0--100 30 Endurance
Rec Recovery rate 0--100 30 Reduction of fatigue/time unit
Fat Fatigue 0--100 0 Tiredness (not an attribute but a counter)
Psychological attributes
LdrLeadership 0--100 50 Bonus to tests
TacTactics 0--100 50 What manoeuvres can be performed
StdSteadfastness 0--100 50 Resistance to fear, panic, rout etc
FerFerociousness 0--100 50 Berserking etc
StuStupidity 0--100 50 Risk of confusion etc
MorMorale 0--100 50
All attributes range from 0 to 100, where a value of 30 for physical and 50 for psychological attributes is considered human standard, the exceptions are hit points and attacks, where one (1) is considered human standard, fatigue, which usually starts at zero (0), and movement where human standard marching speed is 1.5 m/sec (3 m/sec at double quick and 6 m/sec at charge).


Future extendibility

Let's face it, WARTBED will (hopefully) grow to include more games over time, which will mean adding additional features and rules. At the same it should continue to support existing modules without they too needing to be updated. Thus, all game rules should be kept in some kind of set where they can be toggled. All additional rules after the first stable release should also default to OFF so older modules will not be affected by them.

Perhaps it is possible to device some clever add-on or scripting systems for rules, so that modules will register themselves and their rules with WARTBED. Worth contemplating. Mikademus 20:24, 2 August 2008 (UTC)

Game engine structures

Further information: WARTBED/Game Engine Structures

When making a game it is extremely important to as far as possible separate the "logic" from the "view" or "presentation" (what this means in simple terms is basically that the game should be able to run without graphics). If nothing else, a huge advantage of this is that the game can easily be ported to other rendering contexts (==platforms).

OGRE Rendering engine structures

Further information: Rendering Engine Structures

Overview and discussion of the rendering engine data structures.

Personal tools
communication