Answers.Body: <p>Firstly, you <strong><em>must understand</em></strong> how an engine plays chess, because if you don't you'll never understand why it's hard. Without going into too much technical details, an engine doesn't think. Even the most powerful chess engine in the world don't know how to play chess, they examine hundreds and thousands of positions. For each position, the engine uses some heuristic to derive a static evaluation for each position. The engine uses a technique known as alpha-beta to derive the overall optimal evaluation.</p>
  
  <p>The key point to note that chess engine doesn't know how to play chess, it's simply a calculator. It doesn't know how to adjust itself from games, simply because it doesn't understand anything about chess.</p>
  
  <p>It's <strong>very easy</strong> to tune down an engine's strength, but making it to play truly like a human is awfully hard. A chess engine never blunders, never forgets anything, never panic because you launch a king-side attack, never biased towards particular opponents etc. The way computer makes a move is simply very different to how you make a move.</p>
  
  <p>I'll give you an example. Have you tried those weak playing levels in a chess app? Yes, you beat them easily, but that might be because they gave you a pawn for absolutely no reason and not under any pressure. Those engines were programmed to simulate blunders, but they couldn't simulate pressure, they just randomly blunder pawns and pieces. This is not a human play.</p>
  
  <p>Programmers have tried to optimize an engine based on machine learning but with little success.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-25T11:10:33.210Z
Answers.Text: https://chess-db.com/public/play/chess.jsp apparently they have this feature, albeit beta, that is claimed to simulate real players and not just GMs ' This functionallity is in early stage of development. It allows you to play chess against a computer that will closely simulate the play of the selected opponent: Opening repertoire, Elo rating, as well many additional properties of his/her playstyle. '
Answers.UserDisplayName: BCLC
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-15T00:23:56.917Z
Answers.LastActivityDate: 2014-10-15T00:23:56.917Z
Answers.UserDisplayName: SmallChess
Answers.Body: <p>This has been done by <a href="https://lichess.org/blog/X9PUixUAANCqFRSh/introducing-maia-a-human-like-neural-network-chess-engine" rel="nofollow noreferrer">Maia, a human-like neural network chess engine</a> that's been trained to play like a human would.</p>
  <blockquote>
  <p>Note that each Maia plays at a level above the rating range it was trained on, for an interesting reason: Maia’s goal is to make the average move that players at its target level would make. Playing Maia 1100, for example, is more like playing a committee of 1100-rated players than playing a single 1100-rated player—they tend to average out their idiosyncratic mistakes (but Maia still makes a lot of human-like blunders!).</p>
  </blockquote>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-19T23:55:22.450Z
Answers.LastActivityDate: 2021-09-19T23:55:22.450Z
Answers.UserDisplayName: MWB
Answers.Body: <p>I couldn't make one play like a human.  But it could play less than perfect. Have it select its move randomly from the top "n" moves, where lower value of "n" denote higher strength.  n=1 would mean the computer would play the best move every time.  An n of 2 would mean the machine would select randomly between the best 2 moves.</p>
  
  <p>There would have to be exceptions to allow the machine to make immediate recaptures, etc., so it doesn't simply drop pieces.</p>
  
  <p>I would venture that I, as a "B" player, could not beat Stockfish with n=10.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-14T23:53:34.863Z
Answers.LastActivityDate: 2014-10-14T23:53:34.863Z
Answers.UserDisplayName: Tony Ennis
Answers.Body: <p>Simulating realistic human play of a given level by computer is an open problem. My impression (being an interested layperson) is that it is a problem that is attracting some amount of attention constantly, but that the amount of engineering effort that has gone into trying to solve it is orders of magnitude lower than that spent on designing strong chess programs. Hence I would not feel confident in predicting that a satisfactory solution is necessarily very hard, but I would confidently say that a solution cannot be produced as an afterthought to designing a strong chess program.</p>
  <p>Both of the two main approaches to building a strong chess program (MCTS+neural networks for evaluation and search policy trained by reinforcement learning on the one hand, alpha-beta with various selective search heuristics and handcrafted evaluation functions on the other) do not try to simulate human chess cognition. There is therefore no expectation that these algorithms can be easily tweaked to produce human-like play.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-19T10:42:26.197Z
Answers.LastActivityDate: 2021-09-19T10:42:26.197Z
Answers.UserDisplayName: Polytropos
Answers.Body: <p>I am not really sure I understand your question: are you asking how to do this, or pushing your ideas for others to evaluate? In any case, let me try.</p>
  
  <p>First of all why do people say that computer can not play like a human. To support such claim there should be at least some studies which tells that a human can determine (with some accuracy) whether a game was played by the machine or not. (There was Kasparov accusing Deep Blue team that they used a human to help a machine, but no one proved anything). Something like a <a href="http://en.wikipedia.org/wiki/Turing_test" rel="nofollow">Turing test</a>. I have not heard about such studies and I highly doubt that an above average chess player can accurately predict whether the game is played against a computer. For example, can you determine who is a machine here (or may it is just two humans):</p>
  
  <pre><code>[fen ""]
  1. e4 e5 2. Nf3 Nc6 3. Nc3 f5 4. exf5 Bc5 5. Nxe5 Qe7 6. f4 Nf6 7. Bb5 Nd4 8. a4 a6 9. Be2 d6 10. Nc4 Bxf5 11. Ne3 O-O 12. Bc4+ Kh8 13. Ne2 Bxc2 14. Nxc2 Ng4 15. Ncxd4 Bxd4 16. Qb3 d5 17. Bxd5 Rae8 18. Bf3 Rxf4 19. Qxb7 Bc5 20. a5 Rff8 21. Qxa6 Qd7 22. h3 Ne5 23. Kd1 Nxf3 24. gxf3 Qd5 25. Kc2 Qxf3 26. Ng3 Qxg3 27. Rhf1 Qxh3 28. Rxf8+ Bxf8 29. Qb5 Re6 30. a6 Qh1 31. Ra4 Re1 32. Ra1 Re6 33. Ra4 Re1 34. Ra1 Re6 35. a7 Rc6+ 36. Kb3 Qf3+ 37. Ka2 Rc5 38. Qa4 Qd5+ 39. Kb1 Qh1 40. Ka2 Qd5+ 41. Kb1 Qh1 42. Ka2 Qd5+ 43. Kb1 1/2-1/2
  </code></pre>
  
  <p>Theoretically it is not hard to simulate game of a weaker opponent or an opponent with some preferences (we humans have preferences). In all artificial intelligence the move is determined based on a scoring function. So by modifying a scoring function you can achieve the game similar to what you want. For example if you want your machine to be more aggressive (attacking the opponent, sometimes even recklessly) you can modify it in such a way, that it will prefer lines where a lot of things can go wrong for the opponent. Even if with the best play you became a little bit worse.</p>
  
  <p>Because you can modify a scoring function in any possible way, you can resemble the preferences of some humans playing solid/drawish lines, attacking, preferring knights over bishops, two rooks over a queen. </p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-15T03:43:22.463Z
Answers.Text: I chose White because of the king position. I ran your game on Houdini, and saw that the fact that king on c2 was winning for White. Very dangerous apparently, but computer was fine. Also, Black had to force a draw, it meant Black was the inferior player - human. Sorry, I could only made the decision only after I ran analysis on it.
Answers.UserDisplayName: SmallChess
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-10-15T00:24:15.770Z
Answers.LastActivityDate: 2014-10-15T01:29:38.180Z
Answers.LastEditDate: 2014-10-15T01:29:38.180Z
Answers.UserDisplayName: Salvador Dali
Body: <p>Since computers have surpassed by now all humans, it should be very easy for it to emulate a strength of an weaker player. So the idea is:</p>
  <ul>
  <li><p>Supply a number of games</p>
  </li>
  <li><p>The computer ajusts its options (Rating, Cowardice, Pawn Structure play, etc) to the player</p>
  <p>EDIT:</p>
  </li>
  </ul>
  <p>For people who think the behavior of an engine cannot be changed to fit nearly a human:</p>
  <p><a href="http://wbec-ridderkerk.nl/html/UCIProtocol.html" rel="nofollow noreferrer">http://wbec-ridderkerk.nl/html/UCIProtocol.html</a></p>
  <p>You can set the options to be correct, but I was looking for an program to fit those options more or less.</p>
  <p>Also ChessMaster has multiple characters you can play against, and I think they have some well defined traits : Passive, values bishops, etc. I think it is possible to find those preferences if you put enough games.</p>
  
Tags: <engines><style>
Title: How to make a computer play like a player?
ThreadText: # How to make a computer play like a player?
  
  (Asked by: username_0 on 2014-10-14)
  
  Since computers have surpassed by now all humans, it should be very easy for it to emulate a strength of an weaker player. So the idea is:
  
  * Supply a number of games
  * The computer ajusts its options (Rating, Cowardice, Pawn Structure play, etc) to the player
  
    EDIT:
  
  For people who think the behavior of an engine cannot be changed to fit nearly a human:
  
  <http://wbec-ridderkerk.nl/html/UCIProtocol.html>
  
  You can set the options to be correct, but I was looking for an program to fit those options more or less.
  
  Also ChessMaster has multiple characters you can play against, and I think they have some well defined traits : Passive, values bishops, etc. I think it is possible to find those preferences if you put enough games.
  
  **Tags:** engines, style
  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_1 on 2014-10-15. Score: 14
  
  Firstly, you ***must understand*** how an engine plays chess, because if you don't you'll never understand why it's hard. Without going into too much technical details, an engine doesn't think. Even the most powerful chess engine in the world don't know how to play chess, they examine hundreds and thousands of positions. For each position, the engine uses some heuristic to derive a static evaluation for each position. The engine uses a technique known as alpha-beta to derive the overall optimal evaluation.
  
  The key point to note that chess engine doesn't know how to play chess, it's simply a calculator. It doesn't know how to adjust itself from games, simply because it doesn't understand anything about chess.
  
  It's **very easy** to tune down an engine's strength, but making it to play truly like a human is awfully hard. A chess engine never blunders, never forgets anything, never panic because you launch a king-side attack, never biased towards particular opponents etc. The way computer makes a move is simply very different to how you make a move.
  
  I'll give you an example. Have you tried those weak playing levels in a chess app? Yes, you beat them easily, but that might be because they gave you a pawn for absolutely no reason and not under any pressure. Those engines were programmed to simulate blunders, but they couldn't simulate pressure, they just randomly blunder pawns and pieces. This is not a human play.
  
  Programmers have tried to optimize an engine based on machine learning but with little success.
  
  > **Comments:**
  > **username_2**: https://chess-db.com/public/play/chess.jsp apparently they have this feature, albeit beta, that is claimed to simulate real players and not just GMs ' This functionallity is in early stage of development. It allows you to play chess against a computer that will closely simulate the play of the selected opponent: Opening repertoire, Elo rating, as well many additional properties of his/her playstyle. '  
  
  ---
  
  ### Answer by username_3 on 2021-09-19. Score: 4
  
  This has been done by [Maia, a human-like neural network chess engine](https://lichess.org/blog/X9PUixUAANCqFRSh/introducing-maia-a-human-like-neural-network-chess-engine) that's been trained to play like a human would.
  
  > Note that each Maia plays at a level above the rating range it was trained on, for an interesting reason: Maia’s goal is to make the average move that players at its target level would make. Playing Maia 1100, for example, is more like playing a committee of 1100-rated players than playing a single 1100-rated player—they tend to average out their idiosyncratic mistakes (but Maia still makes a lot of human-like blunders!).
  
  
  ---
  
  ### Answer by username_4 on 2014-10-14. Score: 2
  
  I couldn't make one play like a human. But it could play less than perfect. Have it select its move randomly from the top "n" moves, where lower value of "n" denote higher strength. n=1 would mean the computer would play the best move every time. An n of 2 would mean the machine would select randomly between the best 2 moves.
  
  There would have to be exceptions to allow the machine to make immediate recaptures, etc., so it doesn't simply drop pieces.
  
  I would venture that I, as a "B" player, could not beat Stockfish with n=10.
  
  
  ---
  
  ### Answer by username_5 on 2021-09-19. Score: 1
  
  Simulating realistic human play of a given level by computer is an open problem. My impression (being an interested layperson) is that it is a problem that is attracting some amount of attention constantly, but that the amount of engineering effort that has gone into trying to solve it is orders of magnitude lower than that spent on designing strong chess programs. Hence I would not feel confident in predicting that a satisfactory solution is necessarily very hard, but I would confidently say that a solution cannot be produced as an afterthought to designing a strong chess program.
  
  Both of the two main approaches to building a strong chess program (MCTS+neural networks for evaluation and search policy trained by reinforcement learning on the one hand, alpha-beta with various selective search heuristics and handcrafted evaluation functions on the other) do not try to simulate human chess cognition. There is therefore no expectation that these algorithms can be easily tweaked to produce human-like play.
  
  
  ---
  
  ### Answer by username_6 on 2014-10-15. Score: 0
  
  I am not really sure I understand your question: are you asking how to do this, or pushing your ideas for others to evaluate? In any case, let me try.
  First of all why do people say that computer can not play like a human. To support such claim there should be at least some studies which tells that a human can determine (with some accuracy) whether a game was played by the machine or not. (There was Kasparov accusing Deep Blue team that they used a human to help a machine, but no one proved anything). Something like a Turing test. I have not heard about such studies and I highly doubt that an above average chess player can accurately predict whether the game is played against a computer. For example, can you determine who is a machine here (or may it is just two humans):
  [fen ""]
  1. e4 e5 2. Nf3 Nc6 3. Nc3 f5 4. exf5 Bc5 5. Nxe5 Qe7 6. f4 Nf6 7. Bb5 Nd4 8. a4 a6 9. Be2 d6 10. Nc4 Bxf5 11. Ne3 O-O 12. Bc4+ Kh8 13. Ne2 Bxc2 14. Nxc2 Ng4 15. Ncxd4 Bxd4 16. Qb3 d5 17. Bxd5 Rae8 18. Bf3 Rxf4 19. Qxb7 Bc5 20. a5 Rff8 21. Qxa6 Qd7 22. h3 Ne5 23. Kd1 Nxf3 24. gxf3 Qd5 25. Kc2 Qxf3 26. Ng3 Qxg3 27. Rhf1 Qxh3 28. Rxf8+ Bxf8 29. Qb5 Re6 30. a6 Qh1 31. Ra4 Re1 32. Ra1 Re6 33. Ra4 Re1 34. Ra1 Re6 35. a7 Rc6+ 36. Kb3 Qf3+ 37. Ka2 Rc5 38. Qa4 Qd5+ 39. Kb1 Qh1 40. Ka2 Qd5+ 41. Kb1 Qh1 42. Ka2 Qd5+ 43. Kb1 1/2-1/2
  
  Theoretically it is not hard to simulate game of a weaker opponent or an opponent with some preferences (we humans have preferences). In all artificial intelligence the move is determined based on a scoring function. So by modifying a scoring function you can achieve the game similar to what you want. For example if you want your machine to be more aggressive (attacking the opponent, sometimes even recklessly) you can modify it in such a way, that it will prefer lines where a lot of things can go wrong for the opponent. Even if with the best play you became a little bit worse.
  Because you can modify a scoring function in any possible way, you can resemble the preferences of some humans playing solid/drawish lines, attacking, preferring knights over bishops, two rooks over a queen.
  
  > **Comments:**
  > **username_1**: I chose White because of the king position. I ran your game on Houdini, and saw that the fact that king on c2 was winning for White. Very dangerous apparently, but computer was fine. Also, Black had to force a draw, it meant Black was the inferior player - human. Sorry, I could only made the decision only after I ran analysis on it.  
  
  ---
  
  