]> git.sesse.net Git - stockfish/commitdiff
Increase risk of blunders at low skill levels
authorMarco Costalba <mcostalba@gmail.com>
Tue, 19 Apr 2011 07:29:28 +0000 (09:29 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 20 Apr 2011 11:04:43 +0000 (12:04 +0100)
According to Heinz's tests current setup is in fact too
strong for weak players. This seems the best according
to his tests.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 516f2d051cc503f058d2f541a7d46ef9fcb8800e..20dbd23f796763c199f4e6d0fb027dd03254f00d 100644 (file)
@@ -596,7 +596,7 @@ namespace {
     SearchStack ss[PLY_MAX_PLUS_2];
     Value bestValues[PLY_MAX_PLUS_2];
     int bestMoveChanges[PLY_MAX_PLUS_2];
     SearchStack ss[PLY_MAX_PLUS_2];
     Value bestValues[PLY_MAX_PLUS_2];
     int bestMoveChanges[PLY_MAX_PLUS_2];
-    int depth, aspirationDelta, skillSamplingDepth;
+    int depth, aspirationDelta;
     Value value, alpha, beta;
     Move bestMove, easyMove, skillBest, skillPonder;
 
     Value value, alpha, beta;
     Move bestMove, easyMove, skillBest, skillPonder;
 
@@ -605,7 +605,7 @@ namespace {
     TT.new_search();
     H.clear();
     *ponderMove = bestMove = easyMove = skillBest = skillPonder = MOVE_NONE;
     TT.new_search();
     H.clear();
     *ponderMove = bestMove = easyMove = skillBest = skillPonder = MOVE_NONE;
-    depth = aspirationDelta = skillSamplingDepth = 0;
+    depth = aspirationDelta = 0;
     alpha = -VALUE_INFINITE, beta = VALUE_INFINITE;
     ss->currentMove = MOVE_NULL; // Hack to skip update_gains()
 
     alpha = -VALUE_INFINITE, beta = VALUE_INFINITE;
     ss->currentMove = MOVE_NULL; // Hack to skip update_gains()
 
@@ -622,11 +622,6 @@ namespace {
         return MOVE_NONE;
     }
 
         return MOVE_NONE;
     }
 
-    // Choose a random sampling depth according to SkillLevel so that at low
-    // skills there is an higher risk to pick up a blunder.
-    if (SkillLevelEnabled)
-        skillSamplingDepth = 4 + SkillLevel + (RK.rand<unsigned>() % 4);
-
     // Iterative deepening loop
     while (++depth <= PLY_MAX && (!MaxDepth || depth <= MaxDepth) && !StopRequest)
     {
     // Iterative deepening loop
     while (++depth <= PLY_MAX && (!MaxDepth || depth <= MaxDepth) && !StopRequest)
     {
@@ -690,7 +685,7 @@ namespace {
         bestMoveChanges[depth] = Rml.bestMoveChanges;
 
         // Do we need to pick now the best and the ponder moves ?
         bestMoveChanges[depth] = Rml.bestMoveChanges;
 
         // Do we need to pick now the best and the ponder moves ?
-        if (SkillLevelEnabled && depth == skillSamplingDepth)
+        if (SkillLevelEnabled && depth == 1 + SkillLevel)
             do_skill_level(&skillBest, &skillPonder);
 
         // Send PV line to GUI and to log file
             do_skill_level(&skillBest, &skillPonder);
 
         // Send PV line to GUI and to log file