Finding the move

Discussion of chess software programming and technical issues.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
outAtime
Posts: 226
Joined: Sun Mar 08, 2009 2:08 pm
Location: Canada

Finding the move

Post by outAtime » Sat Feb 05, 2011 7:39 pm

Is there any particular eval element which helps strong engines to find 19... Ng6 here?

Image

Rybka 3 and Stockfish 1.6.3 both have a look at Nxf3 (quickly rejected) and Bd7, eventually switching to Ng6. I find it difficult to see what would cause this switch since the knight appears well posted on the central square, PST etc would make it difficult to move Ng6. Any ideas? How do these engines decide to switch from Bd7 to Ng6?
outAtime

Kurt Utzinger
Posts: 169
Joined: Sun May 11, 2008 8:31 pm
Location: Switzerland
Contact:

Re: Finding the move

Post by Kurt Utzinger » Sat Feb 05, 2011 7:51 pm

Please poste a FEN of this position or the complete game as PGN file.
Kurt

outAtime
Posts: 226
Joined: Sun Mar 08, 2009 2:08 pm
Location: Canada

Re: Finding the move

Post by outAtime » Sat Feb 05, 2011 8:15 pm

sorry,
r1b2rk1/pp2q1bp/3p4/2pPnp2/2P2B2/1QN2BPP/PP1R4/5RK1 b - - 4 19
outAtime

outAtime
Posts: 226
Joined: Sun Mar 08, 2009 2:08 pm
Location: Canada

Re: Finding the move

Post by outAtime » Sat Feb 05, 2011 8:17 pm

Ive noticed lowering Knight mobility or raising the B pair bonus will bring me a switch to Ra8-b8 at around ply 10, no luck on the knight move yet...
outAtime

zamar
Posts: 613
Joined: Sun Jan 18, 2009 6:03 am

Re: Finding the move

Post by zamar » Sat Feb 05, 2011 8:23 pm

outAtime wrote:Is there any particular eval element which helps strong engines to find 19... Ng6 here?
I think there are many elements:

* Bg7 mobiliy inreases
* Qe7 mobility increases
* Bd4+ is a check
* possibility of Ng6xf4 gives a slight threat-bonus
Joona Kiiski

outAtime
Posts: 226
Joined: Sun Mar 08, 2009 2:08 pm
Location: Canada

Re: Finding the move

Post by outAtime » Sat Feb 05, 2011 8:38 pm

ok, so I already have bishop and queen mobility, I don't have a checking bonus or a threat bonus as such... just these attacks included in mobility scores but unfortunately in such a way it is difficult to include a larger bonus for checks in B mobility, knight mobility I think I can adjust to include a larger score for hitting the bishop...

Knight mobility is still quite configurable as to what gets scored..

Code: Select all

 for &#40;n = 0; n < 8; n++)
    if &#40;board&#91;squaren + n_ofs&#91;n&#93;&#93; == npiece&#41; 
      g++;
	 
	if &#40;board&#91;squaren + n_ofs&#91;n&#93;&#93; == bbishop&#41; 
      g++;
	 
	if &#40;board&#91;squaren + n_ofs&#91;n&#93;&#93; == bknight&#41; 
      g++; 
	  
	if &#40;board&#91;squaren + n_ofs&#91;n&#93;&#93; == bqueen&#41; 
      g++;
etc...

however queens, rooks and bishops are locked into a sort of "one score for all" deal.

Code: Select all

int bishop_mobility_black&#40;int sq, int offsets&#91;&#93;)
&#123;
  int q, *c = offsets, t = 0;
 
 do &#123;
       for &#40;q = sq + *c; board&#91;q&#93; == npiece; q += *c&#41;
           t++;
  &#125; while (*++c&#41;;

  if &#40;board&#91;q&#93; && (&#40;board&#91;q&#93; & 1&#41; == 0&#41;)
      t++;

  return t;
&#125; 
so while if (board[q] && ((board[q] & 1) == 0)) is very handy im not sure if i could add anything to include a higher mobility score for hitting kings.
I dont know what I would write for that.
Im going to try increasing the bonus for knights attacking bishops in mobility and check the result.
outAtime

outAtime
Posts: 226
Joined: Sun Mar 08, 2009 2:08 pm
Location: Canada

Re: Finding the move

Post by outAtime » Sat Feb 05, 2011 8:50 pm

no, well it seems increasing the score for knight attacking a bishop will not help the knight move away from a square where it is _already_ attacking a bishop to a (worse (PST etc)) square to attack a different bishop :)

The increase in Q mobility and the B on g7 should be enough, but I suppose there are other factors interfering still.

Even the simple Sungorus finds this on ply 9, so it cant be anything too fancy... just mobility and i think Sungorus has some PSQ.
outAtime

GARGAMEL
Posts: 111
Joined: Tue Dec 29, 2009 8:55 am
Location: AUSTRIA

Re: Finding the move

Post by GARGAMEL » Sat Feb 05, 2011 9:01 pm

Hello

NN - NN, CCC Forum, Sg6
r1b2rk1/pp2q1bp/3p4/2pPnp2/2P2B2/1QN2BPP/PP1R4/5RK1 b - - 0 1

Analysis by Houdini 1.5 x64:

1...Ld7 2.Kg2 b6 3.Sb5 Tae8 4.Te2
= (0.23) Tiefe: 6/21 00:00:00 16kN
1...b6 2.Te2 Tb8 3.Lh5 a6 4.Tfe1 Ld7 5.Dc2
+/= (0.28) Tiefe: 7/21 00:00:00 24kN
+/= (0.31) Tiefe: 8/22 00:00:00 38kN
1...Ld7 2.Te2 Le8 3.Te3 Lg6 4.Le2 Tae8 5.Da4 a6 6.Dc2 Dd7 7.b3 Dc7 8.Te1 Te7 9.Ld3 Lh5 10.Lxe5 Txe5
= (0.22) Tiefe: 8/22 00:00:00 44kN
= (0.08) Tiefe: 14/36 00:00:00 2443kN
1...a6 2.Kh2 Dc7 3.Tg2 Ld7 4.Le2 Tab8 5.a4 Tbe8 6.Dc2 Da5 7.Tgf2 Te7 8.Ld2 Dc7 9.Lg5 Lf6 10.Se4 Lxg5 11.Sxg5 h6
= (0.05) Tiefe: 14/36 00:00:00 5365kN
= (0.07) Tiefe: 21/47 00:00:26 323mN
1...Sg6! 2.Se2 b6 3.Lh5 Tb8 4.De3 Dxe3+ 5.Lxe3 b5 6.cxb5 Txb5 7.b3 Tb4 8.Lg5 Te4 9.Kg2 h6 10.Ld8 Txd8 11.Lxg6 Tf8 12.Tf3 Ld7
= (0.06) Tiefe: 21/49 00:00:42 531mN
= (0.00) Tiefe: 26/59 00:07:32 6073mN

Analysis by Critter 0.90 64-bit:

1...Sxf3+ 2.Txf3 Ld4+ 3.Kh2 a5 4.Te2 Df6 5.Kh1 h6 6.Tf1
+/= (0.48) Tiefe: 6/10 00:00:00 8kN
+/= (0.64) Tiefe: 8/13 00:00:00 36kN
1...Ld7 2.Te2 Le8 3.Kh1 Lg6 4.Sb5 Tfe8 5.Tfe1 a6 6.Sxd6 Dxd6 7.Dxb7
+/= (0.53) Tiefe: 9/17 00:00:00 207kN
+/= (0.52) Tiefe: 11/18 00:00:00 361kN
1...Sg6! 2.Te2 Dd8 3.Tg2 Sxf4 4.gxf4 Kh8 5.Kh2 a6 6.Tg3 Dh4 7.Se2 b5 8.Tfg1 Tg8 9.cxb5 axb5 10.Dxb5 La6 11.Dd7 Lxe2 12.Txg7 Lxf3 13.Txg8+ Txg8 14.Txg8+ Kxg8 15.De8+ Kg7 16.Dd7+ Kf8 17.Dc8+ Ke7 18.De6+ Kd8 19.Dxd6+ Ke8 20.Dc6+ Kf7 21.De6+ Kg7 22.Dd7+ Kg6 23.De8+ Kh6 24.Df8+ Kg6
+/= (0.37) Tiefe: 11/20 00:00:00 435kN
= (0.00) Tiefe: 25/57 00:01:58 572mN

regards Anton

User avatar
Evert
Posts: 2923
Joined: Fri Jan 21, 2011 11:42 pm
Location: NL
Contact:

Re: Finding the move

Post by Evert » Sat Feb 05, 2011 10:14 pm

outAtime wrote:I find it difficult to see what would cause this switch since the knight appears well posted on the central square, PST etc would make it difficult to move Ng6. Any ideas? How do these engines decide to switch from Bd7 to Ng6?
Well, I have no idea why it does it, but Jazz does switch to Ng6 at 11 ply and seems to stick with it. Note that it seems to badly misevaluate the position (based on the evaluation by stronger engines posted earlier), or at least not like it very much for black, with a score around -0.5.

[ 1] -1.02 0.00 0 (EBR = 0.00) 0 / 0 Nxf3
[ 2] -0.46 0.00 384 (EBR = 20.34) 4 / 0 Nxf3 Rxf3 Bd4 Kh2
[ 3] -0.05 0.01 1002 (EBR = 1.42) 5 / 0 Nxf3 Rxf3 Bd4 Kh2 Qe1
[ 4] -0.42 0.03 4490 (EBR = 4.91) 6 / 0 Nxf3 Rxf3 Bd4 Kh2 Qe1 Re2
[ 5] -0.49 0.07 17902 (EBR = 2.10) 7 / 0 Nxf3 Rxf3 Bd4 Kf1 Kh8 Re2 Qd8
[ 6] -0.64 0.10 34021 (EBR = 0.80) 8 / 0 Nxf3 Rxf3 Bd4 Kf1 Re8 Re2 Be5 Re3
[ 7] -0.61 0.16 70705 (EBR =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 dxe5 Qe3 Rg8 d6 Qe6 Qxc5 Bxa4
--> Ng6 -0.55

outAtime
Posts: 226
Joined: Sun Mar 08, 2009 2:08 pm
Location: Canada

Re: Finding the move

Post by outAtime » Sat Feb 05, 2011 10:16 pm

Code: Select all

int bishop_mobility_black&#40;int sq, int offsets&#91;&#93;)
&#123;
  int q, *c = offsets, t = 0;
 
 do &#123;
       for &#40;q = sq + *c; board&#91;q&#93; == npiece; q += *c&#41;
           t++;
  &#125; while (*++c&#41;;

  if &#40;board&#91;q&#93; && (&#40;board&#91;q&#93; & 1&#41; == 0&#41;)
      t++;
  if &#40;board&#91;q&#93; && &#40;board&#91;q&#93; == wknight&#41;)
      t++;
          t++;
	  t++;
	  t++;
	  t++;
  return t;
&#125; 
adding this ends Bd7 (! :) ), still not getting the Knight move yet... I have to kill a7-a6 now... sheesh. Any ideas?
outAtime

Post Reply