home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / mag_discs / 2 / programs / !GnuChess / HEURISTICS < prev   
Text File  |  1989-10-24  |  5KB  |  99 lines

  1.  
  2.                         THE GNU CHESS HEURISTICS 
  3.  
  4.   Here is a brief description of the heuristics used in the positional 
  5.   evaluator of the GNU Chess program. Many heuristics are functions of the 
  6.   stage of the game which is based on the total non-pawn material remaining 
  7.   for both sides. 
  8.     
  9.  
  10. PAWNS
  11.     The material value of a pawn is 100 points. Isolated pawns get a 
  12.     penalty depending on which file they occupy: 
  13.        (12,14,16,20,20,16,14,12) for files (a..h).
  14.     Doubled pawns (which are not also isolated) get a penalty of 12 
  15.     points. Backward pawns (defined simply as not being defended by a 
  16.     pawn with the square in front also not defended by a a pawn) are 
  17.     penalized 6 points. A 4 point penalty is also invoked for each attack 
  18.     by the opponent to a backward pawn and for a backward pawn on a 
  19.     half-open file. Pawn Advancement in the centre is given a bonus of 
  20.     about 4 points per rank in the opening increasing to about 8 points 
  21.     per rank in the ending. Advancement on the edges is given a lower 
  22.     bonus. Pawns on the e and d files and on the 2nd rank are given a 10 
  23.     point penalty. An additional penalty of 15 points is invoked if these 
  24.     pawns are also blocked. Pawns within 2 squares of the king are given 
  25.     a 10 point bonus. Passed pawns are given a bonus for increasing rank 
  26.     which is a function of stage of the game and of whether the opponent 
  27.     blocks or attacks one or more squares in front of the pawn or if the 
  28.     opponents king is in the square of the pawn. This bonus ranges from 
  29.     about 15 points for a pawn on the second rank up to about 300 points 
  30.     for a passed pawn on the 7th rank which can't be stopped from 
  31.     queening. 
  32.               
  33.  
  34. KNIGHTS
  35.     The material value of a knight is 330 points. The main heuristic for 
  36.     knights is a bonus for proximity to the centre. This varies from 0 
  37.     points in the corners to 30 points in the centre. Knights are also 
  38.     given a bonus for being within 2 squares of each enemy piece. This 
  39.     bonus is a function of the stage of the game, equalling 4 points in 
  40.     the end game. A penalty of 1 point per square is given for distance 
  41.     from either king. A bonus of up to 8 points (depends on stage) is 
  42.     given for knights which can't be driven away by enemy pawns. 
  43.  
  44.  
  45. BISHOPS
  46.     The material value of a bishop is 330 points. Bishops are given a 
  47.     bonus as material falls off the board equalling 10 points in the end 
  48.     game. Bishops get a bonus for mobility and Xray mobility thru pieces 
  49.     but not pawns. This bonus ranges from -4 points for a totally blocked 
  50.     bishop up to 18 points for a bishop attacking 12 or more squares. 
  51.     Xray attacks on an enemy R,Q,K or any undefended piece are given an 8 
  52.     point bonus. Bishops are given a bonus of 14 points if they lie on 
  53.     the edge of the board up to 22 points if the lie in the centre. A 
  54.     bishop is given a bonus of up to 5 points for each attack to a square 
  55.     adjacent to the enemy king. 
  56.  
  57.  
  58. ROOKS
  59.     The material value of a rook is 520 points. Rook mobility is handled 
  60.     similiarly to bishops with a bonus of 0 points if blocked up to 20 
  61.     points if attacking 12 squares or more. A bonus of 8 points for Xray 
  62.     attacks is handled as it is for bishops. Rooks are given a bonus of 
  63.     10 points for occupying a file with no friendly pawns and a bonus of 
  64.     4 points if no enemy pawns lie on that file. After the opening Rooks 
  65.     are penalized slightly depending on "taxicab" distance to the enemy 
  66.     king. 
  67.   
  68.  
  69. QUEENS
  70.     The material value of a queen is 980 points. The only heuristic for a 
  71.     queen is that after the opening it is penalized slightly for 
  72.     "taxicab" distance to the enemy king. 
  73.  
  74.  
  75. KINGS
  76.     Kings are given a penalty for proximity to the centre in the opening 
  77.     and a bonus for proximity to the centre in the endgame. The penalty 
  78.     is about 24 points for being in the centre in the opening with a 
  79.     bonus of about 36 points for being in the centre in the endgame. 
  80.     Kings are penalized for lying on an open or half-open file or if the 
  81.     adjacent file closest to the corner is open or half-open. This 
  82.     penalty is up to 23 points in the opening and goes to zero in the end 
  83.     game. The King is penalized up to 8 points if there are no pawns 
  84.     immediately adjacent. A penalty is invoked depending on the number of 
  85.     "safe" checks available by the opponent. This penalty ranges from 6 
  86.     points for one such check to 50 points for 4 or more. Depending on 
  87.     game stage, Kings are given up to 10 points for castling and a 
  88.     penalty of up to 40 points for moving before castling. 
  89.   
  90.  
  91. SPECIAL
  92.     If more than one piece is "hung" (attacked and not defended or 
  93.     attacked by an enemy piece of lower value) an extra penalty of 10 
  94.     points is invoked for that side and the search may be extended one 
  95.     ply. Pinned or trapped pieces are treated similarly. A special mating 
  96.     routine is used if one side has only a king and the other has mating 
  97.     material. 
  98.  
  99.