diff --git a/src/options.cpp b/src/options.cpp index 2f70ccc1..c831f3b2 100644 --- a/src/options.cpp +++ b/src/options.cpp @@ -36,6 +36,7 @@ Options::Options() { ABPassStart = 5; ABPassMargin = 500; MoveTimeMult = 100; + UseEndgame = true; EvalMaterial = 100; EvalPawnStruct = 100; diff --git a/src/options.hpp b/src/options.hpp index 44aa225f..3d2d85b7 100644 --- a/src/options.hpp +++ b/src/options.hpp @@ -37,6 +37,7 @@ UseHashTable: type=check, default=false, whether the engine should use hash tabl ABPassStart: type=spin, default=5, min=1, max=100, start depth where alpha and beta values are passed to next iteration. ABPassMargin: type=spin, default=500, min=0, max=10000, add/sub offset of alpha and beta. MoveTimeMult: type=spin, default=100, min=10, max=1000, multiplier (percent) of move time. +UseEndgame: type=check, default=true, whether to use endgame algorithms. EvalMaterial: type=spin, default=100, min=0, max=1000, weight (percent) of material eval. EvalPawnStruct: type=spin, default=100, min=0, max=1000, weight (percent) of pawn structure eval. @@ -62,6 +63,7 @@ Chat: type=check, default=true, whether the engine should chat with you. int ABPassStart; int ABPassMargin; int MoveTimeMult; + bool UseEndgame; int EvalMaterial; int EvalPawnStruct; diff --git a/src/search.cpp b/src/search.cpp index f182536a..c8947238 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -166,7 +166,7 @@ namespace Search { SearchInfo search(const Options& options, const Position& pos, const int& depth, const double& movetime, bool& searching) { const int eg = Endgame::eg_type(pos); - if (eg != 0) { + if (options.UseEndgame && eg != 0) { const vector moves = Bitboard::legal_moves(pos, Bitboard::attacked(pos, !pos.turn)); const Move best_move = Endgame::bestmove(pos, moves, eg); return SearchInfo(1, 1, false, pos.turn ? MAX : MIN, moves.size(), 0, 0, {best_move}, 0, 0, true); diff --git a/src/uci.cpp b/src/uci.cpp index b16f3a2b..875bbf31 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -200,6 +200,7 @@ int loop() { cout << "option name ABPassStart type spin default 5 min 1 max 100" << "\n"; cout << "option name ABPassMargin type spin default 500 min 0 max 10000" << "\n"; cout << "option name MoveTimeMult type spin default 100 min 10 max 1000" << "\n"; + cout << "option name UseEndgame type check default true" << "\n"; cout << "option name EvalMaterial type spin default 100 min 0 max 1000" << "\n"; cout << "option name EvalPawnStruct type spin default 100 min 0 max 1000" << "\n"; @@ -226,6 +227,7 @@ int loop() { else if (name == "ABPassStart") options.ABPassStart = std::stoi(value); else if (name == "ABPassMargin") options.ABPassMargin = std::stoi(value); else if (name == "MoveTimeMult") options.MoveTimeMult = std::stoi(value); + else if (name == "UseEndgame") options.UseEndgame = (value == "true"); else if (name == "EvalMaterial") options.EvalMaterial = std::stoi(value); else if (name == "EvalPawnStruct") options.EvalPawnStruct = std::stoi(value);