home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / gnuch40.zip / gnuchess-4.0.pl79 / doc / HEURISTICS < prev    next >
Text File  |  1998-09-28  |  7KB  |  136 lines

  1. This file contains a description of GNU's heuristics.
  2.    Copyright (C) 1986, 1987 Free Software Foundation, Inc.
  3.  
  4. This file is part of CHESS.
  5.  
  6. CHESS is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY.  No author or distributor
  8. accepts responsibility to anyone for the consequences of using it
  9. or for whether it serves any particular purpose or works at all,
  10. unless he says so in writing.  Refer to the CHESS General Public
  11. License for full details.
  12.  
  13. Everyone is granted permission to copy, modify and redistribute
  14. CHESS, but only under the conditions described in the
  15. CHESS General Public License.   A copy of this license is
  16. supposed to have been given to you along with CHESS so you
  17. can know your rights and responsibilities.  It should be in a
  18. file named COPYING.  Among other things, the copyright notice
  19. and this notice must be preserved on all copies.  */
  20.  
  21.  -- requested by main author
  22. Heuristic descriptions for CHESS.
  23.  
  24. Revision: 12-16-87
  25.  
  26. Copyright (c) 1987 by John Stanback
  27. Modified 1991 by Mike McGann
  28.  
  29. Timing:
  30.  
  31.   An initial quantum of time = Time Remaining/(2 * moves remaining +1) 
  32.   is alocated to the search. After this time is used up a check is made
  33.   if the score has changed more than ZSCORE points between the last 
  34.   two search levels or if at least ZDEPTH has not been reached or if
  35.   the choosen move has changed between the last two search levels
  36.   the time is doubled. 
  37.  
  38. Evaluation:
  39.  
  40.   Here is a brief description of the heuristics used in the positional 
  41.   evaluator of the GNU Chess program. Many heuristics are functions of the 
  42.   stage of the game which is based on the total non-pawn material remaining 
  43.   for both sides. 
  44.     
  45.  
  46. PAWNS
  47.     The material value of a pawn is 100 points. Isolated pawns get a 
  48.     penalty depending on which file they occupy: 
  49.        (12,14,16,20,20,16,14,12) for files (a..h).
  50.     Doubled pawns (which are not also isolated) get a penalty of 12 
  51.     points. Backward pawns (defined simply as not being defended by a 
  52.     pawn with the square in front also not defended by a a pawn) are 
  53.     penalized 6 points. A 4 point penalty is also invoked for each attack 
  54.     by the opponent to a backward pawn and for a backward pawn on a 
  55.     half-open file. Pawn Advancement in the centre is given a bonus of 
  56.     about 4 points per rank in the opening increasing to about 8 points 
  57.     per rank in the ending. Advancement on the edges is given a lower 
  58.     bonus. Pawns on the e and d files and on the 2nd rank are given a 10 
  59.     point penalty. An additional penalty of 15 points is invoked if these 
  60.     pawns are also blocked. Pawns within 2 squares of the king are given 
  61.     a 10 point bonus. Passed pawns are given a bonus for increasing rank 
  62.     which is a function of stage of the game and of whether the opponent 
  63.     blocks or attacks one or more squares in front of the pawn or if the 
  64.     opponents king is in the square of the pawn. This bonus ranges from 
  65.     about 15 points for a pawn on the second rank up to about 300 points 
  66.     for a passed pawn on the 7th rank which can't be stopped from 
  67.     queening. 
  68.               
  69.  
  70. KNIGHTS
  71.     The material value of a knight is 330 points. The main heuristic for 
  72.     knights is a bonus for proximity to the centre. This varies from 0 
  73.     points in the corners to 30 points in the centre. Knights are also 
  74.     given a bonus for being within 2 squares of each enemy piece. This 
  75.     bonus is a function of the stage of the game, equalling 4 points in 
  76.     the end game. A penalty of 1 point per square is given for distance 
  77.     from either king. A bonus of up to 8 points (depends on stage) is 
  78.     given for knights which can't be driven away by enemy pawns. 
  79.  
  80.  
  81. BISHOPS
  82.     The material value of a bishop is 330 points. Bishops are given a 
  83.     bonus as material falls off the board equalling 10 points in the end 
  84.     game. Bishops get a bonus for mobility and Xray mobility thru pieces 
  85.     but not pawns. This bonus ranges from -4 points for a totally blocked 
  86.     bishop up to 18 points for a bishop attacking 12 or more squares. 
  87.     Xray attacks on an enemy R,Q,K or any undefended piece are given an 8 
  88.     point bonus. Bishops are given a bonus of 14 points if they lie on 
  89.     the edge of the board up to 22 points if the lie in the centre. A 
  90.     bishop is given a bonus of up to 5 points for each attack to a square 
  91.     adjacent to the enemy king. 
  92.  
  93.  
  94. ROOKS
  95.     The material value of a rook is 520 points. Rook mobility is handled 
  96.     similiarly to bishops with a bonus of 0 points if blocked up to 20 
  97.     points if attacking 12 squares or more. A bonus of 8 points for Xray 
  98.     attacks is handled as it is for bishops. Rooks are given a bonus of 
  99.     10 points for occupying a file with no friendly pawns and a bonus of 
  100.     4 points if no enemy pawns lie on that file. After the opening Rooks 
  101.     are penalized slightly depending on "taxicab" distance to the enemy 
  102.     king. 
  103.   
  104.  
  105. QUEENS
  106.     The material value of a queen is 980 points. The only heuristic for a 
  107.     queen is that after the opening it is penalized slightly for 
  108.     "taxicab" distance to the enemy king. 
  109.  
  110.  
  111. KINGS
  112.     Kings are given a penalty for proximity to the centre in the opening 
  113.     and a bonus for proximity to the centre in the endgame. The penalty 
  114.     is about 24 points for being in the centre in the opening with a 
  115.     bonus of about 36 points for being in the centre in the endgame. 
  116.     Except when the otherside has only pawns. Then the bonus is turned off.
  117.     Kings are penalized for lying on an open or half-open file or if the 
  118.     adjacent file closest to the corner is open or half-open. This 
  119.     penalty is up to 23 points in the opening and goes to zero in the end 
  120.     game. The King is penalized up to 8 points if there are no pawns 
  121.     immediately adjacent. A penalty is invoked depending on the number of 
  122.     "safe" checks available by the opponent. This penalty ranges from 6 
  123.     points for one such check to 50 points for 4 or more. Depending on 
  124.     game stage, Kings are given up to 10 points for castling and a 
  125.     penalty of up to 40 points for moving before castling. 
  126.   
  127.  
  128. SPECIAL
  129.     If more than one piece is "hung" (attacked and not defended or 
  130.     attacked by an enemy piece of lower value) an extra penalty of 10 
  131.     points is invoked for that side and the search may be extended one 
  132.     ply. Pinned or trapped pieces are treated similarly. A special mating 
  133.     routine is used if one side has only a king and the other has mating 
  134.     material. 
  135.  
  136.