Toga Knight Outpost

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

User avatar
Rebel
Posts: 6946
Joined: Thu Aug 18, 2011 12:04 pm

Re: Toga Knight Outpost

Post by Rebel »

Gerd Isenberg wrote:
Rebel wrote:
jd1 wrote:Hi Ben,

Welcome to computer chess programming!

As probably the only active developer of Toga II, here are my comments:

1. You have introduced a penalty for a knight attacked or attackable by a pawn. This is something which dan be improved and in the latest version, soon to be released, I do not score outposts attacked by a pawn.
About the latter, if a knight can be attacked by an enemy pawn it can't be called an outpost. YMMV. When there is a white knight on d5 and there is a black pawn on c6/c7 | e6/e7 I don't reward an outpost bonus.
Hi Ed,
that seems the usual definition as implemented in computer chess, but see Nimzowitsch's classical definition of the Outpost, provoking to weaken an opponent pawn on a half-open file no longer "Biting on Granite".

https://chessprogramming.wikispaces.com/Outposts
Hi Gerd,

The voice of the late great Aron :lol:

The regular WIKI - An outpost is a square which is protected by a pawn and which cannot be attacked by an opponent's pawn.

The logic of "Biting on Granite" is understood but the kind of strategic knowledge impossible (I think) to grasp for a chess engine. Nevertheless it would be interesting to try it. I made a note.

I don't even check for the pawn protection. Search will go after that knight anyway and trade when possible. So typical for implementing knowledge, keep it simple and the bonus not too high, search will do the rest in most cases.
Tennison
Posts: 183
Joined: Sat Nov 26, 2011 2:02 pm

Re: Toga Knight Outpost

Post by Tennison »

jd1 wrote:Hi Ben,

That is promising!

I wonder whether you could also test afterwards not giving a bonus at all to an attacked knight outpost? From my (~2100 elo) chess knowledge this would seem most logical. To do that just set KOM_multi = 0 if attacker > 0.

Also, could you test the current Toga II 1.9e knight outpost code against yours:

Code: Select all

// outpost
            mob = 0;
            if (me == White && (board->square[from+17] != BP && board->square[from+15] != BP)){// not attacked: idea from William H. Mowery
                if (board->square[from-17] == WP)
                    mob += KnightOutpostMatrix[me][SquareTo64[from]]; 
                if (board->square[from-15] == WP)
                    mob += KnightOutpostMatrix[me][SquareTo64[from]]; 
            }
            else if (me == Black && (board->square[from-17] != WP && board->square[from-15] != WP)){
                if (board->square[from+17] == BP)
                    mob += KnightOutpostMatrix[me][SquareTo64[from]]; 
                if (board->square[from+15] == BP)
                    mob += KnightOutpostMatrix[me][SquareTo64[from]]; 
            } 

            op[me] += mob;
The current code still doubles the bonus for a twice defended outpost. I also feel that the value in the table KnightOutpostMatrix are rather small - also on my TODO list!

Whichever code is best will be used in the forthcoming release of Toga II 2.0, currently about 30-50 elo stronger than 1.4 beta 5c. Your contribution will of course be noted :D

Thanks a lot,
Jerry
I'm trying this part of code in new test. I also mix this with mine as this :

Code: Select all

            if (me == White && (board->square[from+17] != BP && board->square[from+15] != BP)){// not attacked: idea from William H. Mowery
                if (board->square[from-17] == WP)
                    defender+=1; 
                if (board->square[from-15] == WP)
                    defender+=1;

                if ((board->square[from+33] == BP) && (board->square[from+17] != WP)) attacker+=1;
                if ((board->square[from+31] == BP) && (board->square[from+15] != WP)) attacker+=1;

            }
            else if (me == Black && (board->square[from-17] != WP && board->square[from-15] != WP)){
                if (board->square[from+17] == BP)
                    defender+=1;
                if (board->square[from+15] == BP)
                    defender+=1;

                if ((board->square[from-33] == WP) && (board->square[from-17] != BP)) attacker+=1;
                if ((board->square[from-31] == WP) && (board->square[from-15] != BP)) attacker+=1;

            }


            if (defender==1) KOM_multi+= 6; // protected 1 and not directly attacked
            else if (defender==2) KOM_multi+= 10; // protected 2 and not directly attacked

            if (attacker == 1) KOM_multi-= 2; // could be attacked 1
            else if (attacker == 2) KOM_multi-= 3; // could be attacked 2

            mob+= KnightOutpostMatrix[me][SquareTo64[from]]*KOM_multi/4;
I have to test the values ...

Test in progress.
Tennison
Posts: 183
Joined: Sat Nov 26, 2011 2:02 pm

Re: Toga Knight Outpost

Post by Tennison »

Thanks to Ed and Gerd.

I also known the Nimzowitsh version. ;-)

But, in original version, Toga don't test if Knight can or can't be attacked by pawns.

It's why I want to introduce such a test.
Tennison
Posts: 183
Joined: Sat Nov 26, 2011 2:02 pm

Re: Toga Knight Outpost

Post by Tennison »

Here is a partial result but it seems not so bad ... Let's Wait and See ... ;-)

Code: Select all

Games Completed = 1600 of 14840

Settings = Gauntlet/128MB/10ms per move/M 1000cp for 12 moves, D 150 moves/EPD:8moves.epd(3710)

 1.   Toga Returns 1.32 Base  	766.0/1600	579-647-374  	(L: m=647 t=0 i=0 a=0)	(D: r=244 i=81 f=35 s=2 a=12)	(tpm=22.9 d=5.8 nps=0)
 2.   Toga Returns Outpost v1.9	412.0/800	318-294-188  	(L: m=293 t=0 i=0 a=1)	(D: r=123 i=39 f=20 s=1 a=5)	(tpm=22.8 d=5.8 nps=0)
 3.   Toga Returns mix 1.9	422.0/800	329-285-186  	(L: m=285 t=0 i=0 a=0)	(D: r=121 i=42 f=15 s=1 a=7)	(tpm=22.9 d=5.8 nps=0)
But with these values in mix version :
if (defender==1) KOM_multi+= 5;
else if (defender==2) KOM_multi+= 8;

if (attacker == 1) KOM_multi-= 1;
else if (attacker == 2) KOM_multi-= 2;
jd1
Posts: 269
Joined: Wed Oct 24, 2012 2:07 am

Re: Toga Knight Outpost

Post by jd1 »

Thanks Ben for the test. Looking forward to the final results!

Jerry
jd1
Posts: 269
Joined: Wed Oct 24, 2012 2:07 am

Re: Toga Knight Outpost

Post by jd1 »

Thanks Michel for your kind words! The modifications are not trivial but they are not that extensive either - just a few bugfixes and new features.

BTW, you are doing great work on GNUChess 5 :)

Jerry
Tennison
Posts: 183
Joined: Sat Nov 26, 2011 2:02 pm

Re: Toga Knight Outpost

Post by Tennison »

Current Version gives 51.7% after 3172 games ;-)
Tennison
Posts: 183
Joined: Sat Nov 26, 2011 2:02 pm

Re: Toga Knight Outpost

Post by Tennison »

Development Version 1.55 ( With Knight and Bishop Outpost ) :

Currently :

Code: Select all

Games Completed = 500 of 5000 
Settings = Gauntlet/128MB/10ms per move/M 1000cp for 12 moves, D 150 moves/EPD:8moves.epd(3710)

 1.   Toga Returns Base  	224.0/500	155-207-138  	(L: m=206 t=0 i=0 a=1)	(D: r=98 i=21 f=18 s=1 a=0)	(tpm=30.1 d=6.6 nps=0)
 2.   Toga Returns 1.55       	276.0/500	207-155-138  	(L: m=155 t=0 i=0 a=0)	(D: r=98 i=21 f=18 s=1 a=0)	(tpm=30.1 d=6.7 nps=0)
This means : 56,2% !!!
Elo gain : +35/+40

I hope this will continue like this. ;-)
Tennison
Posts: 183
Joined: Sat Nov 26, 2011 2:02 pm

Re: Toga Knight Outpost

Post by Tennison »

Finally, not so good results for development 1.55.

I have to refine the values ... :-(

After 2566 games, scores falls down to 51,3%.
Tennison
Posts: 183
Joined: Sat Nov 26, 2011 2:02 pm

Re: Toga Knight Outpost

Post by Tennison »

I think I have the best I can, for the moment, with the Knight Outpost and Knight Eval.

DV is Development Version (these numbers aren't Released Version).

All the scores are against Base Version (DV1.00) and after 5000 games for each DV.

DV 1.49b = 51,43 %
DV 1.49i = 51,60 %
DV 1.62 = 52,35 %
DV 1.65 = 52,75 %

Maybe I can again have some small improvment with tuning but I'll do this later.

Now I try to find other parts of code to improve. ;-)