Wow, this is the most fun I've had in years.  I wish I had had programming
assignments like this when I was in school.

The program is divided into three CPP files and two H files.  

main.cpp ->            establishes communications with the server and
                       runs the main loop.

Map.cpp & Map.h ->     map related functions.

Robot.cpp & Robot.h -> everything else.

Design methodology used:  "Keep it Simple" and "Quick and Dirty"

Overall design:  Keep a list of Robots and Packages and try to track
where everything is at all times.  Use a simple A-Star algorythm to 
provide path guidance between goals.

Pseudo code for AI:

if not carrying packages
  Do I know of other packages on the board?
    yes:
      Compute a basic value of all known packages
      Select the best package and move to that location (80% chance)
      -or-
      goto a random base on map (20% chance)
    no:
      goto a random base on map
else
  Take Package to destination
  Pick up any other packages along the way

Once the basic AI was implemented, I added as many huristics that I could
think of to give the robot an advantage over others.  Here are some of
the huristics

Special Moves:
  
Deathbot:  If the opportunity to push someone in the water presents itself, do
it. Use 20 units to push them in.

Escape:  If I am between a robot and a water square, use 3% of my energy
to push the robot back

Evade:  If I stay in relatively the same spot for many turns, try to move
randomly. (aka dumbass move -- to get around really stupid robots that 
just standoff)


Some Other Huristics:

Robot is hydrophobic.  The Cost to enter a square that is next to water is 
tripple the normal cost.  This keeps the robot away from water squares where 
he may be pushed in.

Push the other guys around.  If there is a robot in the next square I want
to move into, use 2 units instead of 1.

Package value.  A package value is the weight of the package divided by
sum of the distance between the robot and the package and the package
and its destination

Code:

The code is very incomprehensible, but it works :)

I wrote it in C++ because that's what I have been using at work, so I am
most familiar with it.  I'm a big fan of Python, but I wouldn't have enough
time to finish with my current learning curve for python.

I found that alot of things I would normally do in C++ got in the way
due to time constraints.  I started out with public and private data,
to follow data hiding principals, but it just got in the way.  I just
made everything public. 

Given more time, I would have fixed some stuff.  Tracking of dropped objects
never really worked.  If I was pushed and dropped a package, I just kept going
to the destination.  I would have merged the Robot class and the RobotGang
class since they are effectively the same entity.  The Package class
works a little bit better.  The map class is the closest to good C++.  It's
obvious that I started with it.  I would like to have made a better status 
display.

Status Display:

Running the program will display a view of the map along with some
basic parameters.

Please let me know if you have any questions:

Best Regards
David Dillard

programmer@tscbs.org


