The term "outpost" is confusing, because it is close, but not identical, to a piece in the hole of enemy pawn structure. Nimzowitsch in "Mein System" required a defending pawn and a half-open file, showing explicit examples like white pawns on c2 and e4, black pawns on c7, d6 and e5, white knight on d5. Black might play c7-c6, but then he is saddled with an undefended pawn on d6.
Having said that, I was always better off evaluating "holes" rather than "outposts" (but adding additional bonus for a defending pawn). Furthermore, I know of no program making use of a "half open file" requirement.
Outpost evaluation
Moderators: hgm, Rebel, chrisw
-
- Posts: 893
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
-
- Posts: 6994
- Joined: Thu Aug 18, 2011 12:04 pm
Re: Outpost evaluation
You got itlucasart wrote:Seems you're right:Rebel wrote:I have a parameter for Knight outposts (I don't do Bishop outpost) and my notes state:
[Strong Squares = 125] 0=46.0% | 100=50.0% | 200=48.2% | 150=48.7%
Meaning, when I remove it (value 0) it gives a drop of 4% (28 elo).
Perhaps your bonus is too high?
1/ bishop outpost are probably not a great idea. knight only seems to be better.
2/ my values were too high. As a human player, I tend to think that an outposted enemy knight into my territory, that I can't remove by pawns or exchange is a real menace, sometimes worth a pawn perhaps (maybe even the exchange in certain situations). But that's essentially my "risk aversion": I am worried to make calculation mistakes with this constant menace, so I prefer to pay the price of a pawn to get rid of it. A computer on the other hand makes much less calculation mistakes, so it should have a much smaller risk aversion, hence the smaller value
Typical additions to knight outposts:
1. Don't bonus when the opponent has less than 5 pawns.
2. Extra bonus if the knight is well covered, the opponent can't make a simple R vs N+P sacrifice.
3. Extra bonus if the knight blocks a pawn of the opponent.
-
- Posts: 155
- Joined: Mon Feb 15, 2010 9:33 am
- Location: New Zealand
Re: Outpost evaluation
Thanks for the hint. My previous outpost code was barely effective (less than 5 Elo).Rebel wrote: 1. Don't bonus when the opponent has less than 5 pawns
After I added that condition it began working much better, well enough to be tunable, and I ended up with nearly 20 Elo.
-
- Posts: 1033
- Joined: Sat Feb 04, 2012 10:03 pm
Re: Outpost evaluation
Hi,
So an idea could be :
#define KNIGHT_OUTPOST_BONUS 10
#0. Bonus only if defended by one pawn
#1. Extra bonus if defended by 2 pawns +10
#2. Don't bonus when the opponent has less than 5 pawns -10
#3. Extra bonus if the knight blocks a pawn of the opponent +10
#4. Extra bonus if the Knight is on half-open file +10
Would someone be very nice and post here a code that can be copy/past in Tom Kerrigan's Simple Chess Program (TSCP) eval ? or send me by pm ?
Cheers,
Gab
So an idea could be :
#define KNIGHT_OUTPOST_BONUS 10
#0. Bonus only if defended by one pawn
#1. Extra bonus if defended by 2 pawns +10
#2. Don't bonus when the opponent has less than 5 pawns -10
#3. Extra bonus if the knight blocks a pawn of the opponent +10
#4. Extra bonus if the Knight is on half-open file +10
Would someone be very nice and post here a code that can be copy/past in Tom Kerrigan's Simple Chess Program (TSCP) eval ? or send me by pm ?
Cheers,
Gab
-
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Outpost evaluation
Try this out for a start, basic knight not attacked by enemy pawn and knight protected by friendly pawn, note this is only for white, you take care for the black .gleperlier wrote:Hi,
So an idea could be :
#define KNIGHT_OUTPOST_BONUS 10
#0. Bonus only if defended by one pawn
#1. Extra bonus if defended by 2 pawns +10
#2. Don't bonus when the opponent has less than 5 pawns -10
#3. Extra bonus if the knight blocks a pawn of the opponent +10
#4. Extra bonus if the Knight is on half-open file +10
Would someone be very nice and post here a code that can be copy/past in Tom Kerrigan's Simple Chess Program (TSCP) eval ? or send me by pm ?
Cheers,
Gab
Code: Select all
case KNIGHT:
score[LIGHT] += knight_pcsq[i];
//knight outpost for white
//consider only if it is located inside rank 4 to 6 and file b to g (std board)
if(COL(i) >= 1 && COL(i) <= 6 && ROW(i) <= 4 && ROW(i) >= 2){
//if square i is not attacked by enemy pawn
if(piece[i-9] != PAWN || color[i-9] != DARK){
if(piece[i-7] != PAWN || color[i-7] != DARK){
//visual debug
//print_board();
//printf("square %d, is not attacked by enemy pawn\n", i);
score[LIGHT] += 4;
//add bonus if this knight is protected by friendly pawn
//left pawn
if(piece[i+7] == PAWN && color[i+7] == LIGHT){
score[LIGHT] += 2;
//visual debug
}
//right pawn
if(piece[i+9] == PAWN && color[i+9] == LIGHT){
score[LIGHT] += 2;
//visual debug
}
}
}
}
break;
-
- Posts: 20943
- Joined: Mon Feb 27, 2006 7:30 pm
- Location: Birmingham, AL
Re: Outpost evaluation
Bishop outpost can work. We use one in Crafty, and removing it hurts. But like all eval terms, it requires tuning.lucasart wrote:Seems you're right:Rebel wrote:I have a parameter for Knight outposts (I don't do Bishop outpost) and my notes state:
[Strong Squares = 125] 0=46.0% | 100=50.0% | 200=48.2% | 150=48.7%
Meaning, when I remove it (value 0) it gives a drop of 4% (28 elo).
Perhaps your bonus is too high?
1/ bishop outpost are probably not a great idea. knight only seems to be better.
2/ my values were too high. As a human player, I tend to think that an outposted enemy knight into my territory, that I can't remove by pawns or exchange is a real menace, sometimes worth a pawn perhaps (maybe even the exchange in certain situations). But that's essentially my "risk aversion": I am worried to make calculation mistakes with this constant menace, so I prefer to pay the price of a pawn to get rid of it. A computer on the other hand makes much less calculation mistakes, so it should have a much smaller risk aversion, hence the smaller value
-
- Posts: 1033
- Joined: Sat Feb 04, 2012 10:03 pm
Re: Outpost evaluation
Thanks Ferdinand !
Gab
Gab
-
- Posts: 3232
- Joined: Mon May 31, 2010 1:29 pm
- Full name: lucasart
Re: Outpost evaluation
Thank you Fernando. After so many failed attempts, I finally got a significant improvement with an implementation inspired by your code. Here's what I do in case anyone is interested:Ferdy wrote: Try this out for a start, basic knight not attacked by enemy pawn and knight protected by friendly pawn, note this is only for white, you take care for the black .
Code: Select all
case KNIGHT: score[LIGHT] += knight_pcsq[i]; //knight outpost for white //consider only if it is located inside rank 4 to 6 and file b to g (std board) if(COL(i) >= 1 && COL(i) <= 6 && ROW(i) <= 4 && ROW(i) >= 2){ //if square i is not attacked by enemy pawn if(piece[i-9] != PAWN || color[i-9] != DARK){ if(piece[i-7] != PAWN || color[i-7] != DARK){ //visual debug //print_board(); //printf("square %d, is not attacked by enemy pawn\n", i); score[LIGHT] += 4; //add bonus if this knight is protected by friendly pawn //left pawn if(piece[i+7] == PAWN && color[i+7] == LIGHT){ score[LIGHT] += 2; //visual debug } //right pawn if(piece[i+9] == PAWN && color[i+9] == LIGHT){ score[LIGHT] += 2; //visual debug } } } } break;
1/ if a knight is in the outpost zone (File C->F, Rank 4->6), bonus +2 (centipawns)
2/ if a knight that verifies 1/ is also defended by a friendly pawn then I score an additional +3
And I did the same with bishops with +1 and +2 instead of +2 and +3, and that gave a further (small but significant).
My code is a bit more bitboard oriented and avoids loops:
Code: Select all
static const uint64_t OutPostZone[NB_COLOR] = {
0x00003C3C3C000000ULL, // Rank 4->6, File C->F
0x0000003C3C3C0000ULL // Rank 3->5, File C->F
};
...
/* Knight outposts */
fss = B->b[us][Knight] & OutPostZone[us] & ~B->st->attacks[them][Pawn];
if ((count = count_bit(fss))) {
e->op[us] += count * 2;
e->eg[us] += count * 2;
if ((count = count_bit(fss & B->st->attacks[us][Pawn]))) {
e->op[us] += count * 3;
e->eg[us] += count * 3;
}
}
/* Bishop outposts */
fss = B->b[us][Bishop] & OutPostZone[us] & ~B->st->attacks[them][Pawn];
if ((count = count_bit(fss))) {
e->op[us] += count;
e->eg[us] += count;
if ((count = count_bit(fss & B->st->attacks[us][Pawn]))) {
e->op[us] += count * 2;
e->eg[us] += count * 2;
}
}
-
- Posts: 4833
- Joined: Sun Aug 10, 2008 3:15 pm
- Location: Philippines
Re: Outpost evaluation
Another flavor is even if that piece is not on the outpost zone, if it is located instead in the enemyKingWeakZone, perhaps this can also be applied,
but you have to review if you already have a king tropism scoring.
but you have to review if you already have a king tropism scoring.