Changes

Jump to: navigation, search

Attack and Defend Maps

533 bytes added, 11:36, 31 August 2020
no edit summary
'''[[Main Page|Home]] * [[Programming]] * [[Data]] * Attack and Defend Maps'''
[[FILE:ShelteringMyths.jpg|border|right|thumb|[[Arts#:Category:Samuel Bak|Samuel Bak]] - Sheltering Myths, 1998 <ref>[https://static1.squarespace.com/static/594044bd3a041171e0426683/t/5a12fc6b53450acdbebfc69d/1511193725379/Bak_The+Game+Continues_2000.pdf The Game Continues - Chess in the Art of Samuel Bak] (pdf) from [https://www.puckergallery.com/artists/#/samuel-bak/ Samuel Bak - represented by Pucker Gallery since 1969]</ref> ]]
'''Attack and Defend Maps''',<br/>
also called '''Attack Tables''', refer to data-structures, most often [[Array|arrays]], containing [[Attacks|attack or defend ]] information for every pawn or piece and/or the transposed information for each square, which pieces [[Square Control|control]], that is either attack or defend it. These Maps are useful for [[Evaluation|evaluation]] purposes such as safe [[Mobility|mobility]], [[Static Exchange Evaluation|SEE]] and of course [[Move Generation|move generation]]. While the piece centric attack information, a set of attacked squares per piece, is often encoded as [[Bitboards|bitboard]], there are more alternatives for storing the square centric information, about attacking pieces.
=Maintaining Attacks=
=Implementations=
==Classical Approach==
The square centric classical approach with bitboards was used in [[Chess (Program)|Chess 4.5]] and descibed described by [[Larry Atkin]] and [[David Slate]] <ref>[[David Slate]], [[Larry Atkin]] ('''1977'''). ''CHESS 4.5 - The Northwestern University Chess Program.'' [[Chess Skill in Man and Machine]] (ed. [[Peter W. Frey]]), pp. 82-118. Springer-Verlag, New York, N.Y. 2nd ed. 1983. ISBN 0-387-90815-3. Reprinted reprinted ('''1988''') in [[Computer Chess Compendium]]</ref> . The incrementally updated attack tables, from which most move generation is done, are called ''ATKFR'' and ''ATKTO''. ''ATKFR'' is a set of 64 bitboards which give, for each square, all the squares attacked by the piece, if any, that resides on the square. ''ATKTO'' ([[Square Attacked By]]) is the transpose of ''ATKFR'', giving for each square, the locations of all pieces that attack that square. For instance the square E4 (T) is attacked by a black rook at E8, a black knight at F6, and defended by a white rook at E1 and a white pawn at D3 <ref>[http://www.craftychess.com/hyatt/bitmaps.html Rotated bitmaps, a new twist on an old idea] by [[Robert Hyatt]]</ref> :
<pre>
attacks_to[E4]
A [[Square Attacked By]] bitboard aka ''ATKFR'' as possible union-set of multiple pawns and pieces of either side require intersections with piece bitboards, or [[BitScan|bitscanned]] square lookups, to determine which pieces and how many attack or defend.
Based on a fixed piece-type and bit-position relation with usual material dispositions (for each side, no more than one queen, two rooks, one bishop per square color, two knights), 32-bit [[Piece-Sets]] already inherit the information which pieces (and how many of both sides) attack a particular square, one can even imagine a 16-bit lookup inside a 64KByte table to get an denser attack indicator/count byte for each color a lá [[Attack and Defend Maps#EDsLookup|Ed Schröder]]. [[MS-DOS]] [[IsiChess]] maintained an [[Array|array]] of 64 32-bit piece-sets for every square, and an array of up to 32 attack-to bitboards for every piece. However working with piece-sets requires an additional indirection via a [[Piece-listsLists|Piece-list]] to get the square of that piece.
<span id="EDsLookup"></span>
===Ed's lookup===
=See also=
* [[Excalibur Mirage#AttackMaps|Attack Maps]] in [[Excalibur Mirage]]
* [[Piece-Sets]]
* [[Bitboards]]
==2000 ...==
* [https://www.stmintz.com/ccc/index.php?id=209546 Counting attacked squares: how?] by [[Leen Ammeraal]], [[CCC]], January 24, 2002
* [https://www.stmintz.com/ccc/index.php?id=260736 <nowiki>attacks_from[] and attacks_to[] </nowiki> info] by Nagendra Singh Tomar, [[CCC]], October 21, 2002
* [https://www.stmintz.com/ccc/index.php?id=266390 Attack tables] by [[Andreas Herrmann]], [[CCC]], November 20, 2002
* [https://www.stmintz.com/ccc/index.php?id=363519 The Zappa Attack Table Code] by [[Anthony Cozzie]], [[CCC]], May 05, 2004
==2010 ...==
* [http://www.talkchess.com/forum/viewtopic.php?t=52085 Incrementally-updated attack map] by [[Harm Geert Muller]], April 21, 2014 » [[Incremental Updates]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=68196 Attacks From table] by [[Edsel Apostol]], [[CCC]], August 11, 2018
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=68995 How to incrementally update attack tables?] by [[Maksim Korzh]], [[CCC]], November 21, 2018 » [[Incremental Updates]]
* [http://www.talkchess.com/forum3/viewtopic.php?f=7&t=69301 Fast SEE (Ed's lookup revisited)] by [[Harm Geert Muller]], [[CCC]], December 17, 2018 » [[#EDsLookup|Ed's lookup]], [[Static Exchange Evaluation|SEE]]
=References=

Navigation menu