Wartbed:Architecture/Modules

From Dark Omen Wiki

(Difference between revisions)
Jump to: navigation, search
(Unit Inheritance Hierarchies: Example unit declaration file)
Line 11: Line 11:
===Unit Inheritance Hierarchies===
===Unit Inheritance Hierarchies===
:''Also see [[Wartbed:Unit data|Unit Data]]''
:''Also see [[Wartbed:Unit data|Unit Data]]''
-
Placeholder
+
The WARTBED Unit representation module purports to allow WARTBED units:
 +
# to be translated and represented faithfully to their original games
 +
# to allow them to possess and retain uniqueness
 +
# to standardise their representation
 +
# to allow them to be used interchangeably
 +
# and to anchor their representation in such a way as to be fair and balanced
 +
This is obviously anything but a trivial mission, and thus places great demand on how units are described (symbolically represented). To this end, WARTBED uses an Object-Oriented mark-up notation where hierarchies of data structures are assembled into "finished" units through node-tree-like inheritance. This hierarchy starts in <tt>base type</tt>s that lay out the basic values of a unit of that type, which may then be adjusted by a succession of <tt>modifier</tt>s. For readability and atmosphere, the names "base type" and "modifier" can overloaded with monikers, typical examples of such might be "race" and "class".
 +
 
 +
For instance, this example shows how a number of aliases could be named, a type and a set of modifiers declared, and veteran warrior and marksman units are defined:
 +
 
 +
<div style="margin-left: 2em; border: 1px black solid;"><div style="color: white; background: rgb(128,128,128); padding: 0.25em;">Example File</div><div style="padding: 1em; background: rgb(180,200,180); white-space: pre; font-family: lucida console,monospace;"><div style="background: rgb(170,190,170);"><nowiki>// type and modifier alternative aliases
 +
 
 +
aliases // "alias" and "aliases" are synonymous
 +
{
 +
  base type = race
 +
  modifier = class
 +
  modifier = experience
 +
  modifier = background
 +
}</nowiki></div>
 +
 
 +
<div style="background: rgb(190,210,190);"><nowiki>// Basic types
 +
 
 +
race = Human
 +
{
 +
  Strength = 30
 +
  cost = 100
 +
}</nowiki></div>
 +
 
 +
<div style="background: rgb(170,190,170);"><nowiki>// Modifiers
 +
 
 +
background = Barbarian
 +
{
 +
    strength += 10
 +
    toughness += 10
 +
    leadership -= 10
 +
    cost *= 1.1
 +
}
 +
 
 +
background = Rabble
 +
{
 +
  strength -= 15
 +
  leadership -= 15
 +
  cost *= 0.60
 +
}
 +
 
 +
class = Warrior
 +
{
 +
    strength += 5
 +
    toughness += 5
 +
    weapon skill += 10
 +
}
 +
 
 +
class = Archer
 +
{
 +
    archery = +10
 +
}
 +
 
 +
experience = Veteran Warrior
 +
{
 +
    prefix name = Veteran
 +
 
 +
    strength = +5
 +
    weapon skill = +5
 +
}
 +
 
 +
experience = Veteran Archer
 +
{
 +
    replace name = Marksman
 +
 
 +
    archery = +5
 +
    toughness = +5
 +
}</nowiki></div>
 +
 
 +
<div style="background: rgb(190,210,190);"><nowiki>// Units
 +
 
 +
unit
 +
{
 +
    category = Footman //The display name is derived from the type and modifiers
 +
 
 +
    type = Human
 +
    type += Barbarian
 +
    type += Warrior
 +
    type += Veteran Warrior
 +
}
 +
 
 +
unit
 +
{
 +
    category = Archer
 +
 
 +
    type = Human
 +
    type += Archer
 +
    type += Veteran Archer
 +
}</nowiki></div></div>
 +
 
[[Category:WARTBED]]
[[Category:WARTBED]]

Revision as of 16:43, 14 November 2009

The technical architecture details about the WARTBED modules.

Contents

Modules Technical Overview

Interaction model

How modules can interact with each other: f.i. how battles can be fought between units.

Module Rule Sets

Placeholder

Unit Inheritance Hierarchies

Also see Unit Data

The WARTBED Unit representation module purports to allow WARTBED units:

  1. to be translated and represented faithfully to their original games
  2. to allow them to possess and retain uniqueness
  3. to standardise their representation
  4. to allow them to be used interchangeably
  5. and to anchor their representation in such a way as to be fair and balanced

This is obviously anything but a trivial mission, and thus places great demand on how units are described (symbolically represented). To this end, WARTBED uses an Object-Oriented mark-up notation where hierarchies of data structures are assembled into "finished" units through node-tree-like inheritance. This hierarchy starts in base types that lay out the basic values of a unit of that type, which may then be adjusted by a succession of modifiers. For readability and atmosphere, the names "base type" and "modifier" can overloaded with monikers, typical examples of such might be "race" and "class".

For instance, this example shows how a number of aliases could be named, a type and a set of modifiers declared, and veteran warrior and marksman units are defined:

Example File
// type and modifier alternative aliases aliases // "alias" and "aliases" are synonymous { base type = race modifier = class modifier = experience modifier = background }
// Basic types race = Human { Strength = 30 cost = 100 }
// Modifiers background = Barbarian { strength += 10 toughness += 10 leadership -= 10 cost *= 1.1 } background = Rabble { strength -= 15 leadership -= 15 cost *= 0.60 } class = Warrior { strength += 5 toughness += 5 weapon skill += 10 } class = Archer { archery = +10 } experience = Veteran Warrior { prefix name = Veteran strength = +5 weapon skill = +5 } experience = Veteran Archer { replace name = Marksman archery = +5 toughness = +5 }
// Units unit { category = Footman //The display name is derived from the type and modifiers type = Human type += Barbarian type += Warrior type += Veteran Warrior } unit { category = Archer type = Human type += Archer type += Veteran Archer }
Personal tools
communication