TalkChess.com
Hosted by Your Move Chess & Games

Author Message
Folkert van Heusden

Joined: 14 Mar 2008
Posts: 879
Location: Gouda, the Netherlands

Post subject: Re: see    Posted: Wed Nov 29, 2017 5:03 pm

Hi Steve,

I followed your post -leaving out the early bailouts for now.
That works in some cases but not all. E.g. [d]8/2q2k2/4rb2/4pR2/5P2/3N4/Q7/4K3 w - - 0 1[/d] gives 1200.
It's probably due to that threshold. My question now is: what is the value of the threshold compared to the piece values?

 Code: // xy are of the victim int Scene::getSEE(const int x, const int y, const ChessPiece *const attacker) const {    const ChessPiece *const victim = b.getAt(x, y);    const PlayerColor c = attacker -> getColor();    // bit 0...15: if set, then a white piece can walk over and/or attack this field, 16...31 black    const uint32_t bits = ss.back().tcs.cells[y][x];    int see_val = victim -> getEvalVal();    int trophy_val = attacker -> getEvalVal();    PlayerColor sc = opponentColor(c);    int so[] = { 0, 16 }; // where to start to search in the bit pattern. so[0] is for white    constexpr int soe[] = { 16, 32 }; // where to stop searching. soe[0] is for white    for(; so[sc] < soe[sc];) {       // find a 1 bit       while((bits & (1 << so[sc])) == 0) {          // if end of pattern, stop searching          if (++so[sc] == soe[sc])             break;       }       if (so[sc] >= soe[sc])          break;       if (sc == c)          see_val += trophy_val;       else          see_val -= trophy_val;       // get eval val. bit number is an index in pieces[color][index] pointing to the       // piece.       trophy_val = sc == WHITE ? pieces[sc][so[sc]] -> getEvalVal() : pieces[sc][so[sc] - 16] -> getEvalVal();       // on to the next bit!       so[sc]++;       sc = opponentColor(sc);    }    return see_val; }
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
Subject Author Date/Time
Folkert van Heusden Tue Nov 28, 2017 1:11 pm
Álvaro Begué Tue Nov 28, 2017 1:30 pm
Folkert van Heusden Tue Nov 28, 2017 1:38 pm
Tamás Kuzmics Tue Nov 28, 2017 1:43 pm
Álvaro Begué Tue Nov 28, 2017 1:49 pm
Tamás Kuzmics Tue Nov 28, 2017 1:32 pm
Marco Belli Tue Nov 28, 2017 3:26 pm
Álvaro Begué Tue Nov 28, 2017 3:58 pm
Marco Belli Tue Nov 28, 2017 4:35 pm
Folkert van Heusden Tue Nov 28, 2017 7:34 pm
Peter Österlund Tue Nov 28, 2017 8:11 pm
Steve Maughan Tue Nov 28, 2017 9:36 pm
Re: see Folkert van Heusden Wed Nov 29, 2017 5:03 pm
Steve Maughan Wed Nov 29, 2017 5:16 pm
Sven Schüle Wed Nov 29, 2017 8:49 pm
Álvaro Begué Wed Nov 29, 2017 9:00 pm
laurie tunnicliffe Thu Nov 30, 2017 2:01 am
Álvaro Begué Thu Nov 30, 2017 5:07 am
laurie tunnicliffe Thu Nov 30, 2017 5:43 am
Álvaro Begué Thu Nov 30, 2017 11:47 am
Richard Delorme Thu Nov 30, 2017 12:44 pm
Maarten Claessens Wed Nov 29, 2017 9:11 am
Folkert van Heusden Wed Nov 29, 2017 9:20 am
Marco Belli Wed Nov 29, 2017 9:50 am
Folkert van Heusden Wed Nov 29, 2017 2:00 pm
Maarten Claessens Wed Nov 29, 2017 10:34 am
Álvaro Begué Wed Nov 29, 2017 11:33 am
Tony Soares Fri Dec 01, 2017 10:51 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 ForumChess Players 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