- when ahead exchange pieces
- when below exchange pawns
In Minic, I try to reproduce that using this kind of stuff
Code: Select all
score.scoresEG[EvalScore::sc_Exchange] -= ScoreType(EvalConfig::tradeDownPiece * (matScoreW - matScoreB)/100.f * std::min(matPieceScoreW,matPieceScoreB)/100.f);
score.scoresEG[EvalScore::sc_Exchange] += ScoreType(EvalConfig::tradeDownPawn * (matScoreW - matScoreB)/100.f * std::min(matPawnScoreW ,matPawnScoreB )/100.f);
matPieceScore being material score from piece only
matPawnScore being material score from pawn only
Do you agree with this ?
The idea is, the more material difference there is (matScoreW - matScoreB), the more player want to exchange.
Maybe I shall add a margin like if (abs(matScoreW - matScoreB) > margin )?