Skip to content

Commit

Permalink
Simplify variant piece value adjustments
Browse files Browse the repository at this point in the history
No functional change.
  • Loading branch information
ianfab committed Mar 27, 2021
1 parent ec44c4f commit b908912
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/psqt.cpp
Expand Up @@ -171,16 +171,12 @@ void init(const Variant* v) {
eg_value(score) * 4700 / (3500 + mg_value(score)));
}

// For drop variants, halve the piece values
if (v->capturesToHand)
if (v->capturesToHand || v->twoBoards)
score = make_score(mg_value(score) * 7000 / (7000 + mg_value(score)),
eg_value(score) * 7000 / (7000 + eg_value(score)));
else if (!v->checking)
score = make_score(std::min(mg_value(score), Value(1800)) / 2,
std::min(eg_value(score), Value(1800)) * 3 / 5);
else if (v->twoBoards)
score = make_score(mg_value(score) * 7000 / (7000 + mg_value(score)),
eg_value(score) * 7000 / (7000 + eg_value(score)));
else if (v->blastOnCapture)
score = make_score(mg_value(score) * 7000 / (7000 + mg_value(score)), eg_value(score));
else if (v->checkCounting)
Expand All @@ -201,6 +197,7 @@ void init(const Variant* v) {
if (v->extinctionValue == VALUE_MATE)
score = -make_score(mg_value(score) / 8, eg_value(score) / 8 / (1 + !pi->sliderCapture.size()));

// For drop variants, halve the piece values to compensate for double changes by captures
if (v->capturesToHand)
score = score / 2;

Expand Down

0 comments on commit b908912

Please sign in to comment.