Changes

Jump to: navigation, search

King Safety

1,161 bytes added, 22:20, 29 March 2021
no edit summary
This kind of algorithm is used by [[Crafty]]. Another, perhaps more basic example is the [[CPW-Engine]] as implemented in [[CPW-Engine_eval]], and the one demonstrated in the [[Evaluation Function Draft]].
<span id="VMOB"></span>
=Virtual Mobility=
Another heuristic is to temporary replace the king by a [[Queen|queen]], to use her virtual [[Mobility|mobility]] as a measure of opponent's [[Sliding Pieces|sliding piece]] [[Sliding Piece Attacks|attacking]] chances and therefore an unsafe king.
One may even temporary modify the [[Occupancy|occupancy]] to improve this virtual mobility, e.g by removing mobile opponent pieces.
<span id="Scaling"></span>
=Scaling=
=Attacking King Zone=
''sample specification''
King zone is usually defined as squares to which enemy King can move plus two or three additional squares facing enemy position. Basic King safety function, similar to the one described in [[Toga Log#UserManual|Toga log user manual]], can work as follows: we have two variables, '''attackingPiecesCount''' and '''valueOfAttacks''', zeroed at startup. If a piece attacks enemy king zone, we increase attackingPiecesCount by one, and count how many squares within enemy King zone are attacked. We multpily the number of attacked squares by a constant: 20 for a knight, 20 for a bishop, 40 for a rook and 80 for a queen. The result of multiplication is added to valueOfAttacks. After finding all attacks, we look at attackingPiecesCount, use it as an index to the table given below, and our king attack score is <br/> '''(valueOfAttacks * attackWeight[attackingPiecesCount] ) / 100'''.
{| class="wikitable"
* [[Evaluation Function Draft]]
* [[Evaluation Patterns]]
* [[King Pattern#KingSafety|King Safety]] in [[King Pattern]] with [[Bitboards]]
* [[Mate at a Glance]]
* [http://www.talkchess.com/forum/viewtopic.php?t=42065 Approaches to king safety?] by [[Mike Robinson]], [[CCC]], January 19, 2012
* [http://www.talkchess.com/forum/viewtopic.php?t=44849 For Ed Schroeder: Rebel's Pawn Shield and Pawn Storm Eval] by Marcel Fournier, [[CCC]], August 21, 2012
* [https://groups.google.com/d/msg/fishcooking/lIjQUH3dsYg/4VEtHUkrdBsJ Pinned pieces in king safety] by [[Stefan Geschwentner]], [[Computer Chess Forums|FishCooking]], March 28, 2014 » [[Pin]], [[Stockfish]]
* [http://www.talkchess.com/forum/viewtopic.php?t=52774 King shelter x-ray attacks] by [[Lyudmil Tsvetkov]], [[CCC]], June 27, 2014 » [[X-ray Attacks (Bitboards)]]
* [http://www.talkchess.com/forum/viewtopic.php?t=52779 Heavy piece shelter] by [[Lyudmil Tsvetkov]], [[CCC]], June 27, 2014
* [http://www.talkchess.com/forum/viewtopic.php?t=65338 enemy edge pawn as part of own king shelter] by Bram Mourik, [[CCC]], September 30, 2017
* [http://www.talkchess.com/forum/viewtopic.php?t=66599 Pawn Storm - Theory] by [[Dennis Sceviour]], [[CCC]], February 14, 2018 » [[King Safety#PawnStorm|Pawn Storm]]
==2020 ...==
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=72981 Pruning / reduction depending on king safety] by [[Vivien Clauzon]], [[CCC]], February 02, 2020 » [[Pruning]], [[Reductions]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=73877 Positional evaluation of your engine on this?] by [[Tom King]], [[CCC]], May 09, 2020
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=76976 King safety evaluation] by [[Niels Abildskov]], [[CCC]], March 29, 2021
=External Links=

Navigation menu