From: Marco Costalba Date: Sun, 27 Mar 2011 17:54:02 +0000 (+0100) Subject: Fine tune skill level X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=d173285da5d7683083d853ca8fba5672376f5aba;hp=41fe70d7031993d1802659d01dd0710477bffcab Fine tune skill level Rescaled Skill level from 0 to 20. At level 19 is still comparable with Crafty 20.14, while at low levels strength increase is now less steep. Thanks to Joona and Heinz for testing and valuable comments. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index a2424ddc..9a62fb79 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -515,7 +515,7 @@ bool think(Position& pos, bool infinite, bool ponder, int time[], int increment[ // Do we have to play with skill handicap? In this case enable MultiPV that // we will use behind the scenes to retrieve a set of possible moves. - MultiPV = (SkillLevel < 10 ? Max(UCIMultiPV, 4) : UCIMultiPV); + MultiPV = (SkillLevel < 20 ? Max(UCIMultiPV, 4) : UCIMultiPV); // Set the number of active threads ThreadsMgr.read_uci_options(); @@ -756,9 +756,9 @@ namespace { } } - // When playing with strength handicap choose best move among the MultiPV - // set using a statistical rule dependent on SkillLevel. - if (SkillLevel < 10) + // When playing with strength handicap choose best move among the MultiPV set + // using a statistical rule dependent on SkillLevel. Idea by Heinz van Saanen. + if (SkillLevel < 20) { assert(MultiPV > 1); @@ -768,7 +768,7 @@ namespace { int size = Min(MultiPV, (int)Rml.size()); int max = Rml[0].pv_score; int var = Min(max - Rml[size - 1].pv_score, PawnValueMidgame); - int wk = 128 - 8 * SkillLevel; + int wk = 120 - 2 * SkillLevel; // PRNG sequence should be non deterministic for (int i = abs(get_system_time() % 50); i > 0; i--) diff --git a/src/ucioption.cpp b/src/ucioption.cpp index cd7dc739..c0c1e281 100644 --- a/src/ucioption.cpp +++ b/src/ucioption.cpp @@ -98,7 +98,7 @@ void init_uci_options() { Options["Ponder"] = Option(true); Options["OwnBook"] = Option(true); Options["MultiPV"] = Option(1, 1, 500); - Options["Skill level"] = Option(10, 0, 10); + Options["Skill level"] = Option(20, 0, 20); Options["Emergency Move Horizon"] = Option(40, 0, 50); Options["Emergency Base Time"] = Option(200, 0, 30000); Options["Emergency Move Time"] = Option(70, 0, 5000);