"Board Warfare" version 1.4

Loosely based on warfare strategy boardgames.
Requirements: DOS compatible PC, VGA graphics and 386 CPU recommended.
Files in the distribution:
BW14.EXE
README.TXT
MAPFILE.DAT
UNITFILE.DAT
MAPUNITS.DAT
ATTFILE.DAT
BW.BAT

------------  STANDARD DISCLAIMER  ------------

In no event will the author be liable for any damages, including any lost
profits, lost savings or other incidental or consequential loss or damages
arising out of the use or of the inability to use this program -- even if
the author has been advised of the possibility of such damages.  The author
will in no event be held liable for direct, indirect, or incidental damages
resulting from the omission of any part of this product, including this
document.  The author makes no warranties, either expressed or implied,
respecting the software, its quality, performance, merchantability, or
fitness for any particular purpose.

"Board Warfare" is freeware in the public domain and may be distributed
freely if the following rules are followed:

   1. No fees are to be collected from the distribution or use of this
      software, not even for shipping and handling, without the author's
      permission.
   2. The program and associated files may not be distributed in a
      modified form.

"Board Warfare" executables are being distributed with the freeware concept
in mind.

------------  CONTACT  ------------

Mike Cozart
224 West First Street
Hillsboro, TN 37342
615-596-2309

email: Cozart@hap.arnold.af.mil

If there are any oversights or errors in the documentation or any part of
this game please feel free to let me know.

I welcome constructive criticism and comments.

Mike

------------  ESSENTIAL  INSTRUCTIONS  ------------

For those who are patiently impaired, as I am, and will not read
instructions, these are the only keys in the code which do anything:

   Menu:        enter, left mouse button, h, c, u, o, k, q.
   Map editing: 1, ..., 6, q, w, e, r, t, y, u, x, arrow keys,  left mouse.
   Game play:   x, m, c, arrow keys, and the left mouse button.

I have tried to stick with a standard of the 'x' key to stop any phase of
the game and 'm' to exit to the menu.

Terrain types: clear, desert, water, woods, mountain, road, city.

Defense advantages (factor of 2) for the standard terrain types:  city,
woods, mountain.

Movement costs. road: 1/3, city: 1/3, desert: 1/2, clear: 1, woods: 2,
mountain: 3.  Engineers into water hex: 3.  Air mobile units when in a city
hex at start of a turn into any hex: 1.  Should armor suffer a penalty when
moving in mountains or woods?  This could easily be into place but requires
more human thought when playing.  I will listen to any advice and player
preferences.

Unit types:
Infantry - X in the unit marker
Marines  - X in the unit marker with an M. (infantry with more strength
           initially.  Not my opinion, just my code.)
Field Artillery  - big dot in the unit marker (your most valuable and
                   potentially deadly units)
Armor - Oval in the unit marker.
Engineers - X in the unit marker with an E.
Airborne - X in the unit marker with a little w.  (infantry with special
           movement abilities)
Air Assault - Oval with a little w in the unit marker (armor with special
              movement abilities.
Mechanized infantry - X with and oval in the unit marker.

------------  LONG INSTRUCTIONS  ------------

Now for the boring instructions and help.  If you are like me in this
regard you will learn to play the game without reading all this other
stuff.  I feel compelled to key it in anyway.

The display:  Above the large game map is a line used to display
information about the gameplay and instructions.  To the right of the large
game map is information about each team's strength in units and total unit
strength and the team's score.  Beneath the team strength is information
about a selected unit: moves remaining, strength, attack factor, defense
factor.  Under the defense factor is the defense factor with terrain
advantages considered, the effective defense strength.  When in the attack
phase the same information is displayed for a targeted unit under the
attacking unit information along with the current attack versus defense
odds on the particular unit highlighted.  Odds information may be viewed
for any opposing units using the arrow keys to move the hexagonal cursor
among these units.

All units have a balanced attack and defense factor except Field Artillery
which has an attack factor double it's defense strength.

Weapon range for all units is 1 hex, except Field Artillery which has a
range of 4.

Armor, Air Assault, and Mechanized Infantry have movement factors of 6.
All other unit types have movement factors of 4.  The exception to this is
air mobile units which begin a turn in a city hex, then they have a
movement factor of 30.

Unit strength is indicated with a horizontal bar on the lower portion of
the unit marker.  All units begin the game with a strength of 4 or 6.

The main menu is self explanatory;  however, all the options are not coded
yet.  Presently only one game may be played, saved, and restored.  Perhaps
this is all that is necessary.  I think not.  Only one map can be edited
and saved by the code.  One can manually copy the map file.

Map editing:  Terrain is changed with 1-6, roads are installed with q, w,
e, r, t, y.  u erases roads.

A game may be played between a computer player and a human, two humans, or
two computer players.  If a human plays a computer player the computer
player will be given an advantage in numbers of units.  There is no control
over the skill level of the computer opponent.  There should be skill
control since everyone deserves a chance to learn to play before being
slaughtered.

Game phases.  Team one, "blue", movement, team one target selection, team
one combat, team two, "red", movement, team two target selection, team two
combat,  repeat.  The game may be saved by exiting to the menu and using
the save game option in any phase except combat.

Unit placement for each team is randomly determined and generally somewhere
not too far from the center of the map.  Any units which are "accidentally"
placed in water hexes at the game start will be permitted to move out of
the water hex.  If you don't like where your units are placed just start a
new game, I don't consider this cheating.

I steered away from the "Perfect General" feature allowing input on the
defender's part during movement and combat.  I don't particularly enjoy
watching the computer player move, for too long at least.  As long as the
computer takes for it's turns in this game no one else will either.

The game supports a mouse but one is definitely not necessary to play the
game.  A mouse will help with scrolling the screen around.  Only the left
mouse button is used in the game.  Click in the hexes inside an imaginary
box which just fits in the hex or the click results will be unpredictable.

Movement:  Click on a unit to move then click on a desired destination, the
shortest path will be found and the unit moved as far as possible.  The
human will have to choose destination hexes carefully for his units to
achieve maximum movement while the computer player will try to stack it's
units automatically.  This feature is most obvious when moving lots of
units down a road.  You'll see what I mean very quickly.  I prefer to pick
how my units are bunched up, not let some simple code do it for me.

ADVICE:  Don't try to have the code determine the shortest path across the
whole board for you.  The shortest path code is rather slow in cases such
as that, even with optimizations which have been added to the shortpath
routine which sometimes return something other than the shortest path.

There are no restrictions on which units can move adjacent to other units.
It's up to the tactician.

Only engineers can move onto water hexes, until they are bridged.  A
bridged water hex is a road hex. Engineers can build bridges on water hexes
after moving into them.

The airborne and air assault units are given a movement bonus when they
begin a turn in a city hex, 30. That turn the terrain has no ill effect on
their movement but they still cannot move over enemy units.  Perhaps they
should be permitted to do so.  I have no code for antiaircraft fire or
aircraft yet.

At the start of every fourth turn reinforcements are placed around a city
controlled by each team, the occupied and controlled city nearest the
center of mass of the team's units.  No choice is available for what
reinforcements are received.  Engineer, Airborne, and air assault units are
provided if a team has none.  Otherwise infantry, armor, and field
artillery are provided.

The score is based upon each team's total strength and how many city hexes
are possessed.  I hate this method of scoring and always play until either
I am hopelessly behind or completely wipe out the opponent's units.  Any
better ideas?

There is no code controlling supplies or a supply path to  units.

The map I provide with this game has absolutely no historical or
geographical basis.  I should look up some battle maps and key one in but
I'd rather play with the code.

All the data files for this game are ascii so feel free to cheat any way
you like and can figure out.  I could include a file layout for these
files.   It would be helpful with bug reports.  Perhaps later.

During the choosing of units to attack a player can see the current odds on
any enemy unit with the arrow keys, but not with the mouse.   Once a human
picks a unit's target there is no changing it.

Generally any function which can be accomplished with a mouse click can be
accomplished with the arrow keys and the enter key.

There is a small map in the lower right corner.  Mouse clicks on this map
will position the game play map where the mouse was clicked.  By far the
best method of scrolling the screen.

Humans are required to hit a key after each battle, so they can see the
results before they are scrolled off the screen but computer players will
complete all battles without interruption.

During battle no input is required or permitted to determine where units
should retreat..  If no retreat path is available ( an empty adjacent hex )
and a unit is forced to retreat it will be eliminated.  All units ( human
and computer, attacker and defender) retreat automatically.  Human players
can choose where units should advance after victorious combat.  After
combat resolution all attacking units are highlighted and the human player
prompted to move those units.  Presently all units which are forced to
retreat will automatically retreat one hex.

There is a very simple table controlling battle results, simulating die
rolls and determining results.  This was one of my biggest headaches about
board games and it is completely automated, random, and fair.  The better
the odds in an attack the greater the chances of inflicting damage to the
opponent and forcing them to retreat.  Odds changes occur at whole numbers.
These are some of the important odds, 5 to 1 and the defender will
definitely retreat, 7 to 1 and the defender will be eliminated.  Adjacent
units do not have to attack so the 1 to 5 and 1 to 6 odds (soak off
attacks) aren't necessary.  When prompted which unit shall be attacked just
press x to let the unit sit out the attack phase.  Attacks with odds less
than 1 are not recommended but sometimes inflict damage on the opponent,
but rarely as much as inflicted on the attacker.  Here's the table:

A:  num of attacking units' strength points eliminated
B:  num of defending units' strength points eliminated
C:  num of hexes attackers may advance, neg means retreat
D:  num of hexes defender may advance, neg means retreat
                           Simulated die roll:
        1         2          3          4          5          6
ODDS    A B  C  D A B  C  D  A B  C  D  A B  C  D  A B  C  D  A B  C  D
------ #- - -- --#- -  -- --#- -  -- --#- -  -- --#- -  -- --#- -  -- --
1 to 6 #2 0 -3  1#1 0  -3 1 #2 0  -4 1 #2 0  -2 0 #2 0  -2 0 #3 0  -2 0
1 to 5 #2 0 -3  1#1 0  -3 1 #2 0  -2 0 #1 0  -2 0 #2 0  -2 0 #3 0  -2 0
1 to 4 #1 0 -3  1#1 0  -2 0 #1 0  -2 0 #2 0  -2 0 #2 0  -2 0 #2 0  -2 0
1 to 3 #1 0 -2  0#1 0  -2 0 #1 0  -2 0 #1 0  -2 0 #2 0  -2 0 #2 0  -2 0
1 to 2 #0 1  1 -2#1 1  0  0 #1 0  -2 0 #1 0  -2 0 #2 0  -2 0 #2 0  -2 0
1 to 1 #0 2  1 -2#1 1  0  0 #0 1  0  -1#1 0  -1 0 #1 0  -1 0 #2 0  -2 0
2 to 1 #0 2  2 -3#1 1  0  -1#0 1  1  -2#1 0  -1 0 #1 1  0  0 #2 0  -1 0
3 to 1 #0 2  2 -3#1 1  0  0 #0 1  1  -2#1 2  2  -3#1 1  0  0 #0 2  3  -4
4 to 1 #0 3  3 -4#1 1  0  0 #1 2  1  -2#0 2  2  -3#1 3  2  -3#0 3  3  -4
5 to 1 #0 4  3 -4#1 2  0  -1#0 3  2  -3#1 2  0  -1#0 2  1  -2#0 4  3  -4
6 to 1 #0 4  4 -5#1 2  1  -2#0 3  3  -4#0 2  2  -3#0 2  3  -4#0 4  4  -5
7 to 1 #0 99 4 -5#0 99 4  -5#0 99 4  -5#0 99 4  -5#0 99 4  -5#0 99 4  -5
Note:
Retreat of one hex is all that is required and implemented.
99 strength points eliminated means the unit loses all strength, or is
eliminated.


With multiple attackers if some damage is sustained by the attackers then
the units are chosen randomly which loose strength.  An exception to this
is field artillery.  Unless a field artillery unit is adjacent to the unit
it attacks it will never receive any damage, except if it is attacking a
field artillery unit where counter battery fire would come into play.  You
should protect your field artillery, the computer player will protect it's.

The computer player is coded with one objective, hunt down and destroy the
opponent's army.  When and if the computer player's opponent gains the
upper hand it will continue to attack as if it had a numerical superiority
in unit strength.

For you tactical geniuses out there.  If you block all short routes for the
computer player to take to get to your armies it will look for a route no
matter how long it is.  This can make game play very very slow on older
PCs, slower than 486s.  I think the short path routine times out after a
minute or so but the computer player will try two or three times ( with
different desired destinations ) to find routes for it's units.  The
movement and short path code for the hex map was a big headache.  It is
sufficient for 486s and better PCs however.

Strategy?  Watch your retreat routes and protect your field artillery.
Computer players make poor use of their air mobile and engineer units but
they can surprise you if you ignore that capability.  Standard tactical
guidelines will be of benefit as well.  A few hints come to mind
immediately,  "git there firstest with the mostest", don't leave gaps in
your lines of defense,  set up lines of defense in favorable terrain, and
don't make attacks with poor odds.

------------  HISTORY  ------------

I began the code for this game a couple of  years ago to see if I could
draw hex patterns on the screen.  It evolved into a wargame loosely based
on the old Avalon Hill boardgames such as "Blitzkrieg."

This is freeware.  I firmly believe there are enough programmers in the
world interested in games that there should be plenty of freeware games
available.  Is there anyone else in the world who shares this opinion?

At present, July 1 1995, there are plenty of bugs in the code and I have
only tested it on 386 and 486 PCs.  The display is poor with EGA graphics
but possibly playable.  I recommend VGA graphics.

The AI for the computer opponent is not the best.  There's no learning
performed on the computer players' part.  The computer player is driven
purely by AI.  One day I plan to put some neural networking to use in this
game.  One thing I've learned though, the more AI, the slower the computer
players play.  I suppose if you want a decent opponent you must be patient.
One good feature of the computer player moving based only on AI without
regard to what map is used is that map changes can be made without need to
change the computer player code.

It would be nice if a player could choose their units.  Presently players
have no choice in the matter.  They take what I give them.  No I'm not
power hungry.   I just haven't coded that feature yet.  In fact there are
tons of nice features I would like to include but that must wait until I
have completed my Master's thesis.  The topic, you guessed it, neural
networking.

I have every intention to improve the play and scope of the game.
Constructive criticism is welcome and perhaps a cooperative effort can be
arranged if there are interested parties.  I'm not greedy,  I'll be happy
to share, provided there will not be any charges or financial gains due to
future developments with this code.  I do reserve the right to choose with
whom I share the code, for now at least I'm going to be cautious.  My code
is in C.  This was my first serious effort to code anything in C, and my
code shows it.

I am constantly trying to find new ways to make the computer player more
formidable.  My goal is make the computer player formidable with as few
units as possible.

The game play may be slow at times but it's free slow gameplay.  Maybe
someone out there will enjoy this game.  I find myself playing it more now
than working on it.

                                   Mike

------------  TO DO LIST  ------------

Not in any particular order:
Line-of-sight
Skill levels
Sound
Aircraft
Unit and position selection
Cybernetics
Map and unit storage in memory for faster scrolling
Improved short path calculation
Unit division and recombination
More unit types
Better name for the game
Bells and whistles
Removal of a couple of irritating display bugs (done)
Removal of the movement bug (feature) which lets the computer cheat
sometimes but very rarely, I assure you.
Battle graphics and sound
Change the map designing keys for roads so the keys help indicate which
road section will be installed
Countries and politics
Supplies
Increased capabilities for engineer units: blow bridges, place minefields.
...

------------  RELEASE NOTES  ------------

Release notes are at the end of this document.

Release 1.1 - July 3, 1995 -  Release 1.0 must have been the shortest lived
    release in history.  A bug causing team 1, blue, to have no movement
    ability was corrected.
Release 1.2 - Sept 13, 1995
  - Airborne and Air Assault units for the computer
    player no longer are stuck in cities they occupy.
  - Airborne and Air Assault units movement increased to 30 hexes if they
    start the turn in cities.
  - A very annoying display bug around they edge of the board was
    corrected.
  - Scores reflect cities controlled by each team and the teams' scores are
    shown on the right side of the screen with other team information.
Release 1.3 - Oct 3, 1995
  - Code modified to allow fast CPUs to perform better short path
    calculation during unit movement.  This should assist computer players
    tremendously.
  - The BW program now can be called with a bat file to provide the command
    line parm to determine whether the slow or fast CPU code is to be used.
    BW.bat       "BW13.exe fast" will enable the fast CPU code, the default
    is to use the slow code.  486 CPU or better is considered fast.
  - Air movement bonus removed for air mobile units at start of battle
    phase so the bonus is not available during advance and retreat
    resulting from battle.
  - Improvements were made to the display of units during their movement.
  - Highlighted units remain highlighted after scrolling the screen.
Release 1.4 - October 24, 1995
  - Reinforcement units include engineer, airborne, and air assault if a
    team has no units of this type.
  - Improved AI for the computer player.  Human AI remains unchanged.
  - Reinforcement units are no longer placed in water hexes.
  - Massive updates to this document.
  - Units advancing after combat may be moved now in the normal movement
    method, rather than one by one with no second chance for movement.
  - Bug corrected which provented human players from moving if they played
    as the red player.

END OF DOCUMENT
