Blunder option

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
op12no2
Posts: 400
Joined: Tue Feb 04, 2014 11:25 am
Location: Wales
Full name: Colin Jenkins
Contact:

Blunder option

Post by op12no2 » Tue Dec 29, 2020 1:49 pm

I've had a few queries recently (due to Netflix?) about making the online Lozza weaker. It seems that for a beginner even a consistently 'accurate' 1 ply search is too strong - which is fair enough - people need to win to stay interested. I came up with this in the top level search just before the test for > alpha etc.

Code: Select all

if (this.mistakes) {
  if (Math.random() <= 1.0/(this.uci.spec.depth * this.uci.spec.depth)) {
    var mm = Math.random() + Math.random();
    this.uci.debug('blunder, changed score of ',board.formatMove(move,SAN_FMT),' from ',score,' to ',score*mm|0);
    score = score * mm | 0;
  }
}
this.uci.spec.depth is maximum depth to search and I enable it in Levels 1 to 4 (1 to 4 ply search) in the online user interface, although it's generic in my extended UCI command set.

It means that every move is tweaked when playing at Level 1 (I wanted to make sure that Level 1 can be beaten by literally everybody) and every 16th move at Level 4.

While this seems to work fine, I was wondering if there is a better/standard way to force blunders?

Try the new user interface here: https://op12no2.github.io/lozza-ui/play.htm

To see the effect on top levels moves you can use the console UI: https://op12no2.github.io/lozza-ui/console.htm

Type for example:-

Code: Select all

start
uci
ucinewgame
position startpos
debug on
mistakes 1
board
go depth 5
Each blunder is listed within the PV etc output.
Last edited by op12no2 on Tue Dec 29, 2020 2:01 pm, edited 1 time in total.

Sesse
Posts: 285
Joined: Mon Apr 30, 2018 9:51 pm
Contact:

Re: Blunder option

Post by Sesse » Tue Dec 29, 2020 1:59 pm

As with pretty much any other engine I've seen, the blunders are just not very believable. It's a really hard problem.

E.g., I played 1. d4 d5 2. c4 Nf6 3. Nf3 Bd7 4. e3 h5 5. Nc3 a5 6. a4 Ra6 7. cxd5

[D]1n1qkb1r/1ppbppp1/r4n2/p2P3p/P2P4/2N1PN2/1P3PPP/R1BQKB1R b KQk - 0 7

From here, the engine played Bc6??, and after dxc6 played Qxd4??. Ra6 (not seeing the discovered attack) is believable, but what kind of beginner would play Bc6?

op12no2
Posts: 400
Joined: Tue Feb 04, 2014 11:25 am
Location: Wales
Full name: Colin Jenkins
Contact:

Re: Blunder option

Post by op12no2 » Tue Dec 29, 2020 2:05 pm

Sesse wrote:
Tue Dec 29, 2020 1:59 pm
From here, the engine played Bc6??, and after dxc6 played Qxd4??. Ra6 (not seeing the discovered attack) is believable, but what kind of beginner would play Bc6?
Fair point; I have to confess I had not considered the concept believable, but now you've shown me that example, I definitely need to think some more :)

Ferdy
Posts: 4681
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Blunder option

Post by Ferdy » Tue Dec 29, 2020 2:18 pm

Sesse wrote:
Tue Dec 29, 2020 1:59 pm
As with pretty much any other engine I've seen, the blunders are just not very believable. It's a really hard problem.

E.g., I played 1. d4 d5 2. c4 Nf6 3. Nf3 Bd7 4. e3 h5 5. Nc3 a5 6. a4 Ra6 7. cxd5

[D]1n1qkb1r/1ppbppp1/r4n2/p2P3p/P2P4/2N1PN2/1P3PPP/R1BQKB1R b KQk - 0 7

From here, the engine played Bc6??, and after dxc6 played Qxd4??. Ra6 (not seeing the discovered attack) is believable, but what kind of beginner would play Bc6?
If that is level 1, that is fine, the idea is to attack the pawn at the front. Beginner level is probably Baby or Idiot :)

But making mistakes is also an art. Tried it in CDrill 1200, and it is not easy at all what mistakes are you going to make. Initially you make mistake by score ranges or so by multipv, then observe the engine behaviour what mistakes it is doing (giving up a piece freely or a losing capture etc.), then make corrections, putting up some conditions, until you are satisfied of what blunder/mistake move it would make.

op12no2
Posts: 400
Joined: Tue Feb 04, 2014 11:25 am
Location: Wales
Full name: Colin Jenkins
Contact:

Re: Blunder option

Post by op12no2 » Tue Dec 29, 2020 2:32 pm

Ferdy wrote:
Tue Dec 29, 2020 2:18 pm
But making mistakes is also an art.
Yes, thanks. I think Bc6 looks more like 'it's deliberately trying to lose', rather than 'it made a mistake' which is not a good way to reassure beginners that they are improving perhaps.

Ferdy
Posts: 4681
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Blunder option

Post by Ferdy » Tue Dec 29, 2020 2:44 pm

op12no2 wrote:
Tue Dec 29, 2020 2:32 pm
Ferdy wrote:
Tue Dec 29, 2020 2:18 pm
But making mistakes is also an art.
Yes, thanks. I think Bc6 looks more like 'it's deliberately trying to lose', rather than 'it made a mistake' which is not a good way to reassure beginners that they are improving perhaps.
Bc6 is ok, if your lowest level is 1 and that move is made by level 1.

When I was a beginner, I don't know the relative value of pieces. I don't care if I capture a pawn with my queen and my queen will be captured by opponent, what I see is I captured a pawn :) don't even care if I lose, I just want to learn the movement of pieces.

Sesse
Posts: 285
Joined: Mon Apr 30, 2018 9:51 pm
Contact:

Re: Blunder option

Post by Sesse » Tue Dec 29, 2020 2:53 pm


flok
Posts: 312
Joined: Tue Jul 03, 2018 8:19 am
Full name: Folkert van Heusden

Re: Blunder option

Post by flok » Tue Dec 29, 2020 2:56 pm

Embla and Micah both have a blunder-option. Unfortunately it is default on and cannot be switched off.

Ferdy
Posts: 4681
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Blunder option

Post by Ferdy » Tue Dec 29, 2020 2:58 pm

Sesse wrote:
Tue Dec 29, 2020 2:53 pm
http://talkchess.com/forum3/viewtopic.php?f=7&t=21264 is a relevant thread.
Nice link.

Ferdy
Posts: 4681
Joined: Sun Aug 10, 2008 1:15 pm
Location: Philippines

Re: Blunder option

Post by Ferdy » Tue Dec 29, 2020 2:59 pm

flok wrote:
Tue Dec 29, 2020 2:56 pm
Embla and Micah both have a blunder-option. Unfortunately it is default on and cannot be switched off.
:D

Post Reply