Changes

Jump to: navigation, search

King Safety

809 bytes added, 22:20, 29 March 2021
no edit summary
'''[[Main Page|Home]] * [[Evaluation]] * King Safety'''
[[FILE:SamuelBak_King.jpg|border|right|thumb|link=http://chgs.elevator.umn.edu/asset/viewAsset/57f3b6787d58ae5f74bf8ba9#57f3b6d77d58ae5574bf8bb0|[[:Category:Samuel Bak|Samuel Bak]] - King <ref>[http://chgs.elevator.umn.edu/asset/viewAsset/57f3b6787d58ae5f74bf8ba9#57f3b6d77d58ae5574bf8bb0 Chess in the Art of Samuel Bak], [http://www.chgs.umn.edu/ Center for Holocaust & Genocide Studies], [https://en.wikipedia.org/wiki/University_of_Minnesota [University of Minnesota]]</ref> ]]
Good evaluation of the '''king safety''' is one of the most challenging tasks in writing an evaluation function, but also the most rewarding. The subjects are placed here in order of approximate (implementation) difficulty. If this page grows, it might be worthwhile to create a sub-page for each term.
King [https://en.wikipedia.org/wiki/Tropism tropism] is a simplified form of king safety evaluation. It takes into account the [[Distance|distance]] between the King and the attacking pieces, possibly weighted against [[Point Value|piece value]]. For example, one may double the distance value for a queen, and halve it for bishops and rooks. This kind of evaluation acts in a probabilistic way - it is by no means certain that being close to the king helps in attacking it. For example, if white castles short, black rook on h8 gets a higher tropism value regardless whether it stands on an open file. Nevertheless, using this kind of crude evaluation term increases a probability of building up an attack.
This kind of algorithm is used by [[Crafty]]. Another, perhaps more basic example is the [[CPW-engineEngine]] 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"
<span id="SquareControl"></span>
==Square Control==
The most elaborate king safety evaluation schemes gather information about [[Square Control|control of the squares]] near the enemy king. A good explanation of such an algorithm might be found on [[Ed Schroder|Ed Schröder's]] ''Programmer Corner'' <ref>[http://www.top-5000.nl/authors/rebel/chess840.htm [Rebel#ProgrammerCorner|Programmer Corner] by [[Ed Schroder|Ed Schröder]], King Safety in REBEL</ref> <ref>How Rebel Plays Chess is also available as [http://members.home.nl/matador/Inside%20Rebel.pdf pdf]</ref>. If a program, unlike [[Rebel]], does not keep [[Incremental Updates|incrementally updated]] [[Attack and Defend Maps|attack tables]], this knowledge is likely to be uncovered while calculating [[Mobility|mobility]].
==Attack Units==
* [[Evaluation Function Draft]]
* [[Evaluation Patterns]]
* [[King Pattern#KingSafety|King Safety]] in [[King Pattern]] with [[Bitboards]]
* [[Mate at a Glance]]
==2010 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=31571 Distance to King] by [[Adam Berent]], [[CCC]], January 08, 2010
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=38756 About king safety] by [[Fermin Serrano]], [[CCC]], April 15, 2011 » [[Rodin]]
* [http://www.talkchess.com/forum/viewtopic.php?t=39102 value of king tropism in eval function] by [[Tom King]], [[CCC]], May 17, 2011
* [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=
* [http://www.top-5000.nl/authors/rebel/chess840.htm Programmer Corner] by [[Ed Schroder|Ed Schröder]], King Safety in REBEL <ref>[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</ref>
* [http://www.mark-weeks.com/aboutcom/aa03e17.htm Middle game - King safety] from [http://www.mark-weeks.com/aboutcom/aa02j19.htm Chess Tutorial : Improve Your Middle Game] by [[Mark Weeks]]
* [https://en.wikibooks.org/wiki/Chess_Strategy/The_positions_of_the_kings Chess Strategy/The positions of the kings - Wikibooks]
* [[Videos#:Category:The Rolling Stones|The Rolling Stones]] - [https://en.wikipedia.org/wiki/Gimme_Shelter Gimme Shelter] (1998 promotion video), [https://en.wikipedia.org/wiki/YouTube YouTube] Video: [https://en.wikipedia.org/wiki/Bridges_to_Babylon_Tour_%2797%E2%80%9398 Bridges to Babylon Tour] feat. [https://en.wikipedia.org/wiki/Lisa_Fischer Lisa Fischer] and [[Videos#DarrylJones:Category:Darryl Jones|Darryl Jones]], et al., December 12 1997, [https://en.wikipedia.org/wiki/The_Dome_at_America%27s_Center Trans World Dome], [https://en.wikipedia.org/wiki/St._Louis St. Louis] [https://en.wikipedia.org/wiki/Missouri Missouri]
: {{#evu:https://www.youtube.com/watch?v=8kl6q_9qZOs|alignment=left|valignment=top}}
'''[[Evaluation|Up one Level]]'''
[[Category:Samuel Bak]]
[[Category:Darryl Jones]]
[[Category:The Rolling Stones]]

Navigation menu