From 884677ac186917dbd73c03b89b66f89411e9a34a Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Tue, 1 Jan 2019 16:53:55 +0100 Subject: [PATCH] Use a generic PSQT for fairy pieces Give a bonus for squares closer to the center of the board. shogi LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 1068 W: 578 L: 462 D: 28 minishogi LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 1098 W: 577 L: 464 D: 57 courier LLR: 2.95 (-2.94,2.94) [0.00,10.00] Total: 396 W: 137 L: 65 D: 194 giveaway STC LLR: 2.96 (-2.94,2.94) [-10.00,5.00] Total: 2177 W: 863 L: 822 D: 492 http://35.161.250.236:6543/tests/view/5c2a44ad6e23db2472895687 extinction STC (failed) LLR: -2.96 (-2.94,2.94) [-10.00,5.00] Total: 1002 W: 436 L: 508 D: 58 http://35.161.250.236:6543/tests/view/5c2a44bf6e23db2472895689 shatranj STC (failed) LLR: -3.00 (-2.94,2.94) [-10.00,5.00] Total: 1891 W: 242 L: 289 D: 1360 --- src/psqt.cpp | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/src/psqt.cpp b/src/psqt.cpp index 1b7a17f..653bc08 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -140,7 +140,10 @@ void init(const Variant* v) { for (Square s = SQ_A1; s <= SQ_MAX; ++s) { File f = std::max(std::min(file_of(s), File(v->maxFile - file_of(s))), FILE_A); - psq[ pc][ s] = score + (pt == KING ? KingBonus[std::min(rank_of(s), RANK_8)][std::min(f, FILE_D)] : Bonus[pc][std::min(rank_of(s), RANK_8)][std::min(f, FILE_D)]); + Rank r = rank_of(s); + psq[ pc][ s] = score + ( pt == KING ? KingBonus[std::min(r, RANK_8)][std::min(f, FILE_D)] + : pt <= QUEEN ? Bonus[pc][std::min(r, RANK_8)][std::min(f, FILE_D)] + : make_score(5, 5) * (2 * f + std::max(std::min(r, Rank(v->maxRank - r)), RANK_1) - 8)); psq[~pc][~s] = -psq[pc][s]; } // pieces in pocket -- 1.7.0.4