]> git.sesse.net Git - stockfish/commitdiff
Fine tune skill level
authorMarco Costalba <mcostalba@gmail.com>
Sun, 27 Mar 2011 17:54:02 +0000 (18:54 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 28 Mar 2011 12:09:13 +0000 (13:09 +0100)
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 <mcostalba@gmail.com>
src/search.cpp
src/ucioption.cpp

index a2424ddc3ddb05886dee4af9a8c06c64972dddc6..9a62fb793290e5cd49b241653645f532ed8f778c 100644 (file)
@@ -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--)
index cd7dc7396fe7b3edef283b509bc75ab1d5d2b7c1..c0c1e281e8af92e4c2016dae724761150703b4cf 100644 (file)
@@ -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);