Comments on https://lichess.org/@/jk_182/blog/quantifying-the-control-over-squares/pqVbFlYu
This is a really cool concept! I have some ideas:
Colour scale:
Perhaps a heatmap isn't the clearest here. I think heat maps make the most sense when there are contiguous areas of heat or gradual changes across the image, but here there are slightly too many scrambled colours and I struggle to keep track of their meanings. Might be clearer just to use greyscale, where white is 1 and black is -1? Or at least limit it to fewer colours like red -> white -> blue (I'm from the UK, sue me lol).
Contested vs uncontested squares:
I think it might be interesting to differentiate between a square that neither player is controlling at all, and one where both players have many pieces controlling it. Could call this value "tension" to align with the intuitive use of the word when talking about pawn tension etc. I'm not sure how best to calculate it, but a crude attempt might be to just add up all the absolute values instead of subtracting values for black. Alternatively it could just be the total number of pieces controlling the square.
Piece order:
Slightly more complicated, but batteries can be weaker or stronger depending on the order - a battery with bishop and queen with the queen at the front doesn't do much to control a square attacked by two rooks, but if the bishop is first then it's the other way around.
This last point leads me to think that there might be a better way to derive the control value - how much would it cost me to occupy that square, and how much would it cost my opponent to stop me if they captured my piece there? Is there a point where one of us could stop capturing back and be up material? Not completely clear on how to make this work mathematically but it feels a bit more meaningful than adding up reciprocals.
Would love to see more on this!
This is a really cool concept! I have some ideas:
Colour scale:
Perhaps a heatmap isn't the clearest here. I think heat maps make the most sense when there are contiguous areas of heat or gradual changes across the image, but here there are slightly too many scrambled colours and I struggle to keep track of their meanings. Might be clearer just to use greyscale, where white is 1 and black is -1? Or at least limit it to fewer colours like red -> white -> blue (I'm from the UK, sue me lol).
Contested vs uncontested squares:
I think it might be interesting to differentiate between a square that neither player is controlling at all, and one where both players have many pieces controlling it. Could call this value "tension" to align with the intuitive use of the word when talking about pawn tension etc. I'm not sure how best to calculate it, but a crude attempt might be to just add up all the absolute values instead of subtracting values for black. Alternatively it could just be the total number of pieces controlling the square.
Piece order:
Slightly more complicated, but batteries can be weaker or stronger depending on the order - a battery with bishop and queen with the queen at the front doesn't do much to control a square attacked by two rooks, but if the bishop is first then it's the other way around.
This last point leads me to think that there might be a better way to derive the control value - how much would it cost me to occupy that square, and how much would it cost my opponent to stop me if they captured my piece there? Is there a point where one of us could stop capturing back and be up material? Not completely clear on how to make this work mathematically but it feels a bit more meaningful than adding up reciprocals.
Would love to see more on this!
Oh, and another detail - if I attack a square with a queen and pawn, and my opponent defends it with a pawn, and additionally my queen is attacked by a pawn, then I can't really say I'm controlling that square very much at all, because in that particular move I can either capture with the pawn and sac the queen, or capture with the queen which also sacs the queen. The only way to not lose a queen is to move it away, meaning that I don't have the option to capture on that square this move unless there's an overwhelming tactical reason.
Oh, and another detail - if I attack a square with a queen and pawn, and my opponent defends it with a pawn, and additionally my queen is attacked by a pawn, then I can't really say I'm controlling that square very much at all, because in that particular move I can either capture with the pawn and sac the queen, or capture with the queen which also sacs the queen. The only way to not lose a queen is to move it away, meaning that I don't have the option to capture on that square this move unless there's an overwhelming tactical reason.
I think it's important to think about the deeper strategy behind controlling squares in chess. For example, a powerful piece like the queen might not always be the best choice for controlling just one square, especially when a pawn could do it more efficiently. This shows that the value of a piece isn't always about how strong it is, but about how well it can help with controlling key squares.
Another thing to consider is how pieces can be 'overloaded'—meaning they’re trying to control too much at once—or how some pieces control squares more actively than others. A piece can also end up controlling squares that don’t really help much, which wastes its potential. These nuances add layers to the idea of control that a simple count of pieces might miss.
Finally, as pieces are exchanged, the control over squares shifts, and the remaining pieces become more valuable. While quantifying square control is a great step, it could be even more useful if strategic methods could be factored in to give a more complete picture. An active piece, being mobile, can have a harder time controlling a square compared to a more passive piece that is locked into its position.
I think it's important to think about the deeper strategy behind controlling squares in chess. For example, a powerful piece like the queen might not always be the best choice for controlling just one square, especially when a pawn could do it more efficiently. This shows that the value of a piece isn't always about how strong it is, but about how well it can help with controlling key squares.
Another thing to consider is how pieces can be 'overloaded'—meaning they’re trying to control too much at once—or how some pieces control squares more actively than others. A piece can also end up controlling squares that don’t really help much, which wastes its potential. These nuances add layers to the idea of control that a simple count of pieces might miss.
Finally, as pieces are exchanged, the control over squares shifts, and the remaining pieces become more valuable. While quantifying square control is a great step, it could be even more useful if strategic methods could be factored in to give a more complete picture. An active piece, being mobile, can have a harder time controlling a square compared to a more passive piece that is locked into its position.
@synaesthesioid said in #2:
Thanks for all your suggestions, I really appreciate it!
Colour scale:
The heat map may not be ideal to show the data, but as I had 64 different numbers, I thought that it makes most sense. Grayscale sounds like a great idea since it would also indicate which side is controlling the square.
Contested vs uncontested squares:
Differentiating between contested and uncontested squares makes sense but I think that one would either change the way the score works or get the "tension" as a second value. As I go from -1 to 1, contested squares should be somewhere in the middle but this hides how many pieces are fighting over that square. I always get the feeling that one would need countless different numbers to describe things on the board that humans can just see.
Piece order:
I paid attention to the piece order in my code, I didn't mention it explicitly in the post as I didn't want to get lost in too many details.
This last point leads me to think that there might be a better way to derive the control value - how much would it cost me to occupy that square, and how much would it cost my opponent to stop me if they captured my piece there? Is there a point where one of us could stop capturing back and be up material? Not completely clear on how to make this work mathematically but it feels a bit more meaningful than adding up reciprocals.
I forgot to mention it, but I did this a bit internally. I ordered the pieces by their values (keeping the order of the batteries in mind) and compared them step by step. If one side would have to sacrifice material, I stopped at this point and didn't add up the reciprocals for the pieces that would be able to recapture later. This may not be ideal as one side might just sacrifice an exchange and eventually control the square, so also counting the material cost sounds like a good idea.
Oh, and another detail - if I attack a square with a queen and pawn, and my opponent defends it with a pawn, and additionally my queen is attacked by a pawn, then I can't really say I'm controlling that square very much at all, because in that particular move I can either capture with the pawn and sac the queen, or capture with the queen which also sacs the queen. The only way to not lose a queen is to move it away, meaning that I don't have the option to capture on that square this move unless there's an overwhelming tactical reason.
This is a good point, the whole score is very static. One side may also be able to sacrifice material to gain control over a square or control may not matter at all due to a sacrifice that leads to mate. I would guess that something additional is needed to capture these tactical dynamics.
@synaesthesioid said in #2:
Thanks for all your suggestions, I really appreciate it!
> Colour scale:
The heat map may not be ideal to show the data, but as I had 64 different numbers, I thought that it makes most sense. Grayscale sounds like a great idea since it would also indicate which side is controlling the square.
> Contested vs uncontested squares:
Differentiating between contested and uncontested squares makes sense but I think that one would either change the way the score works or get the "tension" as a second value. As I go from -1 to 1, contested squares should be somewhere in the middle but this hides how many pieces are fighting over that square. I always get the feeling that one would need countless different numbers to describe things on the board that humans can just see.
> Piece order:
I paid attention to the piece order in my code, I didn't mention it explicitly in the post as I didn't want to get lost in too many details.
> This last point leads me to think that there might be a better way to derive the control value - how much would it cost me to occupy that square, and how much would it cost my opponent to stop me if they captured my piece there? Is there a point where one of us could stop capturing back and be up material? Not completely clear on how to make this work mathematically but it feels a bit more meaningful than adding up reciprocals.
I forgot to mention it, but I did this a bit internally. I ordered the pieces by their values (keeping the order of the batteries in mind) and compared them step by step. If one side would have to sacrifice material, I stopped at this point and didn't add up the reciprocals for the pieces that would be able to recapture later. This may not be ideal as one side might just sacrifice an exchange and eventually control the square, so also counting the material cost sounds like a good idea.
> Oh, and another detail - if I attack a square with a queen and pawn, and my opponent defends it with a pawn, and additionally my queen is attacked by a pawn, then I can't really say I'm controlling that square very much at all, because in that particular move I can either capture with the pawn and sac the queen, or capture with the queen which also sacs the queen. The only way to not lose a queen is to move it away, meaning that I don't have the option to capture on that square this move unless there's an overwhelming tactical reason.
This is a good point, the whole score is very static. One side may also be able to sacrifice material to gain control over a square or control may not matter at all due to a sacrifice that leads to mate. I would guess that something additional is needed to capture these tactical dynamics.
@Toscani said in #4:
I think it's important to think about the deeper strategy behind controlling squares in chess. For example, a powerful piece like the queen might not always be the best choice for controlling just one square, especially when a pawn could do it more efficiently. This shows that the value of a piece isn't always about how strong it is, but about how well it can help with controlling key squares.
I tried to capture this by giving the pieces different "control values". So pawns contribute more to the control of a square than queens. Capturing the efficiency of pieces covering squares seems much more difficult but is certainly something one can think about.
Another thing to consider is how pieces can be 'overloaded'—meaning they’re trying to control too much at once—or how some pieces control squares more actively than others. A piece can also end up controlling squares that don’t really help much, which wastes its potential. These nuances add layers to the idea of control that a simple count of pieces might miss.
Finally, as pieces are exchanged, the control over squares shifts, and the remaining pieces become more valuable. While quantifying square control is a great step, it could be even more useful if strategic methods could be factored in to give a more complete picture. An active piece, being mobile, can have a harder time controlling a square compared to a more passive piece that is locked into its position.
These two points can't really be captured by the score that I've created as it's static, it only looks at the current position without any "looking ahead". These more dynamic factors are much harder to capture, as being overloaded for example may not be a problem in some scenarios while it's a disaster in others.
There are certainly many different factors which contribute to control but are much more difficult to capture. Another example are pins to the queen. The piece may not be able to recapture in some situations as it would lose the queen but in other situations giving up the queen would be tactically justified.
@Toscani said in #4:
> I think it's important to think about the deeper strategy behind controlling squares in chess. For example, a powerful piece like the queen might not always be the best choice for controlling just one square, especially when a pawn could do it more efficiently. This shows that the value of a piece isn't always about how strong it is, but about how well it can help with controlling key squares.
I tried to capture this by giving the pieces different "control values". So pawns contribute more to the control of a square than queens. Capturing the efficiency of pieces covering squares seems much more difficult but is certainly something one can think about.
> Another thing to consider is how pieces can be 'overloaded'—meaning they’re trying to control too much at once—or how some pieces control squares more actively than others. A piece can also end up controlling squares that don’t really help much, which wastes its potential. These nuances add layers to the idea of control that a simple count of pieces might miss.
>
> Finally, as pieces are exchanged, the control over squares shifts, and the remaining pieces become more valuable. While quantifying square control is a great step, it could be even more useful if strategic methods could be factored in to give a more complete picture. An active piece, being mobile, can have a harder time controlling a square compared to a more passive piece that is locked into its position.
These two points can't really be captured by the score that I've created as it's static, it only looks at the current position without any "looking ahead". These more dynamic factors are much harder to capture, as being overloaded for example may not be a problem in some scenarios while it's a disaster in others.
There are certainly many different factors which contribute to control but are much more difficult to capture. Another example are pins to the queen. The piece may not be able to recapture in some situations as it would lose the queen but in other situations giving up the queen would be tactically justified.
I believe that subtracting the attacking value of the two sides loses information. I would use red and blue for the two sides, and show the resulting color. Thus, a square that is not attacked by anyone could be gray, but if it's attacked by two queens it would be a strong magenta, differentiating between squares under tension and squares that are not attacked. In any case, I would not color the neutral (0) squares, thus removing some of the coloring.
I believe that subtracting the attacking value of the two sides loses information. I would use red and blue for the two sides, and show the resulting color. Thus, a square that is not attacked by anyone could be gray, but if it's attacked by two queens it would be a strong magenta, differentiating between squares under tension and squares that are not attacked. In any case, I would not color the neutral (0) squares, thus removing some of the coloring.
<Comment deleted by user>
Discover the total for the whole chessboard, treating each piece as an absolute value for that position (remove the negative sign and add up the values for clarity):
I captured the static eval from a chess engine for the following fens.
We will use two evals to see the full picture of a move without depth, like seeing both sides of a coin by using a mirror.
At the very start of the game, before any moves are made, each side has a total piece value of 41 based on standard material counts (P=1, N=3, B=3.5, R=5, Q=10). The bishop pair is worth more to me than the pair of knights.
Let's quantify the engine's evaluated piece values after a move is done:
position fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
position fen rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2
Ply 1: (Black pieces values, after White's e4 move)
5.34 r ; 4.05 n ; 4.47 b ; 8.43 q ; 4.48 b ; 4.08 n ; 5.40 r
0.58 a6 ; 1.13 b6 ; 1.13 c6 ; 1.10 d6 ; 1.09 e6 ; 1.44 f6 ; 1.29 g6 ; 0.55 h6
Rooks: 5.34 + 5.40 = 10.74
Knights: 4.05 + 4.08 = 8.13
Bishops: 4.47 + 4.48 = 8.95
Queen: 8.43
Pawns: 0.58 + 1.13 + 1.13 + 1.10 + 1.09 + 1.44 + 1.29 + 0.55 = 8.31
Total value of the black pieces after White's move: 10.74 + 8.13 + 8.95 + 8.43 + 8.31 = 44.56
Ply 2: (White pieces value, after Black's c5)
0.36 a2 ; 0.83 b2 ; 0.97 c2 ; 0.57 d2 ; 1.48 e4 ; 0.96 f2 1.00 g2 ; 0.33 h2
5.00 R ; 3.80 N ; 4.33 B ; 8.03 Q ; 4.02 B ; 3.60 N ; 5.16 R
Pawns: 0.36 + 0.83 + 0.97 + 0.57 + 1.48 + 0.96 + 1.00 + 0.33 = 6.50
Rooks: 5.00 + 5.16 = 10.16
Knights: 3.80 + 3.60 = 7.40
Bishops: 4.33 + 4.02 = 8.35
Queen: 8.03
Total value of the white pieces after Black's move: 6.50 + 10.16 + 7.40 + 8.35 + 8.03 = 40.34
Total value on the board after Ply 2 = 40.34 (White) + 44.56 (Black) = 84.90
So the chessboard value just before move 2 is now 84.90, which is the quantifying control value over all the squares based on the engine's evaluation of the piece values.
It may have started off with 41 for each side, but after the first move, the total evaluated value on the chessboard changed.
So who now has the strongest army after move one or on the start position of move 2, based on the sum of the engine's evaluated piece values? Black, with a total of 44.56 compared to White's 40.34.
If I continue to calculate total values based on the above logic ... I think it will be clear that in every position we are facing an army that is evaluated as having a certain total piece value. If I had left the negative signs for black in Ply 1, the overall evaluation would suggest White had the advantage. I see the total values as a representation of the perceived weight or potential power of the pieces in that specific arrangement.
"Each completed move (play vs reply) is for me a new initial position."
If we only use absolute standard values (P=1 ; N=3 ; B=3.5 ; R=5 ; Q=10), then we are not going to be able to see the relative value of each square as assessed by the engine. If the engine's evaluated value of a chess piece drops in a specific position, so does its relative perceived control over the squares it can reach. It's not an absolute control value until the threat is put into action.
Discover the total for the whole chessboard, treating each piece as an absolute value for that position (remove the negative sign and add up the values for clarity):
I captured the static eval from a chess engine for the following fens.
We will use two evals to see the full picture of a move without depth, like seeing both sides of a coin by using a mirror.
At the very start of the game, before any moves are made, each side has a total piece value of 41 based on standard material counts (P=1, N=3, B=3.5, R=5, Q=10). The bishop pair is worth more to me than the pair of knights.
Let's quantify the engine's evaluated piece values after a move is done:
position fen rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - 0 1
position fen rnbqkbnr/pp1ppppp/8/2p5/4P3/8/PPPP1PPP/RNBQKBNR w KQkq - 0 2
Ply 1: (Black pieces values, after White's e4 move)
5.34 r ; 4.05 n ; 4.47 b ; 8.43 q ; 4.48 b ; 4.08 n ; 5.40 r
0.58 a6 ; 1.13 b6 ; 1.13 c6 ; 1.10 d6 ; 1.09 e6 ; 1.44 f6 ; 1.29 g6 ; 0.55 h6
Rooks: 5.34 + 5.40 = 10.74
Knights: 4.05 + 4.08 = 8.13
Bishops: 4.47 + 4.48 = 8.95
Queen: 8.43
Pawns: 0.58 + 1.13 + 1.13 + 1.10 + 1.09 + 1.44 + 1.29 + 0.55 = 8.31
Total value of the black pieces after White's move: 10.74 + 8.13 + 8.95 + 8.43 + 8.31 = 44.56
Ply 2: (White pieces value, after Black's c5)
0.36 a2 ; 0.83 b2 ; 0.97 c2 ; 0.57 d2 ; 1.48 e4 ; 0.96 f2 1.00 g2 ; 0.33 h2
5.00 R ; 3.80 N ; 4.33 B ; 8.03 Q ; 4.02 B ; 3.60 N ; 5.16 R
Pawns: 0.36 + 0.83 + 0.97 + 0.57 + 1.48 + 0.96 + 1.00 + 0.33 = 6.50
Rooks: 5.00 + 5.16 = 10.16
Knights: 3.80 + 3.60 = 7.40
Bishops: 4.33 + 4.02 = 8.35
Queen: 8.03
Total value of the white pieces after Black's move: 6.50 + 10.16 + 7.40 + 8.35 + 8.03 = 40.34
Total value on the board after Ply 2 = 40.34 (White) + 44.56 (Black) = 84.90
So the chessboard value just before move 2 is now 84.90, which is the quantifying control value over all the squares based on the engine's evaluation of the piece values.
It may have started off with 41 for each side, but after the first move, the total evaluated value on the chessboard changed.
So who now has the strongest army after move one or on the start position of move 2, based on the sum of the engine's evaluated piece values? Black, with a total of 44.56 compared to White's 40.34.
If I continue to calculate total values based on the above logic ... I think it will be clear that in every position we are facing an army that is evaluated as having a certain total piece value. If I had left the negative signs for black in Ply 1, the overall evaluation would suggest White had the advantage. I see the total values as a representation of the perceived weight or potential power of the pieces in that specific arrangement.
"Each completed move (play vs reply) is for me a new initial position."
If we only use absolute standard values (P=1 ; N=3 ; B=3.5 ; R=5 ; Q=10), then we are not going to be able to see the relative value of each square as assessed by the engine. If the engine's evaluated value of a chess piece drops in a specific position, so does its relative perceived control over the squares it can reach. It's not an absolute control value until the threat is put into action.
I don't understand the second example. No one controls the b2 square, despite it being higher than 0. Can someone elaborate?
I don't understand the second example. No one controls the b2 square, despite it being higher than 0. Can someone elaborate?



