Skip to content

Commit de4e1cb

Browse files
Vizvezdenecsnicolet
authored andcommitted
Introduce king infiltration bonus
Add king infiltration bonus to initiative calculation. Idea is somewhat similar to outflanking - endgames are hard to win if each king is on it side of the board. So this adds extra bonus for one of kings crossing the middle line. STC LLR: 2.94 (-2.94,2.94) {-1.00,3.00} Total: 10533 W: 2372 L: 2242 D: 5919 Ptnml(0-2): 196, 1198, 2352, 1316, 202 http://tests.stockfishchess.org/tests/view/5e0e6fd1e97ea42ea89da9b3 LTC LLR: 2.96 (-2.94,2.94) {0.00,2.00} Total: 15074 W: 2563 L: 2381 D: 10130 Ptnml(0-2): 118, 1500, 4111, 1663, 129 http://tests.stockfishchess.org/tests/view/5e0e857ae97ea42ea89da9cc Closes #2471 Bench: 5146339
1 parent 56d5504 commit de4e1cb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/evaluate.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ namespace {
705705
int outflanking = distance<File>(pos.square<KING>(WHITE), pos.square<KING>(BLACK))
706706
- distance<Rank>(pos.square<KING>(WHITE), pos.square<KING>(BLACK));
707707

708+
bool infiltration = rank_of(pos.square<KING>(WHITE)) > RANK_4
709+
|| rank_of(pos.square<KING>(BLACK)) < RANK_5;
710+
708711
bool pawnsOnBothFlanks = (pos.pieces(PAWN) & QueenSide)
709712
&& (pos.pieces(PAWN) & KingSide);
710713

@@ -716,10 +719,11 @@ namespace {
716719
int complexity = 9 * pe->passed_count()
717720
+ 11 * pos.count<PAWN>()
718721
+ 9 * outflanking
722+
+ 12 * infiltration
719723
+ 21 * pawnsOnBothFlanks
720724
+ 51 * !pos.non_pawn_material()
721725
- 43 * almostUnwinnable
722-
- 95 ;
726+
- 100 ;
723727

724728
// Now apply the bonus: note that we find the attacking side by extracting the
725729
// sign of the midgame or endgame values, and that we carefully cap the bonus

0 commit comments

Comments
 (0)