TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Gary

Joined: 12 Dec 2006
Posts: 338

Post subject: Undefended pieces    Posted: Mon Mar 05, 2012 11:20 pm

I thought I would try this out after the recent thread on loose pieces. The idea is that in the opening, it's good to have pieces defended by each other. So, pieces that are undefended get a small penalty. This is in addition to the penalty they may receive by being attacked by an enemy piece.

Unfortunately, it did not seem to help. It was decently promising in 16k games at 5ply fixed depth matches, showing +3-4 elo. Due to the loss of speed, this didn't carry over to timed matches that I could see.

The current version of the modification for Stockfish is below. I really like that Marco has posted Stockfish on github! Forking and playing around with the code is so easy. I should note that the branch of the fork is available here: https://github.com/glinscott/Stockfish/tree/undefended_pieces.

 Code: const Score UndefendedPenalty[] = {   S(0, 0), S(3, 0), S(12, 2), S(12, 2), S(25, 6), S(45, 15) }; // Enemy pieces not defended by a pawn Bitboard weakEnemies =  pos.pieces(Them)                   & ~ei.attackedBy[Them][PAWN]; Bitboard undefended = weakEnemies & ~ei.attackedBy[Them][0] & ~(Rank1BB | Rank8BB); if (undefended) {   const int multipliers[] = { 0, 1, 3, 6, 12, 22, 36, 36, 36, 36, 36, 36, 36, 36, 36 };   int undefendedCount = 0;   while (undefended)   {     Square s = pop_1st_bit(&undefended);     PieceType pt = type_of(pos.piece_on(s));     if (pt != KING)     {       score += UndefendedPenalty[pt];       if (pt != PAWN)         undefendedCount++;     }   }   score = (multipliers[undefendedCount] * score) / 32; }
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
Gary Mon Mar 05, 2012 11:20 pm
Marco Costalba Tue Mar 06, 2012 7:04 am
Joona Kiiski Tue Mar 06, 2012 4:31 pm
Gary Wed Mar 07, 2012 1:59 am
Marco Costalba Wed Mar 07, 2012 6:20 am
Gary Mon Mar 19, 2012 1:55 am
Marco Costalba Mon Mar 19, 2012 8:47 am

 Jump to: Select a forum Computer Chess Club Forums----------------Computer Chess Club: General TopicsComputer Chess Club: Tournaments and MatchesComputer Chess Club: Programming and Technical DiscussionsComputer Chess Club: Engine Origins Other Forums----------------Chess Thinkers ForumForum Help and Suggestions
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum