1

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) 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?

3 Answers 3

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.

3
  • 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.
    – pjq42
    Sep 1, 2023 at 18:33
  • 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.
    – ferdy
    Sep 2, 2023 at 1:31
  • 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.
    – ferdy
    Sep 2, 2023 at 1:56
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).

1
  • I assume many top GMs(like Carlsen , Caruana, So , Liren or Nepo)could beat such a engine in a match.
    – Cerise
    Aug 31, 2023 at 19:08
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):

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.

1
  • Nice idea, will try that.
    – ferdy
    Nov 14, 2023 at 11:05

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .