How to dumb down/weaken/humanize an engine algorithmically?

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

kbhearn
Posts: 411
Joined: Thu Dec 30, 2010 4:48 am

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by kbhearn »

I'd suggest overall if you want to make an engine that feels like a real opponent you might want to start from the ground up with that in mind rather than making a strong engine in mind. Give it closer to human limitations, stick to those limitations, and as it'll already be quite weak at that point the question will be how to make it strong enough to be a good opponent rather than how to make it make human mistakes.

I'd start with allowing it to look at say no more than 10-20 positions per second. This will immediately rule out exhaustive search as an option and put an appropriate amount of emphasis on speculative pruning and pattern matching for a human-like search and bringing the right type of errors where overlooked moves are overlooked for a reason (such as they were atypical or the position was too complicated to look at all the important moves) and attempts to tweak evaluation for personality parameters are more likely to result in significantly different play as the scope of the search isn't so large as to tactically compensate for the misevaluations.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by stegemma »

bob wrote:
jdart wrote:[...]It is hard to measure Elo down at that level since there are few programs that play that badly..
Oh... no... there are a lot of programs that play that badly ;)
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by Ferdy »

stegemma wrote:Maybe you should analyze why and when humans make some mistake. Sometime is under pressure, sometime is because of limited depth. Humans can leave piece under attack and do any kind of mistake. A grand master of the past has lose a queen only because a piece was hiding another piece, and he doesn't see it. Sometime a human make a mistake because he/she doesn't consider that a piece gets pinned (or gets un-pinned). Sometime during human evaluation some piece can appears as doubled... or desappears in the brain image memory. Often we don't see all the possible moves of a Knight. Sometime we see only moves of pieces in the interesting part of the chessboad: we are attacking the king and we ignore what happen in the opposite site. More often, we simply choose the wrong plan, we attack in the border instead of centre, we exchange the good bishop with a bad one, we keep Knight instead of bishop in open positions... and we cannot mate with KQ vs K! ;)
Nice strategy of weakening. I think I will implement, cannot mate in kqkr, kbnk for elo 1100 and below. Cannot mate krk in elo below 1000.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by stegemma »

Ferdy wrote:[...]
Nice strategy of weakening. I think I will implement, cannot mate in kqkr, kbnk for elo 1100 and below. Cannot mate krk in elo below 1000.
...and don't forget the baby-mode: push pawn before of anything else and if you can capture something => always take it with the queen!!! ;)
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by Henk »

stegemma wrote:
Ferdy wrote:[...]
Nice strategy of weakening. I think I will implement, cannot mate in kqkr, kbnk for elo 1100 and below. Cannot mate krk in elo below 1000.
...and don't forget the baby-mode: push pawn before of anything else and if you can capture something => always take it with the queen!!! ;)
Skipper can't finish krk too properly at least when it doesn't have much thinking time. The problem does not interest me now.
User avatar
hgm
Posts: 27796
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by hgm »

Well, it should, as it shows there must be something seriously wrong with its search. And KRK is probably a good test position to debug that.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by Henk »

hgm wrote:Well, it should, as it shows there must be something seriously wrong with its search. And KRK is probably a good test position to debug that.
I should not spend much time on chess programming hobby. Finding a paid job has largest priority. Rent, insurance, food, clothes, electricity are not for free (in Holland). Investing in knowledge is ok , but chess knowledge (for me) is a bad investment. Almost impossible ( for me) to beat top 10 chess programs.
Henk
Posts: 7218
Joined: Mon May 27, 2013 10:31 am

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by Henk »

Henk wrote:
hgm wrote:Well, it should, as it shows there must be something seriously wrong with its search. And KRK is probably a good test position to debug that.
I should not spend much time on chess programming hobby. Finding a paid job has largest priority. Rent, insurance, food, clothes, electricity are not for free (in Holland). Investing in knowledge is ok , but chess knowledge (for me) is a bad investment. Almost impossible ( for me) to beat top 10 chess programs.
Unless of course you create a clone or copy as much good ideas as possible. But who needs a clone.
User avatar
stegemma
Posts: 859
Joined: Mon Aug 10, 2009 10:05 pm
Location: Italy
Full name: Stefano Gemma

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by stegemma »

Henk wrote:
hgm wrote:Well, it should, as it shows there must be something seriously wrong with its search. And KRK is probably a good test position to debug that.
I should not spend much time on chess programming hobby. Finding a paid job has largest priority. Rent, insurance, food, clothes, electricity are not for free (in Holland). Investing in knowledge is ok , but chess knowledge (for me) is a bad investment. Almost impossible ( for me) to beat top 10 chess programs.
I both agree and disagree. Even in Italy anything is not for free but working on my chess engine gives me the opportunity to develop and test my c++ classes for multithreading. I've learned a lot about optimization and sometime i've applyed all this new knowledge to my commercial softwares. The difference is that my engine is one the of weakest in the world but some of my commercial softwares are still used world-wide.

Of course, you can get the same results writing commercial software with same kind of complexity, having the growth in knowledge and making some money out of your time. Anybody should choose how to invest its time and your comment is very important and respectable.
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: How to dumb down/weaken/humanize an engine algorithmical

Post by Ferdy »

stegemma wrote:
Ferdy wrote:[...]
Nice strategy of weakening. I think I will implement, cannot mate in kqkr, kbnk for elo 1100 and below. Cannot mate krk in elo below 1000.
...and don't forget the baby-mode: push pawn before of anything else and if you can capture something => always take it with the queen!!! ;)
This can be in elo 500 or below perhaps, so I guess I have to lower my min elo limit from 1000 to 100. Together with HGM's algo, perhaps the engine will only generate pawn, queen and king moves :) . I remember when I was just starting to learn, I only move pawn moves, not even pawn capture moves but just 1 step forward pawn move, and when it reaches the last rank it remains as a pawn :D .