Tweak Janggi piece values
authorFabian Fichter <ianfab@users.noreply.github.com>
Sat, 11 Apr 2020 13:41:25 +0000 (15:41 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Sat, 11 Apr 2020 15:26:02 +0000 (17:26 +0200)
janggi
LLR: 3.02 (-2.94,2.94) [-10.00,5.00]
Total: 1192 W: 563 L: 508 D: 121

xiangqi
LLR: 3.06 (-2.94,2.94) [-10.00,5.00]
Total: 1532 W: 471 L: 430 D: 631

src/evaluate.cpp
src/psqt.cpp
src/types.h

index b59de40..8b7f065 100644 (file)
@@ -303,9 +303,6 @@ namespace {
         // Restrict mobility to actual squares of board
         b &= pos.board_bb();
 
-        if (Pt == SOLDIER && pos.unpromoted_soldier(Us, s))
-            score -= make_score(PieceValue[MG][Pt], PieceValue[EG][Pt]) / 3;
-
         if (pos.blockers_for_king(Us) & s)
             b &= LineBB[pos.square<KING>(Us)][s];
 
index b805247..2a63604 100644 (file)
@@ -194,6 +194,8 @@ void init(const Variant* v) {
                                   : 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));
+          if (pt == SOLDIER && r < v->soldierPromotionRank)
+              psq[pc][s] -= score * (v->soldierPromotionRank - r) / (4 + f);
           psq[~pc][rank_of(s) <= v->maxRank ? relative_square(BLACK, s, v->maxRank) : s] = -psq[pc][s];
       }
       // pieces in pocket
index ffc79b9..887c927 100644 (file)
@@ -339,12 +339,12 @@ enum Value : int {
   ImmobilePieceValueMg     = 100,   ImmobilePieceValueEg     = 100,
   CannonPieceValueMg       = 800,   CannonPieceValueEg       = 700,
   JanggiCannonPieceValueMg = 800,   JanggiCannonPieceValueEg = 600,
-  SoldierValueMg           = 150,   SoldierValueEg           = 300,
+  SoldierValueMg           = 200,   SoldierValueEg           = 270,
   HorseValueMg             = 500,   HorseValueEg             = 800,
   ElephantValueMg          = 300,   ElephantValueEg          = 300,
-  JanggiElephantValueMg    = 350,   JanggiElephantValueEg    = 350,
+  JanggiElephantValueMg    = 340,   JanggiElephantValueEg    = 350,
   BannerValueMg            = 3400,  BannerValueEg            = 3500,
-  WazirValueMg             = 400,   WazirValueEg             = 400,
+  WazirValueMg             = 400,   WazirValueEg             = 350,
   CommonerValueMg          = 700,   CommonerValueEg          = 900,
   CentaurValueMg           = 1600,  CentaurValueEg           = 1700,