Greetings,
Long time lurker, second time poster. For the past couple of weeks I've been tweaking the Glaurung 2.1 config to play aggressive, speculative and most importantly -- attractive chess. She's the perfect candidate for this kind of experiment because her style of chess is already much more attractive than most other engines. My reason for posting is that I wanted to share a remarkable game of online correspondence chess that shows Glaurung's fantastic fighting spirit.
I haven't been involved with computer chess for very long but the following is one of the prettiest engine games I've ever seen. Glaurung 2.1 launches a blistering, speculative attack on the black King and Queen and in the process she sacrifices a Rook, a Bishop and a Knight in return for a Queen, pawns and position. Ultimately, the attack proved to be somewhat dubious which means that I'll probably need to tone down the aggression a little in my UCI config, but this result is very promising and entertaining regardless.
It would really help if the UCI options were documented so I better understand the cause/effect of changing different parameters. (Hint, hint, nudge, nudge!)
For your enjoyment, here's the game. The fireworks begin at move 17:
[Event "?"]
[Site "?"]
[Date "2008.05.26"]
[Round "?"]
[White "Glaurung 2.1"]
[Black "Unknown Online Opponent"]
[Result "1/2-1/2"]
[ECO "D10"]
[PlyCount "134"]
[EventDate "2008.??.??"]
[EventType "corr"]
[TimeControl "1"]
1. e4 c5 2. d4 cxd4 3. c3 Nc6 4. cxd4 d5 5. Nc3 e6 6. exd5 exd5 7. Nf3 Bb4 8.
Bd3 Nge7 9. Be3 Nf5 10. Bf4 Nce7 11. Qa4+ Nc6 12. O-O O-O 13. Qb3 Nfe7 14. a3
Ba5 15. Rfe1 Bb6 16. Nb5 Be6 17. Bxh7+ Kxh7 18. Ng5+ Kg8 19. Rxe6 fxe6 20. Qh3
Rxf4 21. Qh7+ Kf8 22. Qh8+ Ng8 23. Nxe6+ Kf7 24. Nxd8+ Rxd8 25. Qh5+ Kf8 26.
Re1 Nf6 27. Qg5 Re4 28. Rxe4 dxe4 29. Nc3 Bxd4 30. Kf1 Kf7 31. Qb5 Rd7 32. Qc4+
Kg6 33. Nxe4 Nxe4 34. Qc2 Re7 35. f3 Kg5 36. fxe4 Rf7+ 37. Ke1 Rf2 38. Qb3 Rxb2
39. Qf3 Bf6 40. Qf5+ Kh6 41. Kf1 Rb1+ 42. Kf2 a6 43. Qh3+ Kg6 44. Qe6 Kh7 45.
Qf7 Kh6 46. Kg3 Ne5 47. Qg8 g5 48. Qf8+ Bg7 49. Qd6+ Ng6 50. Qe6 Rb2 51. Kh3
Be5 52. g3 Re2 53. Qd5 b5 54. Qb7 Ra2 55. Qxa6 Kh5 56. Qe6 Rxa3 57. Kg2 b4 58.
Qh3+ Nh4+ 59. Kf1 Ra1+ 60. Ke2 Rh1 61. Kd3 Rc1 62. Ke2 Rc3 63. Qd7 Nf3 64. Qh7+
Kg4 65. Qd7+ Kh5 66. Qh7+ Kg4 67. Qd7+ Kh5 1/2-1/2
The Fighting Spirit of Glaurung
Moderators: hgm, Dann Corbit, Harvey Williamson
-
Ovyron
- Posts: 4556
- Joined: Tue Jul 03, 2007 4:30 am
Re: The Fighting Spirit of Glaurung
Could you share the settings for Glaurung? On my computer it's not yet up to the aggressiveness of Toga Chekov:
[Date "2008.05.27"]
[Round "1.1"]
[White "Glaurung 2.1 (JA)"]
[Black "Toga II 3.1.2SE JA Chekov"]
[Result "1-0"]
[Annotator "1. +0.19 1... +0.15"]
[PlyCount "157"]
[TimeControl "60+7"]
{Pondering=Off} 1. Nf3 {0.19/15 12}
d5 {0.15/14 9} 2. e3 {0.17/14 9} e6 {0.19/13 5} 3. Nc3 {0.17/14 10} Nf6 {
0.18/13 8} 4. d4 {0.19/14 9} Bb4 {0.08/13 6} 5. Bd2 {0.19/14 8} c5 {0.03/12 6}
6. Be2 {0.11/13 9} Nc6 {-0.04/13 5} 7. O-O {-0.01/14 8} O-O {0.09/13 5} 8. a3 {
0.07/14 9} Bxc3 {0.09/13 7} 9. Bxc3 {0.11/15 5} Ne4 {0.08/14 8} 10. Qe1 {
0.03/15 10} Qe7 {0.13/13 8} 11. Bd3 {0.01/15 9} Nxc3 {0.10/13 15} 12. Qxc3 {
-0.03/15 8} c4 {0.15/15 19} 13. Be2 {0.00/15 7} Bd7 {0.15/13 7} 14. b3 {
0.11/15 8} cxb3 {0.12/13 7} 15. cxb3 {0.21/14 7} Rac8 {0.07/14 8} 16. Qb2 {
0.29/14 7} f6 {0.09/13 7} 17. Rac1 {0.25/14 7} e5 {0.03/11 5} 18. Rfd1 {
0.35/14 6} e4 {0.05/13 4} 19. Ne1 {0.00/15 7} f5 {-0.09/13 8} 20. g3 {0.07/14 5
} g5 {0.01/13 7} 21. Ng2 {0.05/14 7} Kh8 {-0.15/13 7} 22. Bb5 {0.13/12 7} f4 {
-0.74/12 12} 23. exf4 {0.58/13 5} gxf4 {-0.77/11 6} 24. Nxf4 {-0.72/13 7} Rxf4
{-1.78/10 7} 25. gxf4 {-0.74/13 6} Rg8+ {-2.77/11 6} 26. Kh1 {-0.25/16 7} Bg4 {
-0.10/14 9} 27. Be2 {-0.11/15 7} Qh4 {0.05/14 9} 28. Rf1 {0.35/15 7} Rg6 {
0.00/13 6} 29. Bxg4 {0.49/15 7} Qxg4 {0.00/13 7} 30. f3 {0.45/13 0} exf3 {
0.00/13 7} 31. Rf2 {0.43/15 6} Qxf4 {0.00/11 7} 32. Qd2 {0.76/14 8} Qxd2 {
0.39/13 8} 33. Rxd2 {0.96/12 0} Rg4 {0.68/14 5} 34. h3 {1.23/15 5} Re4 {
0.86/14 8} 35. Rcd1 {1.35/15 6} Rf4 {1.01/13 4} 36. Kh2 {1.92/16 7} Kg7 {
1.32/14 6} 37. Kg3 {1.90/17 7} Re4 {1.23/14 4} 38. Kxf3 {1.82/17 10} Kf6 {
1.22/14 7} 39. b4 {1.68/16 9} a6 {1.22/15 6} 40. Rd3 {1.60/16 5} h6 {1.18/15 7}
41. Kf2 {1.60/16 9} h5 {1.15/15 6} 42. Kg1 {1.58/16 8} Ke6 {1.13/14 7} 43. Kf2
{1.52/16 6} Kf6 {0.00/20 7} 44. Kf3 {1.50/16 6} Kf5 {1.15/15 7} 45. R1d2 {
1.54/17 5} b6 {1.23/14 8} 46. Kf2 {2.07/16 6} b5 {1.59/14 7} 47. Rf3+ {
2.05/19 7} Kg5 {1.62/15 7} 48. Rc3 {2.29/15 8} Ne7 {1.62/15 4} 49. Re2 {
2.31/16 8} Nf5 {1.23/14 4} 50. Rxe4 {2.54/18 6} dxe4 {1.75/15 2} 51. d5 {
2.84/19 8} Kf4 {1.79/18 6} 52. Rc6 {2.82/19 7} e3+ {1.78/18 8} 53. Kg2 {
3.13/19 7} Ke5 {1.78/17 7} 54. Rxa6 {3.15/19 7} Kxd5 {2.12/18 5} 55. Kf3 {
3.43/19 6} Kc4 {2.52/18 6} 56. Rf6 {3.74/19 7} Ne7 {2.58/18 7} 57. Rh6 {
5.15/19 6} Kd3 {3.35/18 7} 58. Rxh5 {5.56/18 7} Nc6 {3.47/17 6} 59. Rd5+ {
74.79/23 7} Nd4+ {4.86/18 7} 60. Rxd4+ {74.79/24 5} Kxd4 {12.85/21 6} 61. Ke2 {
74.80/25 6} Ke4 {21.87/22 23} 62. h4 {88.06/25 7} Kf4 {20.84/19 7} 63. h5 {
88.06/24 5} Kg5 {22.69/21 5} 64. Kxe3 {88.06/24 6} Kxh5 {22.54/20 7} 65. Kd4 {
99.16/25 8} Kg5 {#17/22 7} 66. Kc5 {#15/24 8} Kf4 {#15/22 4} 67. Kxb5 {#14/22 5
} Ke5 {#14/21 7} 68. Kc6 {#13/19 1} Kd4 {#12/20 5} 69. b5 {#11/19 4} Ke5 {
#11/20 7} 70. b6 {#11/17 2} Kd4 {#10/18 7} 71. b7 {#10/15 2} Ke4 {#8/17 5} 72.
b8=Q {88.31/10 0} Kf3 {#7/20 5} 73. Kd5 {#7/12 0} Ke3 {#6/25 4} 74. Qg3+ {
#6/9 0} Kd2 {#5/63 3} 75. Kc4 {#5/8 0} Ke2 {#4/63 0} 76. Kd4 {#4/6 0} Kf1 {
#3/63 0} 77. Qh2 {#3/6 0} Ke1 {#2/4 0} 78. Ke3 {#2/6 0} Kf1 {#1/63 0} 79. Qh1#
{#1/6 0 Checkmate !!} 1-0
(Here we're talking about playing style, not strength. In this game Glaurung won but Toga played more attractively.)
[Date "2008.05.27"]
[Round "1.1"]
[White "Glaurung 2.1 (JA)"]
[Black "Toga II 3.1.2SE JA Chekov"]
[Result "1-0"]
[Annotator "1. +0.19 1... +0.15"]
[PlyCount "157"]
[TimeControl "60+7"]
{Pondering=Off} 1. Nf3 {0.19/15 12}
d5 {0.15/14 9} 2. e3 {0.17/14 9} e6 {0.19/13 5} 3. Nc3 {0.17/14 10} Nf6 {
0.18/13 8} 4. d4 {0.19/14 9} Bb4 {0.08/13 6} 5. Bd2 {0.19/14 8} c5 {0.03/12 6}
6. Be2 {0.11/13 9} Nc6 {-0.04/13 5} 7. O-O {-0.01/14 8} O-O {0.09/13 5} 8. a3 {
0.07/14 9} Bxc3 {0.09/13 7} 9. Bxc3 {0.11/15 5} Ne4 {0.08/14 8} 10. Qe1 {
0.03/15 10} Qe7 {0.13/13 8} 11. Bd3 {0.01/15 9} Nxc3 {0.10/13 15} 12. Qxc3 {
-0.03/15 8} c4 {0.15/15 19} 13. Be2 {0.00/15 7} Bd7 {0.15/13 7} 14. b3 {
0.11/15 8} cxb3 {0.12/13 7} 15. cxb3 {0.21/14 7} Rac8 {0.07/14 8} 16. Qb2 {
0.29/14 7} f6 {0.09/13 7} 17. Rac1 {0.25/14 7} e5 {0.03/11 5} 18. Rfd1 {
0.35/14 6} e4 {0.05/13 4} 19. Ne1 {0.00/15 7} f5 {-0.09/13 8} 20. g3 {0.07/14 5
} g5 {0.01/13 7} 21. Ng2 {0.05/14 7} Kh8 {-0.15/13 7} 22. Bb5 {0.13/12 7} f4 {
-0.74/12 12} 23. exf4 {0.58/13 5} gxf4 {-0.77/11 6} 24. Nxf4 {-0.72/13 7} Rxf4
{-1.78/10 7} 25. gxf4 {-0.74/13 6} Rg8+ {-2.77/11 6} 26. Kh1 {-0.25/16 7} Bg4 {
-0.10/14 9} 27. Be2 {-0.11/15 7} Qh4 {0.05/14 9} 28. Rf1 {0.35/15 7} Rg6 {
0.00/13 6} 29. Bxg4 {0.49/15 7} Qxg4 {0.00/13 7} 30. f3 {0.45/13 0} exf3 {
0.00/13 7} 31. Rf2 {0.43/15 6} Qxf4 {0.00/11 7} 32. Qd2 {0.76/14 8} Qxd2 {
0.39/13 8} 33. Rxd2 {0.96/12 0} Rg4 {0.68/14 5} 34. h3 {1.23/15 5} Re4 {
0.86/14 8} 35. Rcd1 {1.35/15 6} Rf4 {1.01/13 4} 36. Kh2 {1.92/16 7} Kg7 {
1.32/14 6} 37. Kg3 {1.90/17 7} Re4 {1.23/14 4} 38. Kxf3 {1.82/17 10} Kf6 {
1.22/14 7} 39. b4 {1.68/16 9} a6 {1.22/15 6} 40. Rd3 {1.60/16 5} h6 {1.18/15 7}
41. Kf2 {1.60/16 9} h5 {1.15/15 6} 42. Kg1 {1.58/16 8} Ke6 {1.13/14 7} 43. Kf2
{1.52/16 6} Kf6 {0.00/20 7} 44. Kf3 {1.50/16 6} Kf5 {1.15/15 7} 45. R1d2 {
1.54/17 5} b6 {1.23/14 8} 46. Kf2 {2.07/16 6} b5 {1.59/14 7} 47. Rf3+ {
2.05/19 7} Kg5 {1.62/15 7} 48. Rc3 {2.29/15 8} Ne7 {1.62/15 4} 49. Re2 {
2.31/16 8} Nf5 {1.23/14 4} 50. Rxe4 {2.54/18 6} dxe4 {1.75/15 2} 51. d5 {
2.84/19 8} Kf4 {1.79/18 6} 52. Rc6 {2.82/19 7} e3+ {1.78/18 8} 53. Kg2 {
3.13/19 7} Ke5 {1.78/17 7} 54. Rxa6 {3.15/19 7} Kxd5 {2.12/18 5} 55. Kf3 {
3.43/19 6} Kc4 {2.52/18 6} 56. Rf6 {3.74/19 7} Ne7 {2.58/18 7} 57. Rh6 {
5.15/19 6} Kd3 {3.35/18 7} 58. Rxh5 {5.56/18 7} Nc6 {3.47/17 6} 59. Rd5+ {
74.79/23 7} Nd4+ {4.86/18 7} 60. Rxd4+ {74.79/24 5} Kxd4 {12.85/21 6} 61. Ke2 {
74.80/25 6} Ke4 {21.87/22 23} 62. h4 {88.06/25 7} Kf4 {20.84/19 7} 63. h5 {
88.06/24 5} Kg5 {22.69/21 5} 64. Kxe3 {88.06/24 6} Kxh5 {22.54/20 7} 65. Kd4 {
99.16/25 8} Kg5 {#17/22 7} 66. Kc5 {#15/24 8} Kf4 {#15/22 4} 67. Kxb5 {#14/22 5
} Ke5 {#14/21 7} 68. Kc6 {#13/19 1} Kd4 {#12/20 5} 69. b5 {#11/19 4} Ke5 {
#11/20 7} 70. b6 {#11/17 2} Kd4 {#10/18 7} 71. b7 {#10/15 2} Ke4 {#8/17 5} 72.
b8=Q {88.31/10 0} Kf3 {#7/20 5} 73. Kd5 {#7/12 0} Ke3 {#6/25 4} 74. Qg3+ {
#6/9 0} Kd2 {#5/63 3} 75. Kc4 {#5/8 0} Ke2 {#4/63 0} 76. Kd4 {#4/6 0} Kf1 {
#3/63 0} 77. Qh2 {#3/6 0} Ke1 {#2/4 0} 78. Ke3 {#2/6 0} Kf1 {#1/63 0} 79. Qh1#
{#1/6 0 Checkmate !!} 1-0
(Here we're talking about playing style, not strength. In this game Glaurung won but Toga played more attractively.)
-
Eraserheads
- Posts: 235
- Joined: Fri Mar 10, 2006 9:19 am
- Location: Quezon City, Philippines
Re: The Fighting Spirit of Glaurung
Hi Ulysses,
Even with a wild animal like Glaurung, I don't think it is possible for it to play aggressively all the time, or any engine for that matter.
Even with a wild animal like Glaurung, I don't think it is possible for it to play aggressively all the time, or any engine for that matter.
-
Ovyron
- Posts: 4556
- Joined: Tue Jul 03, 2007 4:30 am
Re: The Fighting Spirit of Glaurung
Yes, but at least Thinker plays extremely aggressive most of the time.Eraserheads wrote:Even with a wild animal like Glaurung, I don't think it is possible for it to play aggressively all the time, or any engine for that matter.
-
Eastendboy
Re: The Fighting Spirit of Glaurung
Sure. I'll post the settings when I return home from a business trip in a few days.Ovyron wrote:Could you share the settings for Glaurung? On my computer it's not yet up to the aggressiveness of Toga Chekov:
I've noticed that Glaurung tends to play much more aggressively when the Queen's are still on the board. It's quite possible that I'm seeing patterns where none exist, but I've been spending a lot of time with Glaurung these last few weeks and I've noticed time and time again that without the Queen's her play style is what I would call "solid" rather than "aggressive". If I had to guess, I'd say that the King Safety is somehow linked to whether or not the Queen's are still in play. Perhaps someone who actually knows what they're talking about can declare whether or not I'm hallucinating or not?
And if such person happens upon this thread perhaps they'd be so kind as to tell me what the King Safety X Intercept UCI option does/is?
-
Tord Romstad
- Posts: 1808
- Joined: Wed Mar 08, 2006 9:19 pm
- Location: Oslo, Norway
Re: The Fighting Spirit of Glaurung
That's a very impressive observation. You are entirely right, Glaurung's king safety is switched off when the attacking side does not have a queen. Whether this is a good idea is not clear, I'll have to test it some day. Perhaps there should have been a UCI parameter for controlling this...Eastendboy wrote:I've noticed that Glaurung tends to play much more aggressively when the Queen's are still on the board. It's quite possible that I'm seeing patterns where none exist, but I've been spending a lot of time with Glaurung these last few weeks and I've noticed time and time again that without the Queen's her play style is what I would call "solid" rather than "aggressive". If I had to guess, I'd say that the King Safety is somehow linked to whether or not the Queen's are still in play. Perhaps someone who actually knows what they're talking about can declare whether or not I'm hallucinating or not?
OK, I'll try to explain how the king safety evaluation works, and what all the king safety related UCI options mean:And if such person happens upon this thread perhaps they'd be so kind as to tell me what the King Safety X Intercept UCI option does/is?
The king safety begins by counting a number of "attack units" which quantify how strong the attack against the king is. The attack units are computed as follows:
- Initialize by a simple arithmetic formula based on the number and the values of the attacking pieces, and on the number of attacked and undefended squares around the king.
- Add a piece-square-table value based on the position of the king (big values for squares in the middle of the board, small values near the corners on the first rank (from the defenders point of view)).
- Subtract a number based on the strength of the pawn shield in front of the king.
- Add the number of safe queen contact checks, multiplied by the value of the UCI parameter "Queen Contact Check Bonus". Do the same for safe rook contact checks, distant checks for each piece types, discovered checks, and mate threats.
Code: Select all
SafetyTable[u] = a * (u-b) * (u-b)Tord
-
Eastendboy
Re: The Fighting Spirit of Glaurung
I'm just happy to know that the 2 years of my life I spent as a software QA analyst weren't two years wasted.Tord Romstad wrote: That's a very impressive observation. You are entirely right, Glaurung's king safety is switched off when the attacking side does not have a queen.
OK, I'll try to explain how the king safety evaluation works, and what all the king safety related UCI options mean:
The king safety begins by counting a number of "attack units" which quantify how strong the attack against the king is. The attack units are computed as follows:Finally, the number of attack units is used to index a lookup table of scores. There are several UCI parameters for controlling the contents of this lookup table. The table is initialized by the formuls
- Initialize by a simple arithmetic formula based on the number and the values of the attacking pieces, and on the number of attacked and undefended squares around the king.
- Add a piece-square-table value based on the position of the king (big values for squares in the middle of the board, small values near the corners on the first rank (from the defenders point of view)).
- Subtract a number based on the strength of the pawn shield in front of the king.
- Add the number of safe queen contact checks, multiplied by the value of the UCI parameter "Queen Contact Check Bonus". Do the same for safe rook contact checks, distant checks for each piece types, discovered checks, and mate threats.
where 'u' is the number of attack units, 'a' is the value of the UCI parameter "King Safety Coefficient" divided by 100, and 'b' is the value of "King Safety X Intercept". In the next step, the entries in the upper part of the table are adjusted so that SafetyTable[u+1] - SafetyTable is never bigger than the value of "King Safety Max Slope". Finally, the values are capped, so that the maximum value is equal to the value of "King Safety Max Value".Code: Select all
SafetyTable[u] = a * (u-b) * (u-b)
Tord
Thank you for taking the time to post such a detailed explanation of how King Safety works. That's exactly the kind of information I was hoping for. I had to read through it more times than I care to admit before it sunk in, but I no longer feel as though I'm poking around in the dark when fiddling with the King Safety settings.
One last question that comes to mind: Is there a relationship between King Safety and the Aggressiveness/Cowardice settings?
Regards,
Roy
p.s. Thanks for Glaurung too!
-
Eastendboy
Re: The Fighting Spirit of Glaurung
I'm just happy to know that the 2 years of my life I spent as a software QA analyst weren't two years wasted.Tord Romstad wrote: That's a very impressive observation. You are entirely right, Glaurung's king safety is switched off when the attacking side does not have a queen.
OK, I'll try to explain how the king safety evaluation works, and what all the king safety related UCI options mean:
The king safety begins by counting a number of "attack units" which quantify how strong the attack against the king is. The attack units are computed as follows:Finally, the number of attack units is used to index a lookup table of scores. There are several UCI parameters for controlling the contents of this lookup table. The table is initialized by the formuls
- Initialize by a simple arithmetic formula based on the number and the values of the attacking pieces, and on the number of attacked and undefended squares around the king.
- Add a piece-square-table value based on the position of the king (big values for squares in the middle of the board, small values near the corners on the first rank (from the defenders point of view)).
- Subtract a number based on the strength of the pawn shield in front of the king.
- Add the number of safe queen contact checks, multiplied by the value of the UCI parameter "Queen Contact Check Bonus". Do the same for safe rook contact checks, distant checks for each piece types, discovered checks, and mate threats.
where 'u' is the number of attack units, 'a' is the value of the UCI parameter "King Safety Coefficient" divided by 100, and 'b' is the value of "King Safety X Intercept". In the next step, the entries in the upper part of the table are adjusted so that SafetyTable[u+1] - SafetyTable is never bigger than the value of "King Safety Max Slope". Finally, the values are capped, so that the maximum value is equal to the value of "King Safety Max Value".Code: Select all
SafetyTable[u] = a * (u-b) * (u-b)
Tord
Thank you for taking the time to post such a detailed explanation of how King Safety works. That's exactly the kind of information I was hoping for. I had to read through it more times than I care to admit before it sunk in, but I no longer feel as though I'm poking around in the dark when fiddling with the King Safety settings.
One last question that comes to mind: Is there a relationship between King Safety and the Aggressiveness/Cowardice settings?
Regards,
Roy
p.s. Thanks for Glaurung too!
-
Eelco de Groot
- Posts: 4556
- Joined: Sun Mar 12, 2006 2:40 am
- Full name:
Re: The Fighting Spirit of Glaurung
Yes there is this link if I may answer your question for Tord, together the Aggressiveness and Cowardice determine the weight of the King Safety function. Aggressiveness is the weight for all the attacks on the enemy King, Cowardice weights attacks on the own King, so more Cowardice should mean more defensive actions by Glaurung. If the two numbers are not the same, this creates asymmetry in the evaluation, but it is not clear to me if this hurts the strength of the program. Why this would be so or why it only has a limited effect on playing strength, although the values for King Safety in some situations can be huge I do not know, and maybe a certain asymmetric King Safety evaluation because of two moderately or even very different numbers for Cowardice and Aggressiveness would actually be best, but it is not clear to me why.Eastendboy wrote: One last question that comes to mind: Is there a relationship between King Safety and the Aggressiveness/Cowardice settings?
Regards,
Roy
p.s. Thanks for Glaurung too!
In Ancalagon the total internal weight for King Safety is even higher than in Glaurung, it is up to about 1250/256 the normal value now! Actually I would never put such high numbers in Toga, but if that is just because the optimal settings for Ancalogon at the moment are totally unclear anyway, or because Glaurung is somehow different somewhere from Toga/Fruit I can not say. Unfortunately Ancalogan has not yet been playing well in its first games so maybe the 1250/256 is really over the top
Regards, Eelco
-
Eelco de Groot
- Posts: 4556
- Joined: Sun Mar 12, 2006 2:40 am
- Full name:
Swindle factor Re: The Fighting Spirit of Glaurung
Tord is preparing for the Open Polish Computerchess Championship I think. Either that or enjoying the Norvegian Summer
Hopefully there will be a new version of Glaurung anyway!
I had a proposal for a small piece of code, but at the moment I am not sure it would have some real effect. I thought that Glaurung should know not to trade material when it is behind, I have not yet found anything to that effect in the code. I have not made much of a search for it though.
A maybe crude way to do this would be giving a small bonus for the number of pieces you have left when the rest of the evaluation is already rather low. What I do not really like in the code is that the treshold value is a bit arbitrary and that suddenly the eval will go up at this point because of the bonus introduced, but not if the treshold is not yet reached. So it introduces a discontinuity in the evaluation. Also it seems expensive to do a whole recount of the material but I don't know a way around that, because you first have to know that your position is bad so you will have to do the normal material (and positional) evaluation, at least once. Only after that you can decide about applying a correction.
The total count of material is divided by 0x100, that is 256 in hexadecimal, so the correction is small compared to the value of one pawn, 0x100 in Glaurung. Bishops are valued a bit higher at the moment than Knights because my assumption was it is in the endgame phase that you have to worry most about keeping enough material when down. Maybe it should be done in the middle game as well?
Have not tested this piece of code yet, at least not with the break statement and phase testing, that may be a bit overdoing it or even incorrect? I called it a SwindleFactor but that is really too grand a name for just a material count, it is just a working title for this piece of code.
Eelco
I had a proposal for a small piece of code, but at the moment I am not sure it would have some real effect. I thought that Glaurung should know not to trade material when it is behind, I have not yet found anything to that effect in the code. I have not made much of a search for it though.
A maybe crude way to do this would be giving a small bonus for the number of pieces you have left when the rest of the evaluation is already rather low. What I do not really like in the code is that the treshold value is a bit arbitrary and that suddenly the eval will go up at this point because of the bonus introduced, but not if the treshold is not yet reached. So it introduces a discontinuity in the evaluation. Also it seems expensive to do a whole recount of the material but I don't know a way around that, because you first have to know that your position is bad so you will have to do the normal material (and positional) evaluation, at least once. Only after that you can decide about applying a correction.
The total count of material is divided by 0x100, that is 256 in hexadecimal, so the correction is small compared to the value of one pawn, 0x100 in Glaurung. Bishops are valued a bit higher at the moment than Knights because my assumption was it is in the endgame phase that you have to worry most about keeping enough material when down. Maybe it should be done in the middle game as well?
Have not tested this piece of code yet, at least not with the break statement and phase testing, that may be a bit overdoing it or even incorrect? I called it a SwindleFactor but that is really too grand a name for just a material count, it is just a working title for this piece of code.
Code: Select all
// Swindle factor
if(phase < PHASE_MIDGAME) {
for(Color c = WHITE; c <= BLACK; c++) {
if(ei.egValue < Value(-0x100 * Sign[c])) {
Value SwindleFactor = Value((pos.queen_count(c) * 100 + pos.rook_count(c) * 50
+ pos.bishop_count(c) * 35 + pos.knight_count(c) * 30 + pos.pawn_count(c) * 10)/0x100);
ei.egValue += Sign[c] * SwindleFactor;
break;
}
}
}