Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: How to evaluate KQ vs KR?

Author: Sune Fischer

Date: 15:21:39 05/05/04

Go up one level in this thread


On May 05, 2004 at 17:47:08, Dieter Buerssner wrote:

>On May 05, 2004 at 07:22:58, Tord Romstad wrote:
>
>>On May 04, 2004 at 16:46:14, Dieter Buerssner wrote:
>>>score = 400 + 1/8 * dist(K_l,R) - 1/8 * edge_dist(K_l)
>>>            - 1/8 * corner_dist(K_l) - 1/8 * dist(K_l, K_w)
>
>>I will experiment with something similar than that.  If the formula is
>>really effective, I think a constant bigger than 400 would be a good idea,
>>though.
>
>I just tried it (only once). As noted in another post, I gave the formula wrong.
>I used (in centipawn) a factor of 12 (instead of 1/8) and a constant of 600
>(which won't matter for that experiment). It was winning a 1 0 game, but
>captured the R only in move 48. Then I tried this:
>
>  /* initialize squares of the pieces and side of queen */
>  score = 600 + 6*DISTANCE(kl,r) - 12*EDGE_DIST(kl)
>          - 12*CORNER_DIST(kl) - 8*DISTANCE(kl,kw);
>  if (EDGE_DIST(kw) < 2) /* Keep winning K away from the edge */
>    score += 4 * (EDGE_DIST(kw)-2);
>  return (ws == side) ? score : -score;
>
>
>I started with the maximum mate distance pos in KQKR, which is mate in 35. White
>played without TBs (and without bitbases), black played with TBs. Game in one
>minute. White could win. I also tried game in 0 with 1s increment, and white won
>again.
>
>Perhaps, in another position, 1 minute would not be enough.
>
>The overhead of adding this should be very little (I did not measure it,
>however). I already have some ifs in eval, where non pawn positions are
>detected, and somwhere inside this, only one further if had to be added.

Why do you use special code for this endgame?

I just use the same 10 lines for all endgames, the common heuristic is to drive
the enemy king to the corner.

In a 5 second game it can mate against itself in tough positions like KQKR and
KBNK, usually with 2 seconds to spare. I haven't tried it against the tables
though, it might need a little more than 5 seconds for a perfect defense.

[Event "WinBoard"]
[Site "Local Event"]
[Result "1-0"]
[Date "05/06/04"]
[White "Frenzee 156.4"]
[Black "Frenzee 156.4"]
[WhiteElo "2400"]
[BlackElo "2400"]
[PlyCount "53"]
[FEN "8/8/K7/B2k4/N7/8/8/8 w - - 0 1"]
[TimeControl "0 0:05 0"]

{hash 58,ponder 0,egtbs 0,threads 1
[moves,time,score,depth/seldepth,mnps,tbhits/tbprobes,pv]}
1.Nc3+ Ke5 	{00:00.03,   6.06,   8/12,  1.07,  0/0,  1...Ke5 2.Kb5 Kf4 3.Kc5 Kg3
4.Kd5 Kh2 5.Ke5 }
2.Kb5 Kf4 	{00:00.03,   6.15,   7/12,  1.14,  0/0,  2...Kf4 3.Kc5 Kg3 4.Kd4 Kh2
5.Ke4 Kh1 }
3.Kc4 Kg3 	{00:00.03,   6.28,   7/12,  1.40,  0/0,  3...Kg3 4.Bc7+ Kg2 5.Kd5 Kh1
6.Ke4 Kg2 7.Nd5 }
4.Ne2+ Kh2 	{00:00.03,   6.29,   7/12,  1.21,  0/0,  4...Kh2 5.Kd4 Kh1 6.Ke4 Kg2
7.Nf4+ }
5.Kd4 Kh1 	{00:00.03,   6.30,   8/12,  1.01,  0/0,  5...Kh1 6.Nf4 Kh2 }
6.Ke4 Kg2 	{00:00.05,   6.36,   9/13,  1.39,  0/0,  6...Kg2 7.Bb6 Kh2 8.Kf3 Kh1
9.Ng3+ Kh2 10.Bd4 Kh3 11.Kf4 Kg2 }
7.Bb6 Kh2 	{00:00.06,   6.40,   9/18,  1.42,  0/0,  7...Kh2 8.Kf3 Kh1 9.Ng3+ Kh2
10.Bd4 Kh3 11.Bg1 Kh4 12.Ne2 Kh3 13.Nf4+ Kh4 14.Bf2+ Kg5 15.Ke4 }
8.Kf3 Kh1 	{00:00.04,   6.40,   9/16,  1.40,  0/0,  8...Kh1 9.Ng3+ Kh2 10.Bd4
Kh3 11.Bg1 Kh4 12.Ne4 Kh3 13.Ng5+ Kh4 14.Kf4 Kh5 15.Bd4 }
9.Ng3+ Kh2 	{-}
10.Bf2 Kh3 	{-}
11.Bg1 Kh4 	{-}
12.Ne4 Kh5 	{00:00.06,   6.50,   8/14,  1.40,  0/0,  12...Kh5 13.Kf4 Kg6 14.Ng5
Kf6 15.Bc5 Kg6 16.Bf2 }
13.Kf4 Kg6 	{00:00.06,   6.55,   8/14,  1.35,  0/0,  13...Kg6 14.Ng5 Kf6 15.Bc5
Kg6 16.Bd4 Kh5 17.Bf2 Kg6 18.Bd4 }
14.Ng5 Kf6 	{00:00.05,   6.55,   8/14,  1.17,  0/0,  14...Kf6 15.Bc5 Kg6 16.Kg4
Kf6 17.Bd6 Kg6 18.Kf4 }
15.Bc5 Kg6 	{00:00.05,   6.66,   9/16,  1.12,  0/0,  15...Kg6 16.Bd4 Kh5 17.Kf5
Kh4 18.Bf2+ Kh5 19.Ne6 Kh6 20.Bc5 }
16.Bd4 Kh5 	{00:00.06,   6.68,   9/16,  1.28,  0/0,  16...Kh5 17.Kf5 Kh4 18.Bf2+
Kh5 19.Ne6 Kh6 20.Be3+ Kh7 21.Kf6 Kg8 22.Bf2 }
17.Kf5 Kh4 	{00:00.05,   6.72,   8/16,  1.31,  0/0,  17...Kh4 18.Bf2+ Kh5 19.Ne6
Kh6 20.Be3+ Kh7 21.Kf6 Kg8 22.Kg6 Kh8 23.Kf6 }
18.Bf2+ Kh5 	{-}
19.Ne6 Kh6 	{-}
20.Be3+ Kh5 	{00:00.06,   6.84,   8/16,  1.44,  0/0,  20...Kh5 21.Nf4+ Kh6
22.Kf6 Kh7 23.Ne6 }
21.Nf4+ Kh6 	{00:00.08,   6.84,   8/15,  1.42,  0/0,  21...Kh6 }
22.Kf6 Kh7 	{-}
23.Ne6 Kg8 	{00:00.03,      #5,  64/ 0,  0.01,  0/0,  23...Kg8 24.Kg6 Kh8 25.Kf7
Kh7 26.Nf8+ Kh8 27.Bd4++}
24.Kg6 Kh8 	{-}
25.Kf7 Kh7 	{-}
26.Nf8+ Kh8 	{-}
27.Bd4++ {White mates} 1-0

[Event "WinBoard"]
[Site "Local Event"]
[Result "1-0"]
[Date "05/06/04"]
[White "Frenzee 156.4"]
[Black "Frenzee 156.4"]
[WhiteElo "2400"]
[BlackElo "2400"]
[PlyCount "53"]
[FEN "8/4kr2/8/8/8/2Q5/2K5/8 w - - 0 1"]
[TimeControl "0 0:05 0"]

{hash 58,ponder 0,egtbs 0,threads 1
[moves,time,score,depth/seldepth,mnps,tbhits/tbprobes,pv]}
1.Kb3 Ke6 	{00:00.06,   5.02,   5/10,  0.42,  0/0,  1.Kb3 Rf8 2.Qe3+ Kd8 3.Kc4
Rf1 }
2.Qc6+ Kf5 	{00:00.03,   5.02,   5/11,  0.63,  0/0,  2.Qc6+ Kf5 3.Qd5+ Kg6 4.Kc4
Rf5 5.Qe4 }
3.Qc8+ Kg5 	{00:00.03,   5.06,   5/11,  0.66,  0/0,  3.Qc8+ Ke5 }
4.Qg8+ Kf6 	{00:00.03,   5.08,   5/12,  0.79,  0/0,  4.Qg8+ Kf6 5.Kc4 Rd7 6.Qe8
}
5.Kc4 Rd7 	{00:00.03,   5.12,   6/12,  0.73,  0/0,  5.Kc4 Rd7 6.Qc8 Rd6 7.Qc5 }
6.Qh8+ Ke6 	{00:00.04,   5.13,   5/11,  0.68,  0/0,  6.Qh8+ Ke6 7.Qe8+ Re7
8.Qg8+ Kf5 9.Qf8+ Ke6 }
7.Qe8+ Kd6 	{00:00.05,   5.20,   6/15,  0.64,  0/0,  7.Qe8+ Re7 8.Qg6+ Ke5
9.Qh5+ Kf6 10.Qh4+ }
8.Kd4 Re7 	{00:00.05,   5.18,   6/14,  0.75,  0/0,  8.Kd4 Re7 9.Qd8+ Ke6 10.Qd5+
Kf6 11.Qd6+ Kf7 }
9.Qd8+ Ke6 	{00:00.05,   5.23,   6/17,  0.82,  0/0,  9.Qd8+ Ke6 10.Kc5 Rg7
11.Qd5+ Kf6 12.Kd6 Kg6 }
10.Qd5+ Kf6 	{00:00.05,   5.20,   6/15,  0.91,  0/0,  10.Qd5+ Kf6 11.Qd6+ Re6
12.Qf4+ Kg6 13.Qg4+ Kf6 14.Kd5 Ra6 15.Qh3 }
11.Qd6+ Re6 	{00:00.06,   5.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   6/15,  1.04,  0/0,  22.Qd7+ Kh6 23.Qc8 Ra5+
24.Kf6 Kh7 25.Qh3+ Kg8 26.Qg4+ Rg5 }
23.Qc8 Ra5+ 	{00:00.07,     #501,   6/15,  0.74,  0/0,  23.Qc8 }
24.Kf6 Ra6+ 	{00:00.05,     #501,   7/15,  0.60,  0/0,  24.Kf6 Rf5+ }
25.Qxa6 Kh5 	{00:00.04,      #3,   7/14,  0.80,  0/0,  25.Qxa6 Kh5 }
26.Qa4 Kh6 	{00:00.05,      #2,   5/18,  0.80,  0/0,  26.Qa4 Kh6 }
27.Qh4++ {White mates} 1-0

-S.






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.