X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=82edeec8ac0c43b666ea6df70d728da0989b62b9;hb=70b7404a63b74a57d4e1d0b9192b00837e9a1af8;hp=568d4635da4c60fa5e97be9c65c215d8c2e866bc;hpb=b38685625af42b9ef96a9f964062d63fe0b3d027;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 568d4635..82edeec8 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -244,35 +244,35 @@ namespace { // ThreatBonus[][] contains bonus according to which piece type // attacks which one. const Value MidgameThreatBonus[8][8] = { - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // not used - V(0),V(30), V(0),V(50), V(70), V(70), V(0), V(0), // KNIGHT attacks - V(0),V(30),V(50), V(0), V(70), V(70), V(0), V(0), // BISHOP attacks - V(0),V(20),V(40),V(40), V(0), V(50), V(0), V(0), // ROOK attacks - V(0),V(40),V(40),V(40), V(40), V(0), V(0), V(0), // QUEEN attacks - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // not used - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // not used - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) // not used + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used + { V(0),V(18), V(0),V(37), V(55), V(55), V(0), V(0) }, // KNIGHT attacks + { V(0),V(18),V(37), V(0), V(55), V(55), V(0), V(0) }, // BISHOP attacks + { V(0), V(9),V(27),V(27), V(0), V(37), V(0), V(0) }, // ROOK attacks + { V(0),V(27),V(27),V(27), V(27), V(0), V(0), V(0) }, // QUEEN attacks + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) } // not used }; const Value EndgameThreatBonus[8][8] = { - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // not used - V(0),V(40), V(0),V(50),V(100),V(100), V(0), V(0), // KNIGHT attacks - V(0),V(40),V(50), V(0),V(100),V(100), V(0), V(0), // BISHOP attacks - V(0),V(30),V(50),V(50), V(0), V(50), V(0), V(0), // ROOK attacks - V(0),V(40),V(40),V(40), V(40), V(0), V(0), V(0), // QUEEN attacks - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // not used - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0), // not used - V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) // not used + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used + { V(0),V(37), V(0),V(47), V(97), V(97), V(0), V(0) }, // KNIGHT attacks + { V(0),V(37),V(47), V(0), V(97), V(97), V(0), V(0) }, // BISHOP attacks + { V(0),V(27),V(47),V(47), V(0), V(47), V(0), V(0) }, // ROOK attacks + { V(0),V(37),V(37),V(37), V(37), V(0), V(0), V(0) }, // QUEEN attacks + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used + { V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) } // not used }; // ThreatedByPawnPenalty[] contains a penalty according to which piece // type is attacked by an enemy pawn. const Value MidgameThreatedByPawnPenalty[8] = { - V(0), V(0), V(50), V(50), V(70), V(80), V(0), V(0) + V(0), V(0), V(56), V(56), V(76), V(86), V(0), V(0) }; const Value EndgameThreatedByPawnPenalty[8] = { - V(0), V(0), V(70), V(70), V(100), V(120), V(0), V(0) + V(0), V(0), V(70), V(70), V(99), V(118), V(0), V(0) }; // InitKingDanger[] contains bonuses based on the position of the defending @@ -310,6 +310,9 @@ namespace { template void evaluate_king(const Position& pos, EvalInfo& ei); + template + void evaluate_threats(const Position& pos, EvalInfo& ei); + template void evaluate_space(const Position& pos, EvalInfo& ei); @@ -1168,8 +1171,8 @@ namespace { Square b8 = relative_square(us, (square_file(s) == FILE_A) ? SQ_B8 : SQ_G8); if ( pos.piece_on(b6) == piece_of_color_and_type(opposite_color(us), PAWN) - && pos.see(s, b6) < 0 - && pos.see(s, b8) < 0) + && pos.see(s, b6, false) < 0 + && pos.see(s, b8, false) < 0) { ei.mgValue -= Sign[us] * TrappedBishopA7H7Penalty; ei.egValue -= Sign[us] * TrappedBishopA7H7Penalty;