It took a long time to develop a computer program that could play a decent game of chess. As I understand it, the best programs still can’t consistently beat the best humans. But they can beat me.
In fact, I have been playing almost exclusively against the computer and I’ve started to wonder, how does one program a computer to play poorly?
More exactly, assuming ahead of time that a program can beat a given player, how does one make the program lose? (Or at least play badly.)
I have a son that I play chess with and sometimes I will make moves that disregard potent moves on his side. Do any chess programs do this at low levels? Do some programs actually use demonstrative losses?
I had a simplistic chess program at one point that had no specific “difficulty” level to change. Rather, you simply limited the amount of time that the computer was allowed to use to consider its possible moves and make a choice. By rushing the computer’s thought process, you can negate the advantage it has in ability to consider the long-term future and thousands of different options and so bring it down to your own level.
But the general approach is to evaluate all options x moves down the road to see which is estimated to be most likely to lead to a win.
Cripple this, either by not looking x moves down, or drop every y-th node at each level of consideration, and you would be effectively pruning the choice evaluatiot tree, and hence reducing the probabliity of choosing a winning move.
Another would be to change the evaluation heuristic.
Another would be to simply chose the z’th best move instead of the 1st best move.
You could also change the random weighting. At any given moment in a game, a computer program will have some particular move that it considers “best”. But it can’t always make that move, since if it did so, then if you ever once figured out how to beat it, you could then just always play that same game again. So it has to have some criterion by which it usually takes what it thinks is the best move, but sometimes takes a move that doesn’t appear to be the best. By changing that criterion, you could make the program take “bad” moves more often, which would weaken its play.
I had always assumed that in order to make a computer easier to beat, its programming was limited in terms of how far ahead it could project the consequences of its moves.
I mainly based that on the fact that the only surefire way I knew I was getting better as a young’un was being able to plan an attack 20 moves ahead instead of 2.
Thanks for all the info, I think. I find it dispiriting to think that it might not be long before e4 is a tablebase ending!
I set the program I use (Chess Titans on Vista) to level one, it’s lowest level. (Very easy to beat.) I’m pretty sure that it was playing the same moves in the same situations (d4 for every opening …) and sometimes it would make "off " moves. As I turned the level up, it seemed to simply get more aggressive, but it’s attacks were easily defended.
So in lower levels the off move might be Rb1… Turn it up and the “off” move becomes Ra7 where Ra8 would have put me in check. Turn it up again and the attack becomes B x h7+ (Black King on g8 behind a row of pawns) where the K can take and the R attack on a8 vanishes.
I’m not very consistent at chess (I generally play several games a day on level 4 knowing that I can win and that if I’m losing or my attacks are drying up it is because I’m not playing well) so it’s hard for me to say from a game view how the computer is playing down.
However, I have read a lot about how computers play chess and the idea that the algorithm just doesn’t look as deep makes sense. Most of the time I look for a Q sacrifice to end the game because the computer will always go for it. It evaluates the next ply as very beneficial because I lose my Q but it doesn’t look ahead to the next two plys where white’s moves are forced and I get mate.
I’ve been spending a lot of time trying to learn to play by knowing (and hopefully forcing) my opponents moves rather than trying to make good moves for myself. My presumption is that planning attacks 20 moves in advance requires knowing what the best move is for the opponent and assuming your opponent is going to make perfect moves.
Part of the reason I started the thread is that I’m wondering if I’m hamstringing myself because the computer isn’t playing perfectly… on purpose.
I think if the computer simply limits its computing time, it will still be difficult to beat because it will never make a simple tactical mistake, and it will never let the opponent get away with one. I think something else must be done in order to make it beatable by beginners, unless you dumb it down until it’s only looking 1 or 2 moves ahead and almost really making random moves.
I was a decent player in my high-school club, but I’ve never beat a computer, just using generic chess programs on the easiest settings. I’ve drawn once or twice.
Page 2 covers a chess example. Of particular interest is that this article is oriented toward doing a better job at dumbing down the AI than just limiting the computation time or move depth. The described system actually works harder at being dumb (by looking ahead and setting up opportunities for the player to exploit). This minimizes the problem that riker1384 raised where a minimal lookahead results in near random moves.
Limit the depth of the search. A computer can look, say, 3 moves deep and evaluate all the positions, trimming off bad ones. Then it’ll move on to the 4th move, etc. If a move is really really closely evaluated with a second move, then the computer will spend more time to break the tie. By changing how deep and how long the computer thinks, difficulty changes.
Changing the evaluation criteria. The computer counts material in a certain way, gives value to king exposure, board control, open lines, etc. Different difficulties prize these things in different ways.
Using these methods, not only can you get different levels, you can make different personalities. If you want a quick, sharp attacker, you can set it to favor open lines and king safety over material. If you want a character that favors knights over bishops, set the value of the bishop to, say, 3.3 and a knight to 3. Lastly, book knowledge of openings and endings can be editted, along with how long it’s allowed to look in those books.
I once played a (real) guy that had a stroke a few years ago. He’d played chess for a really long time but couldn’t calculate well anymore. You could just take his hanging queen and win, but you had to survive his amazingly vast book knowledge first. It felt like a computer was playing me.
If you’ve ever beaten a human being, you could beat Chess Titans on a low setting. As I mentioned, I play against it every day to strengthen my tactical play. Against a person you might “get away” with a weak position that leads to a stronger one, but you’re right, the computer won’t miss a hanging piece. However, on a low setting I have seen the computer make an off move and move to, say, e4 when it could have taken a hanging piece on e5.
There is also a chess tutorial for kids that I’ve gotten from the library called Learning Chess with Fritz and Chesster. It is definitely aimed at kids and I used to play against it at the lowest level and try to beat it in less than five minutes.
Thanks for that! I have been wondering if I am missing oppourtunities that the computer makes available favoring my own “strategy” instead.
The kids tutorial I mentioned (and that I would recommend for kids or beginners who can overlook the “kiddie” aspect) definitely had personalities. I think CT works that way too since the last time I increased the level I noticed it became more aggressive, but the attacks were more “desperate.”
Indeed. There was a computer-human game recently (last summer?) where the human international master overlooked a mate-in-one situation, because it was a very peculiar sort of situation that didn’t fit into any of the sorts of threatening patterns he had experience with. Of course, the computer did not overlook it, and mercilessly defeated him.
You’ve got a few years yet!
Seriously, the number of possible positions in chess is vast.
It’s easy to beat on level 10 too.
I wouldn’t call it ‘aggressive’ (it plays 1.c4 sometimes), but all computers are better at tactics than positional play.
Nobody plans 20 moves in advance. (Even pawn endings are usually limited to 8 moves or so.)
You should try to make good moves with a general plan.
You should assume your opponent will always make the best move.
It’s true that in some positions you can do well with forcing moves - but the art of chess lies in reaching these positions!
For example, playing 1. e4 e5 2. Qh5 is not good, even though it threatens Qxe5.
(GM Nakamura can get away with it, but club players shouldn’t try it.)
Well Chess Titans is free, so there’s a limit to what it offers.
You could try playing humans over the Internet…
I wanted to thank you again for this article. I still haven’t gotten all the way through it and what I have read I haven’t fully digested.
Still, it is very interesting and I never would have found it on my own.
This articles mentions something that I hadn’t thought of before in that I often notice that the computer will get to the middle game and still have it’s pieces on one side or another undeveloped. For example, the bishop, knight and rook on one side are unmoved and sometimes blockaded. Very similar to what the author mentions about a superior player removing certain pieces from the board as a way of tying one hand behind their back.
…which explains a little about why you get paid (used to get paid?), what is it, £100/ hr for teaching chess. (I am bitter with jealousy. :))
I was referring more to exchanges and “pester” checks. I found that at higher levels (level 4 for me:() the machine was more likely to exchange pieces and put me in check despite not really “getting” anything out of it.
There are several things I like about playing the computer: I can get up and walk away or go to bed or leave for work and come back to the game later. I can spend a lot of time thinking about one move.
And, I have been running into the problem a lot lately where my attacks dry up or I’m stumbling over my own pieces and I realize that, while I haven’t blundered or made any seriously bad moves, I have really missed the crux of the position (if that makes any sense). With the computer, I can just take back ten moves and start from scratch.
I do recognize your knowledge in playing and teaching chess so I will try to play more on line against humans.
Well the good news is that I charge less than that for chess teaching.
The bad new is that my School job also includes teaching computer games and roleplaying.
You’re absolutely right about the convenience, the patience and the take-back.
But humans are so unpredictable, which is helpful too.
Would you like to play a training game against me on a thread here?
I’d give you advice, analysis and you could evern take a move back!
Oh, and here are a couple of my games v Chess Titan (to show us carbon-based life-forms can still hold our own against some silicon beasts).
My bitter jealousy remains and my smiley has darkened. :mad:
Sounds like a good gig.
Thank You. I would. I’d like to have some time to play, so this week and weekend are probably out.
I should make it clear that when I say I play several games at level 4 on CT I do end up taking moves back almost every game. That has to do in part with the fact that I know I can. But, in the end it means I’m really not very good. (If it would help, I could include one of my own games against CT LVL 4)
Thanks. I’ll play them out tonight.
Why did you play on LVL 9 when you were Black?
Well, how would you describe it? The computer did not, in fact, show mercy, being a machine incapable of mercy, and even if it were capable, noticing that move and not taking it would probably be insulting. And by not showing mercy, it did in fact defeat Kramnik.
Oh, and the opening will never be a tablebase ending: It simply isn’t possible, even theoretically, to construct a large enough table. If you used every single subatomic particle in the entire Universe to represent a bit in your table, that’d be just about enough data storage to store a tablebase about 50 moves deep. I’m sure glee could tell us the length of the longest chess game on record, but I’m certain that it’s a lot more than 50 moves.
It might, conceivably, be possible to solve chess via a quantum computer, but seeing as the most difficult problem ever solved to date on a quantum computer is factoring the number 15, and nobody’s ever written a chess algorithm even theoretically suitable for a quantum computer, don’t hold your breath on that one. And it might also, conceivably, be possible for someone to come up with a relatively simple non-table algorithm for solving chess, like there is for Nim, but that’s even less likely than the quantum computer.