Answers.Body: <p>That would be a fun goal.</p>
  <p>Last year we have a discussion on &quot;Ideal Chess Engine for Kids (for Practice)&quot; in <a href="https://www.talkchess.com/forum3/viewtopic.php?f=2&amp;t=80825&amp;sid=6861bd7fbf9ca5fe57def95a3ff21318#p935942" rel="nofollow noreferrer">talkchess</a>.</p>
  <p>I tried to make some of its requirements in my engine CDrill. For testing, you can download this engine at <a href="https://sites.google.com/view/cdrill/download" rel="nofollow noreferrer">https://sites.google.com/view/cdrill/download</a>. There is sinful and decent option on this uci engine.</p>
  <p>I also launch this engine in lichess as <a href="https://lichess.org/@/cdroid" rel="nofollow noreferrer">CDroid</a> bot.</p>
  <p>This is its description.</p>
  <pre><code>Cdroid uses an alpha-beta algorithm without using neural net,
  programmed to play 90% suboptimal and 10% best moves. Out of
  the suboptimal moves, 80% are dubious, 15% are bad and 5% are
  blunder moves. As the king safety, mobility, pawn structure and
  threat evaluations get bad the engine error increases. Only plays
  bullet, blitz and rapid games against humans. Approximate rating
  is CCRL Blitz 900.
  </code></pre>
  <p>The algorithm is complicated but it is fun. I normally do a full search but in multipv mode. I query the evaluation on king safety, etc. if engine side is bad I will select bad moves meaning not the top 1 move from its search. There are some conditions of when to move the top 1, top 2, etc. move from multipv search.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-01T18:33:08.107Z
Answers.Text: Thanks for the answer! Has this engine been tested for humanlike play? By that I mean at what probability does it play the move that most humans (in the ELO range) played in the same position? I'll definitely give this a look.
Answers.UserDisplayName: pjq42
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-02T01:31:52.793Z
Answers.Text: Sometimes it will play like human sometimes not. But human is really unpredictable also specially at lower levels. Humans can play excellent and crap moves. That is why programming an engine to play like human is interesting. You can see the games played by CDroid in lichess. These games are my reference to improve it further to play like human. Currently I don't have test data to measure the engine's human-like moves.
Answers.UserDisplayName: ferdy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-02T01:56:52.667Z
Answers.Text: Test data means a collection of positions with candidate moves and some label what moves are human-like, percentage, etc. at a given rating range.. I have no time yet to generate this data from human games like lichess games.
Answers.UserDisplayName: ferdy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-09-01T09:43:20.740Z
Answers.LastActivityDate: 2023-09-01T09:43:20.740Z
Answers.UserDisplayName: ferdy
Answers.Body: <p>The best way to make a engine to make human moves is if you program it to have a small depth (5-6 sounds good)for middlegame and big depth for endgame(10-12) That way you will give your engine a rating of about 2900.But humans are also able to recognize patterns(open files,critical squares etc) and evaluate some positions better than they actually are(space advantage,opponent's counterplay is limited and requires you to brute analyze positions for many minutes to find it,opponent must find unique moves to survive in a position).</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-31T19:08:06.713Z
Answers.Text: I assume many top GMs(like Carlsen , Caruana, So , Liren or Nepo)could beat such a engine in a match.
Answers.UserDisplayName: Cerise
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-08-31T19:01:44.683Z
Answers.LastActivityDate: 2023-08-31T19:01:44.683Z
Answers.UserDisplayName: Cerise
Answers.Body: <p>I've got a quick idea here, so it might be complete garbage.
  What if we blend the traced evaluation with a static evaluation in shallower levels?
  Instead of only using the static evaluation score from the deepest node, we could also try including another static evaluation at depth 3 or 4. This could make the engine act more &quot;greedy&quot; and make moves that are only good in the short term. For example this triggers that the engine will attack the enemy more often, even though the move is worse. I belive this trait, is quite human so it could work.</p>
  <p>Here is an example (Start at 4th node):<a href="https://i.sstatic.net/tj3fJ.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tj3fJ.png" alt="" /></a></p>
  <p>Note: Dont change the score at the deepest node if its mate score as this will give wrong checkmate depths (Eninge will still see Checkmates -&gt; so wont blunder checkmate), also keep in mind other edge cases like transposition table.</p>
  <p>Further ideas:</p>
  <ol>
  <li>Instead of doing this process at 4 ply, one could do it with a random probabilty at 3, 4 or 5 ply.</li>
  <li>Try diffrent functions than the mean-function between both evaluations but again random probabilties</li>
  <li>Finetuning the probabilties to get good results (In this example taking the mean seems a bit extreme, also the probabilty for doing this at a 4th node should also be quite low, to prevent the engine to just evaluate like with less ply).</li>
  </ol>
  <p>I will test this out in my engine and share my results. However im quite busy so it may take a while. If anyone is testing this out, please share youre results.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-14T11:05:02.173Z
Answers.Text: Nice idea, will try that.
Answers.UserDisplayName: ferdy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-13T18:30:42.347Z
Answers.LastActivityDate: 2023-11-13T18:30:42.347Z
Answers.UserDisplayName: Sheyteo
Body: <p>I am currently trying to make a chess engine that tries to make the most human moves instead of the best ones.</p>
  <p>Now, I am aware of Maia Chess, which I believe is a neural network chess engine that attempts to emulate human-like play. However, I am more interested in chess engines that do not apply machine learning at all, (such as Stockfish with NNUE off). There are some reasons as to why I want to do this, but it's mainly curiosity, I suppose.</p>
  <p>Basically, I want to code a static evaluation function that tries to evaluate the most human move using certain heuristics that are useful to predict human-like behavior and especially human error. I couldn't find any research that resembled this topic.</p>
  <p>I already have an idea to use the complexity of a chess position (calculated in page 4 of <a href="https://en.chessbase.com/news/2006/world_champions2006.pdf" rel="nofollow noreferrer">research paper</a>) to predict the likelihood of a mistake (the more complex the position, the likelier a mistake will occur), but it wouldn't be able to obtain exactly <em>what</em> blunder is played.</p>
  <p><strong>Basically, what heuristics would be helpful in determining the most human move in a position?</strong></p>
  
Tags: <engines><programming><computer-chess>
Title: Humanlike chess engine that isn't a neural network
ThreadText: # Humanlike chess engine that isn't a neural network
  
  (Asked by: username_0 on 2023-08-31)
  
  I am currently trying to make a chess engine that tries to make the most human moves instead of the best ones.
  
  Now, I am aware of Maia Chess, which I believe is a neural network chess engine that attempts to emulate human-like play. However, I am more interested in chess engines that do not apply machine learning at all, (such as Stockfish with NNUE off). There are some reasons as to why I want to do this, but it's mainly curiosity, I suppose.
  
  Basically, I want to code a static evaluation function that tries to evaluate the most human move using certain heuristics that are useful to predict human-like behavior and especially human error. I couldn't find any research that resembled this topic.
  
  I already have an idea to use the complexity of a chess position (calculated in page 4 of [research paper](https://en.chessbase.com/news/2006/world_champions2006.pdf)) to predict the likelihood of a mistake (the more complex the position, the likelier a mistake will occur), but it wouldn't be able to obtain exactly *what* blunder is played.
  
  **Basically, what heuristics would be helpful in determining the most human move in a position?**
  
  **Tags:** engines, programming, computer-chess
  
  
  ---
  
  ## 3 answers
  
  ### Answer by username_1 on 2023-09-01. Score: 3
  
  That would be a fun goal.
  Last year we have a discussion on "Ideal Chess Engine for Kids (for Practice)" in talkchess.
  I tried to make some of its requirements in my engine CDrill. For testing, you can download this engine at https://sites.google.com/view/cdrill/download. There is sinful and decent option on this uci engine.
  I also launch this engine in lichess as CDroid bot.
  This is its description.
  Cdroid uses an alpha-beta algorithm without using neural net,
  programmed to play 90% suboptimal and 10% best moves. Out of
  the suboptimal moves, 80% are dubious, 15% are bad and 5% are
  blunder moves. As the king safety, mobility, pawn structure and
  threat evaluations get bad the engine error increases. Only plays
  bullet, blitz and rapid games against humans. Approximate rating
  is CCRL Blitz 900.
  
  The algorithm is complicated but it is fun. I normally do a full search but in multipv mode. I query the evaluation on king safety, etc. if engine side is bad I will select bad moves meaning not the top 1 move from its search. There are some conditions of when to move the top 1, top 2, etc. move from multipv search.
  
  > **Comments:**
  > **username_0**: Thanks for the answer! Has this engine been tested for humanlike play? By that I mean at what probability does it play the move that most humans (in the ELO range) played in the same position? I'll definitely give this a look.  
  > **username_1**: Sometimes it will play like human sometimes not. But human is really unpredictable also specially at lower levels. Humans can play excellent and crap moves. That is why programming an engine to play like human is interesting. You can see the games played by CDroid in lichess. These games are my reference to improve it further to play like human. Currently I don't have test data to measure the engine's human-like moves.  
  > **username_1**: Test data means a collection of positions with candidate moves and some label what moves are human-like, percentage, etc. at a given rating range.. I have no time yet to generate this data from human games like lichess games.  
  
  ---
  
  ### Answer by username_2 on 2023-08-31. Score: 2
  
  The best way to make a engine to make human moves is if you program it to have a small depth (5-6 sounds good)for middlegame and big depth for endgame(10-12) That way you will give your engine a rating of about 2900.But humans are also able to recognize patterns(open files,critical squares etc) and evaluate some positions better than they actually are(space advantage,opponent's counterplay is limited and requires you to brute analyze positions for many minutes to find it,opponent must find unique moves to survive in a position).
  
  > **Comments:**
  > **username_2**: I assume many top GMs(like Carlsen , Caruana, So , Liren or Nepo)could beat such a engine in a match.  
  
  ---
  
  ### Answer by username_3 on 2023-11-13. Score: 2
  
  I've got a quick idea here, so it might be complete garbage.
  What if we blend the traced evaluation with a static evaluation in shallower levels?
  Instead of only using the static evaluation score from the deepest node, we could also try including another static evaluation at depth 3 or 4. This could make the engine act more "greedy" and make moves that are only good in the short term. For example this triggers that the engine will attack the enemy more often, even though the move is worse. I belive this trait, is quite human so it could work.
  
  Here is an example (Start at 4th node):[![](https://i.sstatic.net/tj3fJ.png)](https://i.sstatic.net/tj3fJ.png)
  
  Note: Dont change the score at the deepest node if its mate score as this will give wrong checkmate depths (Eninge will still see Checkmates -> so wont blunder checkmate), also keep in mind other edge cases like transposition table.
  
  Further ideas:
  
  1. Instead of doing this process at 4 ply, one could do it with a random probabilty at 3, 4 or 5 ply.
  2. Try diffrent functions than the mean-function between both evaluations but again random probabilties
  3. Finetuning the probabilties to get good results (In this example taking the mean seems a bit extreme, also the probabilty for doing this at a 4th node should also be quite low, to prevent the engine to just evaluate like with less ply).
  
  I will test this out in my engine and share my results. However im quite busy so it may take a while. If anyone is testing this out, please share youre results.
  
  > **Comments:**
  > **username_1**: Nice idea, will try that.  
  
  ---
  
  