Last week I have been trying to implement a feature in my engine to let me weaken its strength, so I can play with it with more fun. I have tried a few ideas. Mainly I have weaken the eval and the search. In the eval I have not many problem but when weakening the search I don’t get my engine to have tactical blunders. I prune some moves based on skill level and how much the move is a kind of blunder. The prune runs ok but the search continue searching and get always pv which are not the best, but good enough. It looks like making a blunder here and there is not enough.
Any ideas how to accomplish this?
thanks
How to reduce playing strenght to play against humans
Moderators: hgm, Rebel, chrisw
-
- Posts: 620
- Joined: Fri Feb 08, 2008 10:44 am
- Location: Madrid - Spain
-
- Posts: 292
- Joined: Tue Jul 07, 2009 4:56 am
Re: How to reduce playing strenght to play against humans
Tord started an interesting thread on this subject some time ago: http://talkchess.com/forum/viewtopic.php?t=21264
Re: How to reduce playing strenght to play against humans
Edit Board -> Delete Queen's KnightKempelen wrote:
Any ideas how to accomplish this?
-
- Posts: 620
- Joined: Fri Feb 08, 2008 10:44 am
- Location: Madrid - Spain
Re: How to reduce playing strenght to play against humans
I read it and also look into Glaurung code, and I did not see any adjust elo or skill feature, which let me to conclude Tord did not get anything.Aaron Becker wrote:Tord started an interesting thread on this subject some time ago: http://talkchess.com/forum/viewtopic.php?t=21264
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: How to reduce playing strenght to play against humans
Look at crafty, search for SKILL in the source, it works, and works well...Kempelen wrote:I read it and also look into Glaurung code, and I did not see any adjust elo or skill feature, which let me to conclude Tord did not get anything.Aaron Becker wrote:Tord started an interesting thread on this subject some time ago: http://talkchess.com/forum/viewtopic.php?t=21264
-
- Posts: 620
- Joined: Fri Feb 08, 2008 10:44 am
- Location: Madrid - Spain
Re: How to reduce playing strenght to play against humans
Thanks Bob. Now I have looked into code and have a doubt. In option.c is this code for skill option:bob wrote:Look at crafty, search for SKILL in the source, it works, and works well...Kempelen wrote:I read it and also look into Glaurung code, and I did not see any adjust elo or skill feature, which let me to conclude Tord did not get anything.Aaron Becker wrote:Tord started an interesting thread on this subject some time ago: http://talkchess.com/forum/viewtopic.php?t=21264
Code: Select all
null_depth = null_depth * skill / 100;
check_depth = check_depth * skill / 100;
LMR_depth = LMR_depth * skill / 100;
Code: Select all
int check_depth = 1;
int null_depth = 3; /* R=3 */
int LMR_depth = 1; /* reduce 1 ply */
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: How to reduce playing strenght to play against humans
You can actually leave that out and just do the eval changes. That breaks the eval up into two components. Part 1 is normal score. Part 2 is a pure random value. The "skill" setting varies how much each contributes to the final score. Skill 100 says 100% eval, 0% random. Skill 50 says 50% of final score is normal score, 50% is pure random.Kempelen wrote:Thanks Bob. Now I have looked into code and have a doubt. In option.c is this code for skill option:bob wrote:Look at crafty, search for SKILL in the source, it works, and works well...Kempelen wrote:I read it and also look into Glaurung code, and I did not see any adjust elo or skill feature, which let me to conclude Tord did not get anything.Aaron Becker wrote:Tord started an interesting thread on this subject some time ago: http://talkchess.com/forum/viewtopic.php?t=21264
This look OK, but initial values are:Code: Select all
null_depth = null_depth * skill / 100; check_depth = check_depth * skill / 100; LMR_depth = LMR_depth * skill / 100;
It looks due to divisions (of 1 value) like skill is all or nothing for tactics instead of a value adjustable of skill. isn't it? This sounds like tactics is only weaken if skill<100 which is idem for skill levels.Code: Select all
int check_depth = 1; int null_depth = 3; /* R=3 */ int LMR_depth = 1; /* reduce 1 ply */
I chose to tone down the tactics as well. And you are right, any skill < 100 does disable check extensions and LMR reductions. But null-move will still be working. The random component of the evaluation is really good enough for this weakening without bothering with the tactical part at all.
-
- Posts: 620
- Joined: Fri Feb 08, 2008 10:44 am
- Location: Madrid - Spain
Re: How to reduce playing strenght to play against humans
Thanks again. I have been playing a few games against Crafty lowering the skill, and it is certainly very good, quite a realistic human like game.bob wrote:You can actually leave that out and just do the eval changes. That breaks the eval up into two components. Part 1 is normal score. Part 2 is a pure random value. The "skill" setting varies how much each contributes to the final score. Skill 100 says 100% eval, 0% random. Skill 50 says 50% of final score is normal score, 50% is pure random.Kempelen wrote:Thanks Bob. Now I have looked into code and have a doubt. In option.c is this code for skill option:bob wrote:Look at crafty, search for SKILL in the source, it works, and works well...Kempelen wrote:I read it and also look into Glaurung code, and I did not see any adjust elo or skill feature, which let me to conclude Tord did not get anything.Aaron Becker wrote:Tord started an interesting thread on this subject some time ago: http://talkchess.com/forum/viewtopic.php?t=21264
This look OK, but initial values are:Code: Select all
null_depth = null_depth * skill / 100; check_depth = check_depth * skill / 100; LMR_depth = LMR_depth * skill / 100;
It looks due to divisions (of 1 value) like skill is all or nothing for tactics instead of a value adjustable of skill. isn't it? This sounds like tactics is only weaken if skill<100 which is idem for skill levels.Code: Select all
int check_depth = 1; int null_depth = 3; /* R=3 */ int LMR_depth = 1; /* reduce 1 ply */
I chose to tone down the tactics as well. And you are right, any skill < 100 does disable check extensions and LMR reductions. But null-move will still be working. The random component of the evaluation is really good enough for this weakening without bothering with the tactical part at all.
I will tried in my engine.....
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: How to reduce playing strenght to play against humans
That was the intent. If you just lobotomize the search, the program doesn't feel "natural" in that it still has a ton of positional knowledge that a low-rated player won't have (passed pawns, candidates, pawn weaknesses, king safety, etc. If you lobotomize the eval, and keep the search, you get a tactical genius that will still beat most weaker players. By introducing the random factor into the eval, it still takes the normal amount of time to move, and does some pretty deep searches, but since the eval numbers are more random as you lower the skill setting, it is searching toward endpoints that don't represent really good chess. however, a purely random eval still plays somewhat decently, hence my decision to also weaken the search at the same time. It made more sense when I was using fractional plies, but I removed that a while back.Kempelen wrote:Thanks again. I have been playing a few games against Crafty lowering the skill, and it is certainly very good, quite a realistic human like game.bob wrote:You can actually leave that out and just do the eval changes. That breaks the eval up into two components. Part 1 is normal score. Part 2 is a pure random value. The "skill" setting varies how much each contributes to the final score. Skill 100 says 100% eval, 0% random. Skill 50 says 50% of final score is normal score, 50% is pure random.Kempelen wrote:Thanks Bob. Now I have looked into code and have a doubt. In option.c is this code for skill option:bob wrote:Look at crafty, search for SKILL in the source, it works, and works well...Kempelen wrote:I read it and also look into Glaurung code, and I did not see any adjust elo or skill feature, which let me to conclude Tord did not get anything.Aaron Becker wrote:Tord started an interesting thread on this subject some time ago: http://talkchess.com/forum/viewtopic.php?t=21264
This look OK, but initial values are:Code: Select all
null_depth = null_depth * skill / 100; check_depth = check_depth * skill / 100; LMR_depth = LMR_depth * skill / 100;
It looks due to divisions (of 1 value) like skill is all or nothing for tactics instead of a value adjustable of skill. isn't it? This sounds like tactics is only weaken if skill<100 which is idem for skill levels.Code: Select all
int check_depth = 1; int null_depth = 3; /* R=3 */ int LMR_depth = 1; /* reduce 1 ply */
I chose to tone down the tactics as well. And you are right, any skill < 100 does disable check extensions and LMR reductions. But null-move will still be working. The random component of the evaluation is really good enough for this weakening without bothering with the tactical part at all.
I will tried in my engine.....