OVERVIEW

Baron uses various types of Things to represent all items of interest.
Things come in several types - Resource Templates (R), Resources (r), Races
(P), Populations (p), Factory Templates (F), Factories (f), Site Templates
(S), Sites (s), and Territories (T).  The significance of each type of Thing
is described briefly in baron.h.

FORMAT

Things are defined sequentially within the data file and each must have a
unique name.  (Note that Resources, Populations, Factories, and Sites may
have no name specified, in which case they default to the name of their
templates.  These default names must _not_ go back into the data file!)  Any
Thing may contain other Things defined within it.  Each thing's definition
takes the form

X {
}

where X is the Thing's type abbreviation as given parenthetically in the
Overview.  Only Territories and templates (those Things with uppercase codes)
should appear at the outermost level and only instances (Things with
lowercase codes) should appear within the definitions of other Things.

Everything is case-sensitive.  No exceptions.  Deal with it.

All members of the appropriate structure for the Thing's type should be
specified by name and given a value.  Any attributes left unspecified will
default to 0/null.

Blank lines are ignored, as are lines starting with #.  Indentation is
ignored, but makes the structure much clearer.

Note that there are currently two pseudo-Things that may be referenced
without being defined:  Skill and Happiness.  Making these into actual
resources would make them global to all Populations within a Territory, but I
want to keep them Population-specific.  (This allows modeling a class of
happy overlords with an unhappy slave class, etc.)

SAMPLE

This sample defines a single territory containing a population of humans with
a mine and a couple of farms, along with all the other required Things.

---
# Food is essential and extra food makes people happier
R {
  name Food
  can_overspend 1
  decay_rate 75
  decay_to 
  r {
    type Happiness
    qty 0.010
  }
}

# Military power, recalculated each turn
R {
  name Might
  decay_rate 100
}

# If people don't have work to do, they lose Skill (or, rather, gain less),
# but are happier
R {
  name Labor
  can_overspend 1
  influence
  r {
    type Skill
    qty 0.025
  }
  decay_rate 100
  decay_to
  r {
    type Skill
    qty -0.020
  }
  r {
    type Skill
    qty 0.010
  }
}

# Conversely, if the population's Bright Thoughts aren't used for production,
# people might learn something from them
R {
  name Knowledge
  decay_rate 100
  decay_to
  r {
    type Skill
    qty 0.005
  }
}

# Wealth is consumed by many transactions, and any excess makes people
# happier, while a shortage makes them unhappy
R {
  name Wealth
  can_overspend 1
  decay_rate 100
  decay_to
  r {
    type Happiness
    qty 0.005
  }
}

# The presence of money makes Wealth available
R {
  name Silver
  influence
  r {
    type Wealth
    qty 0.75
  }
}

# Define characteristics for humans - lots of 1s since they're the baseline
P {
  name Human
  food_consumption 1
  might_production 1
  labor_production 1
  knowledge_production 1
  growth_rate 1
  wanderlust 1
}

# Before defining the Silver Mine, we need a source of ore
S {
  name Silver Vein
}

# Next, some factory templates
F {
  name Farm
  input
  r {
    type Labor
    qty 1
  }
  r {
    type Wealth
    qty 0.1
  }
  output
  r {
    type Food
    qty 2
  }
  capacity 10
  cost
  r {
    type Labor
    qty 2
  }
  r {
    type Wealth
    qty 1
  }
  repair_cost
  r {
    type Labor
    qty 0.5
  }
  depletion 0.010
}

F {
  name Silver Mine
  input
  r {
    type Labor
    qty 5 
  }
  r {
    type Wealth
    qty 1
  }
  output
  r {
    type Silver
    qty 1
  }
  capacity 10
  required
  s {
    type Silver Vein
  }
  cost
  r {
    type Labor
    qty 50
  }
  r {
    type Wealth
    qty 25
  }
  depletion 0.1
  # No repair_cost - when the mine runs dry, you can't do anything about it
}

# Now to finally define the Territory itself
T {
  name Shire of Hamlin
  populace
  p {
    race Human
    size 100
  }
  
  sites
  s {
    type Silver Vein
  }

  factories
  # 5 farms and a silver mine will keep everyone busy...
  f {
    type Farm
    capacity 10
  }
  f {
    type Farm
    capacity 10
  }
  f {
    type Farm
    capacity 10
  }
  f {
    type Farm
    capacity 10
  }
  f {
    type Farm
    capacity 10
  }
  f {
    type Silver Mine
    capacity 10
  }
  
  resources
  # Starting quantities of food and silver - everything else decays completely
  r {
    type Food
    qty 100
  }
  r {
    type Silver
    qty 10
  }
}
