Human-like Chess AI

Started by
10 comments, last by vvv2 9 years, 9 months ago

Does anyone know where I can read up on this? Or see some engine (source code or just play as an opponent) with at least somewhat human like play? Pro-Deo is the best I have seen thus far, but it's still pretty far from making human like decisions.
Also, does anyone have any ideas of their own on how to approach this? I think trying this might be a nice summer project. I already have a good idea of how 'normal' chess AIs play, but there is very little information (that I have seen anyway) on how to take a more human like approach.

Advertisement

I had some ideas on how I would approach it here

There are other good links there too.

They call me the Tutorial Doctor.

I read that thread when it happened, but I don't feel it contributes anything useful to what I'm asking. I'm aware of how a mini-max type algorithm can be written for chess and how to do basic compensations for certain structural things, but I'm not really sure how a more 'fun' (read: human-like) computer opponent can be made. Pretty much all chess programs now are tactically excellent machines that just grab material wherever they can where they don't see themselves losing to a checkmate or leaving themselves in a really horrible structure. This kind of super solid play makes them quite boring as opponents. =/ I was really looking for where can I start reading for how to make a computer deviate somewhat (or perhaps completely) from mini-max without resorting to adding in random blunders, which is also not fun. In fact, computers playing several very strong moves in a row then just giving away a knight is more than just not fun, it's weird.

This basically sums up how far I got and Google didn't yield anything interesting, so I thought someone here might know a little something, or of articles/links or maybe even tried this themselves and might be able to offer some kind of direction to aim in to get an interesting AI, otherwise, I will just be trying totally from scratch.

Not sure if it's of any help, but I remember a computer chess game, I *think* it was Fritz, that was offering 'fun' personalities. Some of those personalities were favoring using some pieces much more heavily than others (like knights or bishops) which is a behavior you can easily notice in human players of low/med level. Others would loose a very advantageous position just to kill the enemy queen, and so on. Of course sacrificing winning chances to capture a queen could also be called a blunder, but it's at least a very human one.

Apart from that, I think the main difficulty with your question is to define "human-like behavior". Min-Maxing is basically what humans do too, with more or less success depending on level of play, of course.

If you want to be scientific about it, you could take a database of games played by humans of the level that you want to imitate and try to build a probabilistic model that attempts to predict their moves. The measure of success of the model is relatively easy to define (maximize log-likelihood of the moves in the database given the model, which I think is the same thing as minimizing "cross-entropy"). You would then have to play around with what inputs to use for the model (minimax values at several depths and using a few different evaluation functions could be a good start) and how to combine them (I would start by assigning each move a score that is a linear combination of the inputs and then its probability is proportional to exp(score[move])).

You can find some ideas of how to weaken your engine to make it a more fun opponent at TalkChess.com. Here are a few examples:
http://talkchess.com/forum/viewtopic.php?t=33089
http://talkchess.com/forum/viewtopic.php?t=42880
http://talkchess.com/forum/viewtopic.php?t=45795
http://talkchess.com/forum/viewtopic.php?t=51973

Don't think of it in terms of "adding random blunders" and instead think of it in terms of "allowing sub-optimal moves". Humans are rarely perfectly rational or optimal. By including things such as weighted random selection (not random... weighted random that still biases towards the better moves) you allow for "reasonable" moves without always being purely optimal ones.

Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play

"Reducing the world to mathematical equations!"

Personally I think there are five big factors:

  • Biased board assessment, e.g. specific pieces are strong/weak.
  • Performance gets spottier the further down the tree you go, e.g. humans forget the board configuration after many steps or forget to explore a subtree.
  • Temporal continuity - e.g. sticks with a plan if the opponent doesn't seem to invalidate it.
  • If you think you know the purpose of an opponent move, you may neglect the later side-effects of the move.
  • Small random component.

Never throw the game, just calculate the odds slightly wrongly.

A lot of this posted stuff was really helpful (and pretty much exactly what kind of stuff I was looking for). Thanks! :)

i think evolving chess is more interesting for me, than trying to be human, which i think that everyone wouldn't succeed at, for the time being, but may be wrong.

i think evolving chess is more interesting for me, than trying to be human, which i think that everyone wouldn't succeed at, for the time being, but may be wrong.

I'm definitely interested in doing this kind of stuff too, but it just seems (to me) to be an awful lot harder(?) to get a decent chess AI through evolution type algorithm than to just mess around with a mini-max function to make it assess positions in a way that is less 'computerish'.

This topic is closed to new replies.

Advertisement