benini / scid

Other
44 stars 14 forks source link

Make 'gloss of danger' saner #139

Closed marcin-rzeznicki closed 1 year ago

marcin-rzeznicki commented 1 year ago

Hi, I've been using SCID for quite some time, and it's pretty cool, but one thing irritates me a lot. The gloss of danger (I think that's the name). For instance Screenshot_20230720_204926

In the position above, both Black's d5-pawn and White's e5-pawn are coded red. This is too oversimplified. Yes, the black pawn on d5 is attacked 4 times and defended only 2 times, similarly the white pawn on e5 is attacked 2 times and defended only once. However, none of these captures make much sense as White would simply lose a piece for a pawn trying to capture on d5, ditto Black. Obviously none of the pawns are really in danger.

The same argument can be made for the e6-pawn: yes, it's attacked once and defended once - but it's defended by the f7-pawn, while it's attacked by the f4-knight - so the 'yellow' label does not really make much sense.

I would suggest to take into the account cases like this one (a pawn defended by a pawn and attacked by some pieces), while showing the "danger level"

marcin-rzeznicki commented 1 year ago

Ah, one more example - hope it is going to be helpful in assessing what to do. Screenshot_20230720_210746

In this position the b5-pawn is labelled yellow, as sufficiently defended. Obviously, it's misleading. If it is White's move then 1.Rxb5 simply wins this pawn - Black would not be able to recapture with the queen - if he had recaptured, he would have lost a queen for a rook and a knight = bad. Therefore yellow label is simply misleading

benini commented 1 year ago

It is indeed a simple feature (not authored by me). As you mentioned, it operates by highlighting specific chess pieces based on the number of attacks and defenses they possess.

For more comprehensive analysis it is necessary to use a chess engine. For me, I found that playing a null move (king takes king) can be valuable in revealing potential threats within a given position.

marcin-rzeznicki commented 1 year ago

Yes, I am aware of that. But I'm not advocating for making it "analyze" anything (i.e. to assess tactical soundness of the capture), but for taking into account not just the number of pieces attacking, but their (even simplified) values; for example - pawn < knight <= bishop < rook < queen. This way, it would help to quickly assess the situation when browsing a game, rather than distract by showing absolute nonsense. And there is precedent - the feature correctly identifies pins and batteries

marcin-rzeznicki commented 1 year ago

Well, actually I can try to make it work myself, though it's been ages since I touched tcl. Could you please point me where to look at?

benini commented 1 year ago

Sure:

marcin-rzeznicki commented 1 year ago

Thanks!