Reducing Strength

Discussion of chess software programming and technical issues.

Moderator: Ras

mike_bike_kite
Posts: 98
Joined: Tue Jul 26, 2011 12:18 am
Location: London

Re: Reducing Strength

Post by mike_bike_kite »

bob wrote:still plays way too strongly due to "the Beal effect"
I'll bite. What's the Beal effect?
kinderchocolate
Posts: 454
Joined: Mon Nov 01, 2010 6:55 am
Full name: Ted Wong

Re: Reducing Strength

Post by kinderchocolate »

I need to think carefully about this... Don't have time for trying every single approach.

Yeah, what's the Beal Effects?
Edmund
Posts: 670
Joined: Mon Dec 03, 2007 3:01 pm
Location: Barcelona, Spain

Re: Reducing Strength

Post by Edmund »

mike_bike_kite wrote:
bob wrote:still plays way too strongly due to "the Beal effect"
I'll bite. What's the Beal effect?
Positions with higher mobility for the own pieces are on average better. Even if eval is random all the time, on average it will return a higher maximum score for positions with more possible moves.

e.g.
Lets say the random evaluation function returns 50% of the time 0 and 50% 1
We are at depth 1 and the maximum score of all moves is propagated to the parent node.
If there is just one possible move that gets evaluated at depth 1, the node propagates with 50% chance 0 and with 50% chance 1. If there are 2 possible moves the chance that at least one of them is 1 is 75%. So it propagates 0 with 25% chance and 1 with 75%.

This effect gets more pronounced the deeper you search.
jdart
Posts: 4408
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Reducing Strength

Post by jdart »

I have tried a variant of this - I already search the first few plies with a wide window, for "easy move" detection. So when you do this you have some idea of what the individual move scores are. Then I add a random amount (scaled by the strength selected) to the scores and re-sort, and take the top scoring move. This will cause a sub-optimal move to be selected, some of the time. If you set the window really wide and the random factor really high it will start to drop pieces, so you get really low strength ;-). But otherwise you get much the same effect as varying the leaf eval. This is not good for dialing the strength down by 10% but it is useful for the lower end of the strength scale IMO. (It sounds like Ed's Club Player mode is like this)
bhlangonijr
Posts: 482
Joined: Thu Oct 16, 2008 4:23 am
Location: Milky Way

Re: Reducing Strength

Post by bhlangonijr »

Something that works greatly for me:

- If the searched depth is greater than a given number (based on the skill level), let the *side* play two (or more) moves in a row. Just like it is done with NM, with the difference that you will be using your normal "do_move" function. It shouldn't be done in every node but rather at some nodes picked up randomly and preferably with moves retrieved from the hash. The frequency of the two/three moves played in a row can be adjusted based on the skill level too.

I discovered this "nice feature" after finding a bug in earlier versions of my engine: It was randomly playing two moves in a row - for the same side - at certain nodes in the search tree. The reason was that it was not being validated whether the moves retrieved from the hash were from the side to move. This simple validation costs more than 100 Elo points in this case.

The nice thing about this "approach" is that the engine won't play dumb moves at random, but rather select sub-optimal moves for every search.

Try it. You won't regret. :)
bob
Posts: 20943
Joined: Mon Feb 27, 2006 7:30 pm
Location: Birmingham, AL

Re: Reducing Strength

Post by bob »

jdart wrote:I have tried a variant of this - I already search the first few plies with a wide window, for "easy move" detection. So when you do this you have some idea of what the individual move scores are. Then I add a random amount (scaled by the strength selected) to the scores and re-sort, and take the top scoring move. This will cause a sub-optimal move to be selected, some of the time. If you set the window really wide and the random factor really high it will start to drop pieces, so you get really low strength ;-). But otherwise you get much the same effect as varying the leaf eval. This is not good for dialing the strength down by 10% but it is useful for the lower end of the strength scale IMO. (It sounds like Ed's Club Player mode is like this)
I wanted to address several issues at once.

1. same move time regardless of skill level. Some "dumb-down" approaches reduce the depth, and it doesn't feel "natural" to a chess player if your opponent always moves instantly. You want the game to "flow" the same with a GM or a patzer opponent.

2. Not make an occasional tactical blunder followed by a brilliant tactical shot. Take everything down gradually so that the tactics get worse, the positional play gets worse, at a sort of uniform level. I have not tested in a couple of years, but originally the skill 70 command would play 200 Elo worse than Skill 100. Skill 50 was 200 worse than skill 70. Not "linear" as one can see. But eventually the beal effect killed me and I simply could not get the thing to play below maybe 1700-1800. Got lots of complaints. The solution was the "time burner loop" to slow the search down proportional to the skill level drop which hides tactics, and also minimizes the beal effect since the search space is greatly reduced when the NPS drops so drastically...
PK
Posts: 911
Joined: Mon Jan 15, 2007 11:23 am
Location: Warsza

Re: Reducing Strength

Post by PK »

Glass source code is closed, but some of the ideas are shown in Rodent (mixed with some stuff from Phalanx). the bad news: it isn't tuned. the good news: it uses just one Elo slider (hopefully Glass will do the same at some point)

http://www.koziol.home.pl/rodent.htm
kinderchocolate
Posts: 454
Joined: Mon Nov 01, 2010 6:55 am
Full name: Ted Wong

Re: Reducing Strength

Post by kinderchocolate »

Thanks, I'm studying.