benini / scid

Other
43 stars 12 forks source link

Use piece values for 'Gloss of danger ' #152

Open marcin-rzeznicki opened 11 months ago

marcin-rzeznicki commented 11 months ago

See #139

This PR modifies the 'gloss of danger' feature to use relative piece values when showing the danger level

Because a picture is worth thousand words, examples follow:

Example 1

Before Screenshot_20231027_184330

After Screenshot_20231027_184450

Example 2

Before Screenshot_20231027_184713

After Screenshot_20231027_184812

Example 3

Before Screenshot_20231027_185017

After Screenshot_20231027_185055

I think these examples show adequately what the feature is about. In my humble opinion, this is an improvement compared to the original version.

The PR also adds tests of the new implementation.

benini commented 10 months ago

I'm not sure if this is an improvement. The core idea of this feature is to highlight dangers and threats. For example in this video I like that the pawn on f2 turns yellow when it is attacked by the bishop; even if it cannot be captured at the moment, it's a potential threat. And I also think it's correct that it turns green after castling. In your first example, in my opinion the knight on f3 shouldn't be yellow. I prefer the current behavior: it is green, but turns yellow after a move like g3 and goes back to green after Bg2 (with this patch it always stay yellow). It's even more evident in your third example. The pawn on g4 should be yellow because it doesn't matter if a knight is worth more than a pawn. The threat is capturing it with a move like Rg6+. Here's a description of a similar function implemented by Chessbase: https://en.chessbase.com/post/fritz11-threatened-squares Their implementation of the red squares might be interesting because, in your third example, the queen on b3 would indeed be better colored in red.

marcin-rzeznicki commented 10 months ago

I see your point. What might be better than this, is to mix these two: red seems to work OK, it is more or less what Chessbase does; but in the case of "not red" I could additionally count the number of defenders (similar to what the previous implementation does) to distinguish it between 'yellow' and 'green'. Does it make sense to you?

benini commented 10 months ago

I believe that using the pieces' value doesn't work, even for red squares. For example here the knight on d5, which was previously marked yellow, is now green (red is probably the correct marking). image

marcin-rzeznicki commented 10 months ago

You're right, excellent example. OK, I'll revamp it accordingly