   --------------
  /--------------\
 // Lords of War \\
// By Carl Olsson \\
\\      2001      //
 \----------------/
  ----------------

_      __      __      __      __      __      __      __      _
 \    /  \    /  \    /  \    /  \    /  \    /  \    /  \    /
  \__/    \__/    \__/    \__/    \__/    \__/    \__/    \__/
      ____            ____            ____            ____
     /    \          /    \          /    \          /    \
    /      \        /      \        /      \        /      \
   /        \      /        \      /        \      /        \
__/          \____/          \____/          \____/          \__
   __      __      __      __      __      __      __      __
  /  \    /  \    /  \    /  \    /  \    /  \    /  \    /  \
_/    \__/    \__/    \__/    \__/    \__/    \__/    \__/    \_
__            ____            ____            ____            __
  \          /    \          /    \          /    \          /
   \        /      \        /      \        /      \        /
    \      /        \      /        \      /        \      /
     \____/          \____/          \____/          \____/

----------------------------------------------------------------------------
What Is It?
-----------
This is going to be a simple turn-based war game in the style of SSG's
Warlords series.



----------------------------------------------------------------------------
Aims
----
 * Everything to be hard coded.
 * Simple to play (like Warlords).
 * Simple yet attractive graphics.
 * Few units and terrains.
 * Plain C.



----------------------------------------------------------------------------
Contact
-------
Email: carljolsson@yahoo.com
Web: http://www.geocities.com/carljolsson



----------------------------------------------------------------------------
Terminology
-----------
Unit: Smallest division of combat forces, a single entity.
Army: A group of units.
Terrain: The geographical state of one point in space.



----------------------------------------------------------------------------
Todo
----
 * Pathfinding, probably A*. DONE.
 * Listify armys and units. DONE.
 * Optimise pathfinding.
 * Implement sides.
 * Encapsulate main game functions.
 * Map generation.
 * Simple yet capable GUI.
 * AI.
 * Make paths dynamic arrays, rather than lists, will use half the mem and
   be faster to step through, though slower to build.
 * Recolouring code for units, structures.
 * Hmap post-proccessing, smooth, etc.
 * Everything else.



----------------------------------------------------------------------------
Game Ideas
----------
 * Have allied unit types producable from cities with a lair structure for
   that unit type.
 * If a structure's square is occupied by an enemy army, a city will lose
   the benefits of that structure for the duration.
 * LOS. Line of sight will allow armies to hide in valleys, or hide in dense
   forrest.



----------------------------------------------------------------------------
Warlords Terrain Types
----------------------
Plains
Hills
Mountains
Marsh
Forest
Road
Shore
Water



----------------------------------------------------------------------------
Terrain
-------
 * Two terrain layers, one for base: plains, hills, mountains, another for
   on top: road, forest.



----------------------------------------------------------------------------
Terrain Types
-------------
Road - A rough dirt road.
Highway - A quality paved road.
Thick Forest
Sparse Forest



----------------------------------------------------------------------------
Terrain Draw Types
------------------

Base Types
----------
Flat: Draws simple terrain tile, no blending.
Blended: Alpha blends between surrounding terrain for smooth square-based
   transitions. Plains, desert, etc.
Path: Connected lines of terrain type. Roads, walls, etc.
Cofringed: Has specialised tiles for transition in to each other terrain
   type.
Fringed: Draws specialised tiles to blend with surrounding terrain. Forest,
   rocks, etc.

Sub Types
---------
Base: Draws terrain solidly.
Overlay: Draws over the top of other terrain on the square, with
   translucent/transparent areas.

Drawing Heirarchy
-----------------
Flat
Blended
Path
Cofringed
fringed

Draw grid
---------
Terrains can be like a grid of terrains so adjacent squares of a type are
not identical, but the next square along in the grid.



----------------------------------------------------------------------------
Structures
----------

Independent
-----------
City: Produces units and collects taxes, can be strongly fortified.
Citadel: A defensive stronghold, strongly fortified.
Temple: Get units blessed.
Ruin: Find atrifacts, gold or allies.
Bridge: Allows passage over waterways.

City Dependent
--------------
Lair: Allows production of an ally type.
Mine: Produces extra gold.
Harbour: Allows production of sea-going units.

Notes
-----
 * Structures can be rebuild after raising.



----------------------------------------------------------------------------
Terrain Generation Ideas
------------------------
 * Use subdivision for height map. Looks crap try something else.
 * From height map use ranges for sea, plains, hills, mountains.
 * Forests are seeded, and probabilisticly placed in relation to distance
   from other forest squares. Or use field thresholds. Try particle
   deposition.
 * Rivers are seeded at high altitudes and run down slopes seeking the
   lowest points. If a river reaches sea it terminates. If rivers intersect,
   the straightest at point of intersection or the one with shortest path to
   sea terminates the others.
 * Roads as the best paths between sites.
 * Grow forests with breadth-first search like algoritm.
 * Erosion. The steeper the more is eroded and it is depositied below.

River Making
------------
 * Seed rivers from peaks.
 * As rivers run downhill they gain force relative to the drop, this force
   determines how wide the river is, when it reaches a point where it can no
   longer go downhill, it uses it's force to fill up the depression (making
   a lake), if it fills up the depression and a new downhill path becomes
   available and it has power remaining it continues, if more than one path
   is found at that altitude then the river splits, but it cannot continue
   rising onece a new downhill path has been found.
 * Kind of a bredth-first search for the highest total power.
 * Would probably be quite slow.



----------------------------------------------------------------------------
Unit Attributes
---------------
Sight - How many squares radius can be seen by unit.
Attack
Defense
Move



----------------------------------------------------------------------------
Warlords Unit Types
-------------------
Heroes
Light infantry
Heavy infantry
Cavalry
Ship
Elven Archers
Wolf Riders
Pegusus
Giants
Dwarven Legion
Gryphon
Undead
Devils
Demons
Dragons
Wizards



----------------------------------------------------------------------------
Unit Types
----------
Foot scouts
Light infantry
Heavy infantry
Scout Cavalry
Light cavalry
Heavy cavalry
Bowmen
Crossbow men
Horse archers
Heros/Champions



----------------------------------------------------------------------------
Ideas
-----
 * Instead of having set move cost and passability for units, have terrain
   attribs such as steepness, roughness and density. These could be used
   such as, steep terrains, such as mountains, are bad for wheeled units,
   rough terrain, such as rocky plains, is bad for cavalry units, high
   density terrain, such as heavy forest, is good for open rank infantry,
   but not for closed rank infantry. This would make it much easier to
   expand, because unit definitions would not need to contain individual
   movement controls for all possible custom terrains. Units can only travel
   on terrains where the terrain attributes are within the acceptable range.



----------------------------------------------------------------------------
Cursors
-------
Attack, breaking peace treaty/alliance: Bloody dagger
Attack, standard: Sword



----------------------------------------------------------------------------
Design
------

Types
-----
Relevant types have associated read/write functions, for map files and save
game files. These work in a cascading fashion.

Structures
----------
All structures in a single array, squares have index of structure.

Functions
---------
TYPE_clean: clean up all dynamic memory allocations for type members.
TYPE_create: allocate memory for type.
TYPE_destroy: free memory for type.
TYPE_init: initialise type for use.
TYPE_write: writes type data to the file.
TYPE_read: reads type data from the file.



----------------------------------------------------------------------------
File Types
----------
LM - LOW Map
LS - LOW Scenario
LTS - LOW Tile set
LG - LOW Game
LC - LOW Campaign



----------------------------------------------------------------------------
Pathfinding Ideas
-----------------
 * Use multiple resolution map.
 * Have a map where squares represent a block of squares in the map, whose
   passability is based on the cost of the path to travel from the square to
   each adjacent square.
 WONT WORK WILL IT



----------------------------------------------------------------------------
Terrain Attributes
------------------
Temperature
Roughness
Boggyness
Altitude
Tightness/Density
Wetness (from totally arid to normal to deep water)



----------------------------------------------------------------------------
GUI
---
Buttons
 * Can call function on press or call function at a rate while pressed.

