Attack

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Attack

Post by xr_a_y »

In Weini evaluation function, I think I have 4 ways to trigger attacks now :
* pawn shield
* king troppism
* pawn storm
* "space"

I try to tune them so that Weini has a more aggressive style but didn't succeed.

Pawn shield evaluation is clearly able to add some defensive skill, the engine wont push pawns in front of the king easily but if I increase the weight of this feature too much (for example to allow scarifying a minor piece to destroy pawn shield) the engine starts to misbehave and will for example try to create the pawn shield without having castled first, just by moving the king. I will try to apply pawn shield bonus only to castled king ...

King troppism, using values of attacking pieces and distance to square around the king seems very hard to tune for me. As soon as the weight is a little high, the engine starts to "target" the king a lot but without any chance of success. The queen can to out too early (I can penalize that ...), pieces get pinned or forked a lot more.

Pawn storm is hard to tune. A successful pawn storm seems to require a lot of condition. Clearly, that is not my priority.

What I call "space" in the evaluation (this means roughly have more minor and major pieces in the opponent side of the board) is the only thing I can use to make Weini trigger more attacks but this is not that great...

I see some engines around 2400elo really playing more aggressive chess (Isa, Dorpsgek for example).
Top engines (stockfish, texel for example) are taking advantage on Weini very often in less than 20 moves.

Is this coming more from a better search or more from a better evaluation ?
jdart
Posts: 4366
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Attack

Post by jdart »

This can only be tuned by a lot of testing over many, many positions.
It is tricky. If you reward King attacks too much, the engine will just make stupid sacrifices.
Tactical skill in engines is partly the result of good eval terms. If you accurately size up the forces attacking the King and the King's defenders, then you will win games, especially against engines that have poor king safety scoring.
On the other hand, I think the tactical strength of top engines is also due in part to a good selective search. If you prune strongly but not intelligently, you will search deeply but miss a lot of tactical nuances. But if you don't prune enough, you will also miss tactics. The best engines prune and reduce a lot but keep their tactical strength up.

--Jon
Volker Annuss
Posts: 180
Joined: Mon Sep 03, 2007 9:15 am

Re: Attack

Post by Volker Annuss »

I will try to apply pawn shield bonus only to castled king ...
You can also try to apply pawn shield bonus for a king on g1/g8 when the king still has short castling right.
konsolas
Posts: 182
Joined: Sun Jun 12, 2016 5:44 pm
Location: London
Full name: Vincent

Re: Attack

Post by konsolas »

Topple uses attacks to the king instead of king tropism, which allows it to line up threats from a distance, such as by lining up a bishop or aiming at the king with a rook, which increases the success rate of its attacks. I also strongly taper this off as material leaves the board, so Topple doesn't sacrifice excessively or launch attacks without enough material. I think that king tropism is a less reliable parameter because it doesn't acknowledge the possibility of attacks from a distance.
User avatar
xr_a_y
Posts: 1871
Joined: Sat Nov 25, 2017 2:28 pm
Location: France

Re: Attack

Post by xr_a_y »

konsolas wrote: Fri Jul 06, 2018 12:10 pm Topple uses attacks to the king instead of king tropism, which allows it to line up threats from a distance, such as by lining up a bishop or aiming at the king with a rook, which increases the success rate of its attacks. I also strongly taper this off as material leaves the board, so Topple doesn't sacrifice excessively or launch attacks without enough material. I think that king tropism is a less reliable parameter because it doesn't acknowledge the possibility of attacks from a distance.
Yes, Weini uses something like this too, but distance to king plays a role in it :

Code: Select all

for(size_t k = 0 ; k < threats.size() ; ++k){
     w += (ScoreType)((9-distance(s,threats[k]))/8.f * coeff * Piece::Value(p.Get(threats[k])) / 1000.f); 
}
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Attack

Post by Daniel Anulliero »

In Isa , I compute the king's attacks during the computing of the mobility . If a square around the king is reached , the score is increased by a value (queen +4 , rook +2 , bishop and knight +1) , also the number of atackers is increased by +1 .
At the end Isa read the king atack value with an array like this :
Atack [number of atackers][squares score] (the main goal is to tune perfectly this table ... )

As you can see , nothing new or original in the chess computer world :wink:
Dany
Isa download :
tomitank
Posts: 276
Joined: Sat Mar 04, 2017 12:24 pm
Location: Hungary

Re: Attack

Post by tomitank »

Daniel Anulliero wrote: Mon Jul 09, 2018 1:51 pm In Isa , I compute the king's attacks during the computing of the mobility . If a square around the king is reached , the score is increased by a value (queen +4 , rook +2 , bishop and knight +1) , also the number of atackers is increased by +1 .
At the end Isa read the king atack value with an array like this :
Atack [number of atackers][squares score] (the main goal is to tune perfectly this table ... )

As you can see , nothing new or original in the chess computer world :wink:
Dany
You wrote the king safety of Fruit 2.1.
This is good, but there are better solutions too.
Daniel Anulliero
Posts: 759
Joined: Fri Jan 04, 2013 4:55 pm
Location: Nice

Re: Attack

Post by Daniel Anulliero »

tomitank wrote: Mon Jul 09, 2018 3:37 pm
Daniel Anulliero wrote: Mon Jul 09, 2018 1:51 pm In Isa , I compute the king's attacks during the computing of the mobility . If a square around the king is reached , the score is increased by a value (queen +4 , rook +2 , bishop and knight +1) , also the number of atackers is increased by +1 .
At the end Isa read the king atack value with an array like this :
Atack [number of atackers][squares score] (the main goal is to tune perfectly this table ... )

As you can see , nothing new or original in the chess computer world :wink:
Dany
You wrote the king safety of Fruit 2.1.
This is good, but there are better solutions too.
Yes I'm reinventing the wheel lol .
More seriously , in fruit , there is not an atack table , it's just weighted by the number of atackers and the number and the type of the square around the king is not equal to fruit ( just the square of one distance in fruit) but sure you're true the two methods are very close .
Isa download :