Open marcin-rzeznicki opened 11 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.
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?
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).
You're right, excellent example. OK, I'll revamp it accordingly
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
After
Example 2
Before
After
Example 3
Before
After
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.