ddugovic / Stockfish

Retired multi-variant fork of popular UCI chess engine; please use Fairy-Stockfish instead
https://github.com/ianfab/Fairy-Stockfish
GNU General Public License v3.0
132 stars 44 forks source link

Extending Skill to 0...40 instead to -20...20 #589

Closed tillchess closed 3 years ago

tillchess commented 3 years ago

I would avoid negative skill levels and just extend the skill level to 0...40 instead to -20...20

Changes need for Skill 0...40 an still having UCI_Elo 0....3000


In search.cpp

Line 203: // Skill structure is used to implement strength limit

 struct Skill {
   explicit Skill(int l) : level(l) {}
   bool enabled() const { return level < 40; }
   bool time_to_pick(Depth depth) const { return depth == 1 + level; }
   Move pick_best(size_t multiPV);

   int level;
   Move best = MOVE_NONE;
 };

Line 453: 

 double floatLevel = Options["UCI_LimitStrength"] ?
                      std::clamp((Options["UCI_Elo"] - 1500.0) / 37.5, 0.0, 40.0) :
                        double(Options["Skill Level"]);

Line 2100 : int weakness = 120 - level;

In UCIOption.cpp;

Line 71:  o["Skill Level"]           << Option(40, 0, 40);
ddugovic commented 3 years ago

I recommend use of https://github.com/ianfab/Fairy-Stockfish as I am not accepting new issues at this time. Sorry.