2

I use the stockfish engine to generate the optimal moves in an simulated chess game. I use python-chess to integrate the Stockfish engine in my simulation. At the moment I set the depth of the search operation for the optimal move with chess.engine.Limit(depth=engine_depth)

Stockfish 11 is stated to have an approximated rating of about 3550. enter image description here

Of course the quality of the move depends on the search depth. In this paper (http://web.ist.utl.pt/diogo.ferreira/papers/ferreira13impact.pdf) they analyze the correlation between search depth and rating of the engine the essential result is basically:enter image description here Unfortunately that paper is from 2013 and no specific engine is named, but it can be assumed that results are nowadays a little higher. I also found this stack overflow article: Is the depth of a chess engine its strength? but most of the links there are dead.

I want to look deeper into how to achieve the optimal move. Because when using Stockfish 11 with depth 20 it can barely win against the computer of chess.com level 10 which is rumored to have a rating of around 2600. Most often Stockfish achieves a draw and can win sometimes with white.

This lets me to believe that just given Stockfish the search depth is not the best way. Aspects like search-tree pruning etc. could drastically improve the search results for the optimal move.

So has anybody experience with Stockfish and can guide me in the correct direction on how to optimize the search for the best possible move. Ideally, you could provide some code for python-chess with which I'm using right now.

sebko_iic
  • 340
  • 2
  • 16
  • search-tree pruning (alpha-beta pruning) would only help speed up the search, not make it play better moves. Stockfish probably already does optimizations such as pruning in the background. – Ahmet May 26 '20 at 18:16
  • Well maybe I could use pruning for speed advantage which then allows me to do deeper depth searches. But still I'm wondering the chess.com engine seems to be almost as good but also way faster so there has to be some optimization left to do – sebko_iic May 26 '20 at 19:05
  • 1
    Stockfish is one of the best chess engines ever created. If you really believe you can optimize it, go for it. It is open source: [github](https://github.com/official-stockfish/Stockfish) As far as I know chess.com also uses stockfish engine. This all depends on your hardware and code as well so it's hard to give you something definitive on why your local stockfish can't beat chess.com's stockfish. – Ahmet May 26 '20 at 19:49
  • It's not my goal to improve stockfish, but the way I use stockfish. Stockfish has so many options for searching for the best move. I basically want play around with these options to see what improves or worsens the move search Like I found out search depth gives you better moves. This one is kinda obvious now I want play around with the not so obvious options – sebko_iic May 27 '20 at 08:06

0 Answers0