TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Gary

Joined: 12 Dec 2006
Posts: 339

Post subject: Re: evaluate loose pieces    Posted: Tue Feb 28, 2012 1:35 pm

mcostalba wrote:
A possible implementation of your idea that seems an acceptable compromise between speed and accuracy could be:

 Code: template   Score evaluate_threats(const Position& pos, EvalInfo& ei) {     const Color Them = (Us == WHITE ? BLACK : WHITE);     Bitboard b, bb;     Score score = SCORE_ZERO;     // Enemy pieces not defended by a pawn and under our attack     Bitboard weakEnemies =  pos.pieces(Them)                           & ~ei.attackedBy[Them][PAWN]                           & ei.attackedBy[Us][0];     if (!weakEnemies)         return SCORE_ZERO;     Bitboard undefended = weakEnemies & ~ei.attackedBy[Them][0];     // Add bonus according to type of attacked enemy piece and to the     // type of attacking piece, from knights to queens. Kings are not     // considered because are already handled in king evaluation.     for (PieceType pt1 = KNIGHT; pt1 < KING; pt1++)     {         b = ei.attackedBy[Us][pt1] & weakEnemies;         if (b)             for (PieceType pt2 = PAWN; pt2 < KING; pt2++)                 if (bb = b & pos.pieces(pt2), bb)                     score += bb & undefended ? 2 * ThreatBonus[pt1][pt2]                                              : 1 * ThreatBonus[pt1][pt2];     }     return score;   }

I gave this idea a try, and it seems that 2x threat bonus is too much. Didn't test too long, but after 150 games, about -40 elo.

Tried a more modest variation of:
 Code: score += bb & undefended ? ((5 * ThreatBonus[pt1][pt2]) / 4) +                                                                   : ((3 * ThreatBonus[pt1][pt2]) / 4);

And that was:
Score of base vs Stockfish 120227 64bit: 178 - 180 - 635 [0.50] 993
ELO difference: -1

So, no real help . I'll try 1.5x and 0.5x.
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
Lucas Braesch Sun Feb 26, 2012 5:20 am
Larry Kaufman Sun Feb 26, 2012 3:57 pm
Lucas Braesch Sun Feb 26, 2012 4:11 pm
Eelco de Groot Sun Feb 26, 2012 5:57 pm
Michael Hoffmann Sun Feb 26, 2012 6:53 pm
Marco Costalba Sun Feb 26, 2012 7:04 pm
Eelco de Groot Mon Feb 27, 2012 12:46 am
Marco Costalba Mon Feb 27, 2012 7:17 am
Lucas Braesch Mon Feb 27, 2012 10:20 am
Sam Hamilton Mon Feb 27, 2012 10:23 am
Lucas Braesch Mon Feb 27, 2012 1:40 pm
Evert Glebbeek Mon Feb 27, 2012 2:34 pm
Marek Kwiatkowski Mon Feb 27, 2012 2:58 pm
Eelco de Groot Mon Feb 27, 2012 9:45 pm
Re: evaluate loose pieces Gary Tue Feb 28, 2012 1:35 pm
Marek Kwiatkowski Tue Feb 28, 2012 2:35 pm
Joona Kiiski Tue Feb 28, 2012 4:04 pm
Marek Kwiatkowski Tue Feb 28, 2012 5:57 pm
Eelco de Groot Fri May 25, 2012 11:36 pm
Gary Tue Feb 28, 2012 4:04 pm
Lucas Braesch Mon Feb 27, 2012 3:57 am
Sam Hamilton Sun Feb 26, 2012 7:12 pm
Miguel A. Ballicora Sun Feb 26, 2012 5:11 pm
Larry Kaufman Sun Feb 26, 2012 5:20 pm
Sam Hamilton Sun Feb 26, 2012 6:50 pm
Lucas Braesch Mon Feb 27, 2012 3:59 am
Sam Hamilton Mon Feb 27, 2012 4:28 am
Ed Schroder Mon Feb 27, 2012 11:42 am
Gerd Isenberg Sun Feb 26, 2012 7:56 pm

 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