AG Schachprogrammierung FUSC# april 2005 FUSC# project group d4c4 a5a6 30%50% 40%20% e4 60%
Schachprogrammier AG Content Overview ° Introduction to the AG Schachprogrammierung ° How does FUSc# represent the chessboard ? ° FUSc# goes internet / the future of FUSc# april 2005
Schachprogrammier AG Foundation of the AG C#, OpenSource first version (V 1.03) quiescent search, killermoves, hashtables, heuristics, iterative search first version playing on the internet (V 1.06) better evaluation first official online-tournament first victory Lange Nacht der Wissenschaften (V 1.07) documentation DarkFUSc#, version 1.0 rotated bitboards DarkFUSc# new evaluation (including an automatic classification of different types of chess positions) 14.Oktober März Juni Juni Juni 2003 january 2004 july 2004 april 2005
Schachprogrammier AG Foundation of the AG april 2005 Table of results: 1.Dauth, Benjamin Düster, Christian Domingo, Miguel Lane, Robin Steffen, Rico Kuprat, Thomas Burghardt, Michael Martin, Mario Trösch, Thomas FUSC# V Kärcher, David Minski, Martin Rauch, Felix Schaller, Peter Wölter, Ulrich Remmo, Abdulrahim 1300
Schachprogrammier AG Foundation of the AG pseudonym :) april 2005
Schachprogrammier AG Foundation of the AG Table of results: 1Matheus 2.3 2Drunken Master 1.0 3BigLion 2.23k 4DelphiMax 2.8 5Asterisk 0.4b 6Madeleine 0.2 7Taktix 2.23k 8WJChess EnginMax 5.11c 10KKFChess Aice Celes 0.77c 13ChessAlex 1.2b7 14Simontacchi 1.81a 15Silke Alfil v Polar Engine Gaia Piranha Eagle 0.2.7c 21FUSC# v Cassandre Trex april 2005
Schachprogrammier AG Project group homepage membership all students (even from other universities) are invited to participate, a mailing list is used for co-ordination some pictures Maro Bader, Andre Rauschenbach, Johannes Buchner, Andreas Gropp, Christian Düster (HU), Falko Krause, Christian Ehrlich, Ben-Fillippo Krippendorff und Marco Block april 2005
Schachprogrammier AG Project group developing enviroment: - MS Visual Studio NET V1.1 - CVS april 2005
Schachprogrammier AG Inside the chess engine board representation move generation wnwn evaluation material Zentrierung der Figuren offene Linien offene Diagonalen Läuferpaar Vorposten Fianchettierung Rochade Entwicklung... opening book Zugwahlalgorithmen... april 2005
FUSc# board represenation Schachprogrammier AGapril 2005
the board as bitboard = 64 BIT-word + very fast and efficient move generation + evaluation parameters can easily be translated in matrices of bitboards (e.g. king safety) - no official standards BitBoards Schachprogrammier AGapril 2005
Schachprogrammier AG BitBoards example: knightmoves[d3] AND opponent-pieces & => X X concretly: idea: compute all possible knight moves from field d3 and save them in a bitboard knightmoves[d3] AND emptyFields enhanchement: knightmoves[d3] AND opponentPieces generates capturing moves problem: the (simple) bitboard representation is limited to non-sliding pieces like knight, king etc. april 2005
Schachprogrammier AG Rotated BitBoards idea 1: compute the moves for sliding pieces depending on the relevant line/diagonal in advance Idee 2: saving flipped representations of the board as rotated bitboards in order for the lines/diagonals to be located sequentially in one single byte #7#6#5#4#3#2#1#0Bit/Byte a8a7a6a5a4a3a2a1#7 b8b7b6b5b4b3b2b1#6 c8c7c6c5c4c3c2c1#5 d8d7d6d5d4d3d2d1#4 e8e7e6e5e4e3e2e1#3 f8f7f6f5f4f3f2f1#2 g8g7g6g5g4g3g2g1#1 h8h7h6h5h4h3h2h1#0 Flipped board (90° to the right) april 2005
Bitboards Schachprogrammier AGapril 2005 // WHITE PAWNS (captures right) tos = ( (board.pawns & NOT_RIGHT_EDGE & from_squares) << 9) & board.b_occ froms = tos >> 9; while (from = GET_LSB(froms)) { board.w_attacks |= from; movelist[movenr].from = from; movelist[movenr].to = GET_LSB(tos); movelist[movenr].det.ll = 0; movelist[movenr].det.ail.piece = PAWN; movelist[movenr].det.ail.flags |= NORMAL_CAPTURE; movenr++; CLEAR_LSB(tos); CLEAR_LSB(froms); }; Generating pawn captures
Bitboards Schachprogrammier AGapril 2005 // WHITE KNIGHT froms = board.knights & from_squares; while (from = GET_LSB(froms)) { from_nr = get_LSB_nr(from); tos = knight_moves[from_nr] & to_squares; while (to = GET_LSB(tos)) { board.w_attacks |= from; movelist[movenr].from = from; movelist[movenr].to = to; movelist[movenr].det.ll = 0; movelist[movenr].det.ail.piece = KNIGHT; movelist[movenr].det.ail.from_nr = from_nr; if (board.b_occ & to) movelist[movenr].det.ail.flags |= NORMAL_CAPTURE; movenr++; CLEAR_LSB(tos); }; CLEAR_LSB(froms); }; Generating knight moves
Bitboards Schachprogrammier AGapril 2005 // WHITE ROOK froms = board.rooks & from_squares; while (from = GET_LSB(froms)) { from_nr = get_LSB_nr(from); rank_pattern = board.occ.byte[from_nr >> 3]; file_pattern = board.occ_l90.byte[l90_to_normal[from_nr] >> 3]; tos = (rank_moves[from_nr][rank_pattern] | file_moves[from_nr][file_pattern]) & to_squares; while (to = GET_LSB(tos)) { board.w_attacks |= from; movelist[movenr].from = from; movelist[movenr].to = to; movelist[movenr].det.ll = 0; movelist[movenr].det.ail.piece = ROOK; movelist[movenr].det.ail.from_nr = from_nr; if (board.b_occ & to) movelist[movenr].det.ail.flags |= NORMAL_CAPTURE; movenr++; CLEAR_LSB(tos); }; CLEAR_LSB(froms); }; Generating rook moves
Schachprogrammier AG Research ideas planning in computer chess prefer moves that correspond to a strategic plan application of neuronal networks prediction of moves, evaluation => development of plans reinforcement learning recalibration of the evaluation vector => learning of plans FUSc# goes linux and 64bit porting to linux with mono, optimizing for AMD64 FUSc# goes pocket pc porting to.NET compact edition april 2005
Schachprogrammier AG The end thanks for listening... april 2005