1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Reorder evasions

Always try ttMove as first. Then try good captures ordered
by MVV/LVA, then non-captures if destination square is not
under attack, ordered by history value, and at the end
bad-captures and non-captures with a negative SEE. This
last group is ordered by the SEE score.

After 999 games at 1+0
Mod vs Orig +254 =546 -199 +19 ELO

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2009-10-31 10:51:04 +01:00
parent dddaeff7d8
commit 70b7404a63

View file

@ -197,8 +197,8 @@ void MovePicker::score_captures() {
if (move_is_promotion(m)) if (move_is_promotion(m))
cur->score = QueenValueMidgame; cur->score = QueenValueMidgame;
else else
cur->score = int(pos.midgame_value_of_piece_on(move_to(m))) cur->score = pos.midgame_value_of_piece_on(move_to(m))
-int(pos.type_of_piece_on(move_from(m))); - pos.type_of_piece_on(move_from(m));
} }
} }
@ -229,19 +229,25 @@ void MovePicker::score_noncaptures() {
} }
void MovePicker::score_evasions() { void MovePicker::score_evasions() {
// Always try ttMove as first. Then try good captures ordered
// by MVV/LVA, then non-captures if destination square is not
// under attack, ordered by history value, and at the end
// bad-captures and non-captures with a negative SEE. This
// last group is ordered by the SEE score.
Move m; Move m;
int seeScore;
for (MoveStack* cur = moves; cur != lastMove; cur++) for (MoveStack* cur = moves; cur != lastMove; cur++)
{ {
m = cur->move; m = cur->move;
if (m == ttMoves[0].move) if (m == ttMoves[0].move)
cur->score = 2 * HistoryMax; cur->score = 2 * HistoryMax;
else if (!pos.square_is_empty(move_to(m))) else if ((seeScore = pos.see_sign(m)) < 0)
{ cur->score = seeScore;
int seeScore = pos.see(m); else if (pos.move_is_capture(m))
cur->score = seeScore + (seeScore >= 0 ? HistoryMax : 0); cur->score = pos.midgame_value_of_piece_on(move_to(m))
} else - pos.type_of_piece_on(move_from(m)) + HistoryMax;
else
cur->score = H.move_ordering_score(pos.piece_on(move_from(m)), move_to(m)); cur->score = H.move_ordering_score(pos.piece_on(move_from(m)), move_to(m));
} }
} }