Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: King safety evaluation

Author: Roberto Waldteufel

Date: 20:23:38 05/28/98

Go up one level in this thread



On May 28, 1998 at 22:44:03, Robert Hyatt wrote:

>On May 28, 1998 at 18:42:10, Roberto Waldteufel wrote:
>
>>
>>My chess program currently has only a crude understanding of king
>>safety, but I would like to try to improve this. It is quite good at
>>finding a forced mate, especially if all of the moves by the mating side
>>are checks, but seems to lack the skill to build up sufficiently
>>aggressive positions to make full use of this ability. I know that most
>>programs measure king safety in some more or less complex way, but I am
>>not sure what is the best thing to measure in terms of information
>>usefulness per time spent. Maybe a very complex king safety function
>>with a hash table to cut down the overhead is the way to go, or pehaps a
>>fairly crude but fast scheme without hashing might be efective. At
>>present my program uses a count of attackers and defenders to guage king
>>safety, where I define (somewhat inaccurately) an attacker/defender to
>>be any piece or pawn that attacks a square adjacent to the king. Does
>>anyone have any better suggestions as to how to build into the
>>evaluation function the tendancy to move its pieces to the most
>>aggressive squares possible?
>>
>>Roberto
>
>
>this is very difficult to get "right"... but there are three issues
>you have to handle.
>
>1.  pawn structure around the king.  open files are bad, half-open files
>are bad, any pawn moves around the king are bad (yes, even playing h3
>for
>no reason is bad as it makes the black move g5-g4 a threat since there
>is
>a target sitting out there at h3.
>
>2.  pieces and how they are positioned to attack the king-side.  This is
>very difficult, although simple "distance" can go a long way.
>
>3.  finally you have to handle the castled-on-same-wing problem that any
>move you make to attack the opponents king might also be a move that
>self-
>attacks your king since you can shred both kingsides at the same time,
>and then you'd better hope your pieces arrive there first...

Thanks for the pointers. I am not quite so sure if h3 is necessarily bad
- orriginally I gave a bonus to for, example, White, if White had his
king on g1 or h1, to each pawn on f2,g2 and h2. I discovered that, in
order to keep the maximum bonus, White had a tendency to leave himself
open to back rank mates. I therefore added a smaller bonus for pawns on
g3 and h3 (not f3) so that these moves, although not encouraged, were
not so discouraged as, for example, h4 or g4. This improved matters a
little (ie it now usually plays g3 or h3 in situations where it is
sensible to do so, but avoids these moves if they serve no particular
purpose), but unfortunately it still happily plays gxf3 or gxh3 with
disastrous consequences! I guess tha's where the open  and half-open
files  would help - at present I don't consider them, but I will try to
incorporate the principle.

The piece placement problem is indeed difficult. Distance seems a good
measure for pawns and knights (even for kings as attackers in a few
positions, eg there is a famous old Teichman game where, having his
pieces poised to deliver mate, he marched his king up the board to
control the key squares). The long range pieces, however, often exert a
strong influence on the king position from afar. Might it be better to
consider the squares attacked by these pieces that are also close (how
close?) to the king? My program uses a full bitboard database of attacks
from and to all the squares, so this would not be too expensive to
compute.

Roberto



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.