mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Reintroduce piece/square tables to score non-captures
Was removed after original movepick restore. But proved to be useful. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
a5c1b3e8f6
commit
88885399f4
1 changed files with 22 additions and 10 deletions
|
@ -226,16 +226,28 @@ void MovePicker::score_captures() {
|
|||
}
|
||||
|
||||
void MovePicker::score_noncaptures() {
|
||||
|
||||
for (int i = 0; i < numOfMoves; i++)
|
||||
{
|
||||
Move m = moves[i].move;
|
||||
if (m == killer1)
|
||||
moves[i].score = HistoryMax + 2;
|
||||
else if (m == killer2)
|
||||
moves[i].score = HistoryMax + 1;
|
||||
else
|
||||
moves[i].score = H.move_ordering_score(pos.piece_on(move_from(m)), m);
|
||||
// First score by history, when no history is available then use
|
||||
// piece/square tables values. This seems to be better then a
|
||||
// random choice when we don't have an history for any move.
|
||||
Move m;
|
||||
int hs;
|
||||
|
||||
for (int i = 0; i < numOfMoves; i++)
|
||||
{
|
||||
m = moves[i].move;
|
||||
|
||||
if (m == killer1)
|
||||
hs = HistoryMax + 2;
|
||||
else if (m == killer2)
|
||||
hs = HistoryMax + 1;
|
||||
else
|
||||
hs = H.move_ordering_score(pos.piece_on(move_from(m)), m);
|
||||
|
||||
// Ensure moves in history are always sorted as first
|
||||
if (hs > 0)
|
||||
hs += 1000;
|
||||
|
||||
moves[i].score = hs + pos.mg_pst_delta(m);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue