Use mobility in kingsafety (#1360)

Use mobility in kingsafety

STC: http://tests.stockfishchess.org/tests/view/5a55134d0ebc590296938a28
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 32651 W: 6057 L: 5792 D: 20802

LTC: http://tests.stockfishchess.org/tests/view/5a5618f40ebc590297da516f
LLR: 2.94 (-2.94,2.94) [0.00,5.00]
Total: 17875 W: 2421 L: 2245 D: 13209

bench: 5365777
This commit is contained in:
mbootsector
2018-01-13 08:56:42 +01:00
committed by Marco Costalba
parent 66ce8ad5fd
commit 33682bfb98

View File

@@ -486,10 +486,14 @@ namespace {
- 9 * mg_value(score) / 8 - 9 * mg_value(score) / 8
+ 40; + 40;
// Transform the kingDanger units into a Score, and substract it from the evaluation // Transform the kingDanger units into a Score, and substract it from the evaluation.
if (kingDanger > 0) if (kingDanger > 0)
{
int mobilityDanger = mg_value(mobility[Them] - mobility[Us]);
kingDanger = std::max(0, kingDanger + mobilityDanger);
score -= make_score(kingDanger * kingDanger / 4096, kingDanger / 16); score -= make_score(kingDanger * kingDanger / 4096, kingDanger / 16);
} }
}
// King tropism: firstly, find squares that opponent attacks in our king flank // King tropism: firstly, find squares that opponent attacks in our king flank
File kf = file_of(ksq); File kf = file_of(ksq);