Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How do you effectively dumb down an engine? (some suggestions)

Author: Richard Pijl

Date: 06:14:16 04/19/04

Go up one level in this thread


On April 18, 2004 at 20:36:56, Steve Maughan wrote:

>I'm looking to implement the new ELO rating support in UCI 2.  In the past I
>haven't given much thought as to how one could make an engine predictably
>weaker.  Does anyone have any suggestions?  After the little thought I have
>given the subject here's what I've come up with.
>
>1.  Search to a shallower depth / shorter time.  This seems somewhat
>unsatisfactory as it will ignore the other setting.
>
>2.  Add random elements to the evaluation term - the bigger the term the weaker
>the play.
>
>3.  Round off at the root.  So to weaken the engine slightly you would have the
>root round off to 0.1 pawns, a further weakening would be in units of 0.5 pawns
>etc.  This means that if a value came back as +1.23 the engine would regard it
>as +1.20.  I like this idea since it is relatively simple to implement :-).
>However I'm not sure how effective it would be at actually weakening the engine
>(it may speed the engine up since there may be more cuttoffs!?!).
>
>4.  Within the tree you could ignore some moves e.g. all losing capture after x
>depth.  This is also interesting.  It may closely match how humans think and
>err.  Of course it is more complex to implement.
>
>Any other ideas.  This could be an interesting area for discussion as it has
>virtually no commercial value (IMO nobody is going to buy an engine that is
>weak).  I'd be interested to know of other idea.
>
>Regards,
>
>Steve Maughan

I've been experimenting a little in dumbing down the Baron and it is not easy to
do by limiting search a bit, or by reducing eval a bit. Of course, playing
strength goes down, but not enough for a casual player.

FRC Baron has a so called 'patzer' mode (turn it on by setting 'patzer on' in
the baron.ini file). It reduces eval to just material eval + piece square
values, and removes hash cutoffs (but still uses the hashtable for move
ordering). I expect that it still is much too strong for most chess players.

I started a new engine. It is currently playing on US Chess Live (handle Baron)
on an old Pentium Pro 200 Mhz. It is a really dumb engine at the moment. No eval
other than material + piece square tables. No move ordering other than MVV/LVA.
No hash tables. It does do ponder though. Maybe a bit strange to start with
that, but I rather start with the stuff that has impact throughout the engine
(e.g. main loop) and that I want to implement anyway at some time before doing
the more logical parts.
Anyway, this new engine has played quite a few blitz games the last few days and
currently has a blitz rating of 2040 after 170 games, and a lightning rating of
2147 after 50 games. It does play really dumb though. But because weak players
give away material it still wins most of its games.
So bringing down playing strength to e.g. 1500 level needs much more than
stripping eval and slowing down search a bit.

I've been thinking of something else. Not reducing search depth, not by reducing
evaluation, but by randomly selecting moves from a number of candidates. So
adapt the main search loop to return a number of moves, with the correct eval
associated with it. This slows down search a bit, but frankly, when dumbing down
the engine we don't care :-).
Then, select one of those moves with a weighted random function. Suppose 5 moves
are returned, with the eval scores (in centipawns) 10, 4, -10, -13, -50
The difference in highest and lowest score is 60. Then normalize the scores to
the offset from the lowest score and add an offset (at least 1, e.g 1): 61, 55,
51, 48, 1.
Determine the sum: 61+55+51+48+1=216
Randomly select a number between 1 and 216: e.g. 123
216 - 61 = 155 > 123, so the first move is not selected
           155 - 55 = 100 < 123, so select the second move.
Like any weak player, the engine will play normal, strong moves, but sometimes a
not so strong move will be selected. This can be influenced by selecting more
candidate moves, or a different offset (bigger -> weaker)

This may look complicated, but I believe this is relatively easy when the engine
already supports multi-pv output. In fact, it can be a GUI function with UCI
engines ...

Richard.



This page took 0 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.