1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

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 https://github.com/official-stockfish/Stockfish/pull/2471

Bench: 5146339
This commit is contained in:
Vizvezdenec 2020-01-03 05:53:59 +03:00 committed by Stéphane Nicolet
parent 56d5504f65
commit de4e1cb88d

View file

@ -705,6 +705,9 @@ namespace {
int outflanking = distance<File>(pos.square<KING>(WHITE), pos.square<KING>(BLACK))
- distance<Rank>(pos.square<KING>(WHITE), pos.square<KING>(BLACK));
bool infiltration = rank_of(pos.square<KING>(WHITE)) > RANK_4
|| rank_of(pos.square<KING>(BLACK)) < RANK_5;
bool pawnsOnBothFlanks = (pos.pieces(PAWN) & QueenSide)
&& (pos.pieces(PAWN) & KingSide);
@ -716,10 +719,11 @@ namespace {
int complexity = 9 * pe->passed_count()
+ 11 * pos.count<PAWN>()
+ 9 * outflanking
+ 12 * infiltration
+ 21 * pawnsOnBothFlanks
+ 51 * !pos.non_pawn_material()
- 43 * almostUnwinnable
- 95 ;
- 100 ;
// Now apply the bonus: note that we find the attacking side by extracting the
// sign of the midgame or endgame values, and that we carefully cap the bonus