1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

Simplify connected pawn scoring

When scoring the connected pawns, replace the intricate ternary expressions
choosing the coefficient by a simpler addition of boolean conditions:

` value = Connected * (2 + phalanx - opposed) `

This is the map showing the old coefficients and the new ones:

```
phalanx and unopposed:     3x   -> 3x
phalanx and opposed:       1.5x -> 2x
not phalanx and unopposed: 2x   -> 2x
not phalanx and opposed:   1x   -> 1x
```

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 11354 W: 2579 L: 2437 D: 6338
http://tests.stockfishchess.org/tests/view/5d8151f00ebc5971531d244f

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 41221 W: 7001 L: 6913 D: 27307
http://tests.stockfishchess.org/tests/view/5d818f930ebc5971531d26d6

Bench: 3959889

blah
This commit is contained in:
protonspring 2019-09-22 19:48:52 -06:00 committed by Stéphane Nicolet
parent 64af5434ed
commit 7e4c3256aa
2 changed files with 2 additions and 2 deletions

View file

@ -353,7 +353,7 @@ namespace {
// Bonus for rook on an open or semi-open file
if (pos.is_on_semiopen_file(Us, s))
score += RookOnFile[bool(pos.is_on_semiopen_file(Them, s))];
score += RookOnFile[pos.is_on_semiopen_file(Them, s)];
// Penalty when trapped by the king, even more if the king cannot castle
else if (mob <= 3)

View file

@ -130,7 +130,7 @@ namespace {
// Score this pawn
if (support | phalanx)
{
int v = Connected[r] * (phalanx ? 3 : 2) / (opposed ? 2 : 1)
int v = Connected[r] * (2 + bool(phalanx) - opposed)
+ 17 * popcount(support);
score += make_score(v, v * (r - 2) / 4);