Discussion of chess software programming and technical issues.
Moderator: Ras
cdani
Posts: 2204 Joined: Sat Jan 18, 2014 10:24 am
Location: Andorra
Post
by cdani » Mon Aug 17, 2015 11:43 pm
Henk wrote:
Maybe give a penalty if a piece is undefended in middle game. But that may also be too costly.
You know what I will say
For example in Stockfish:
Code: Select all
// Enemies not defended by a pawn and under our attack
weak = pos.pieces(Them)
& ~ei.attackedBy[Them][PAWN]
& ei.attackedBy[Us][ALL_PIECES];
Fast and relative easy with bitboards
Henk
Posts: 7251 Joined: Mon May 27, 2013 10:31 am
Post
by Henk » Tue Aug 18, 2015 12:28 am
cdani wrote: Henk wrote:
Maybe give a penalty if a piece is undefended in middle game. But that may also be too costly.
You know what I will say
For example in Stockfish:
Code: Select all
// Enemies not defended by a pawn and under our attack
weak = pos.pieces(Them)
& ~ei.attackedBy[Them][PAWN]
& ei.attackedBy[Us][ALL_PIECES];
Fast and relative easy with bitboards
I only use bugboards.
Henk
Posts: 7251 Joined: Mon May 27, 2013 10:31 am
Post
by Henk » Tue Aug 18, 2015 3:24 pm
There are even more pins for instance after d3d4 knight can not move for white will play b5b6. So there are pieces that shield weak squares like square c7.
Maybe give a penalty to each weak square. But it might be difficult or expensive to detect weak squares.
[d] 1k1r1bnr/1pp1p3/5pp1/pPN1n2p/2P2B2/3P4/P3BPPP/1R1R2K1 w - - 0 22