Could you explain a bit more the context of the request, for example:
do you refer to pgn4web in general or to a specific application, such as the wordpress or joomla plugin?
what are the situations where you'd see this visual addition useful? This is not really obvious to me, when playing chess at the board or looking at the position, I generally count the pieces on the board, not the ones off the board.
how would you suggest to handle exceptions, for example game fragments starting from a non standard position or games starting with material advantage: would the panel show the pieces captured in the shown fragment or from the hypothetical material equality of the standard position? Other example: what about positions where a pawn has been promoted to queen, then the queen captured? If the captured pieces panel shows one more queen then the panel would be useless to understand the material balance in the game: would instead a panel with the pieces currently on the board be a better indicator of material unbalance? If yes, isn't the chessboard already showing that info?
The general development guideline for pgn4web is based on a minimalist approach, focusing on a clean display of the chessboard with as little additions/distractions as possible.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the quick answer.
I refer to pgn4web as standalone application - in my opinion it's easier to see piece inbalance if you have such a panel.
If the system starts with a FEN it's also possible to display such a panel as the current number of pieces is known and also the starting number. And that was the idea: just display the difference of the current number of pieces to the starting number of pieces. If something has been promoted meanwhile and captured - that's not that important in my opinion.
If you think this is too much because of the minimalist approach - is there a way to get the pieces of each square of existing position via API?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ultimately decided not to add the captured pieces panel: in order to evaluate material imbalance any decent chess player should be able to count pieces on the board without the need of any extra aid; it's a very basic and fundamental skill.
If you want to pursue this development yourself, you have few options:
the pieceType[color][index] array tells you which pieces are on the board; color can be either 0 or 1 for Whithe/Black. index varies from 0 to 15. pieceType[0][2] = a value from -1 to 6, -1 means that piece has been captured and it is no more on the board, otherwise the value gives you the piece type.
alternatively, you could just parse the FEN string of the current position as provided by the CurrentFEN() function. For example you can get the number of White rooks in the current position with this expression: CurrentFEN().replace(/\s.*$/,"").replace(/[^R]/g,"").length
Thanks for the suggestion.
Could you explain a bit more the context of the request, for example:
The general development guideline for pgn4web is based on a minimalist approach, focusing on a clean display of the chessboard with as little additions/distractions as possible.
Thanks for the quick answer.
I refer to pgn4web as standalone application - in my opinion it's easier to see piece inbalance if you have such a panel.
If the system starts with a FEN it's also possible to display such a panel as the current number of pieces is known and also the starting number. And that was the idea: just display the difference of the current number of pieces to the starting number of pieces. If something has been promoted meanwhile and captured - that's not that important in my opinion.
If you think this is too much because of the minimalist approach - is there a way to get the pieces of each square of existing position via API?
Ultimately decided not to add the captured pieces panel: in order to evaluate material imbalance any decent chess player should be able to count pieces on the board without the need of any extra aid; it's a very basic and fundamental skill.
If you want to pursue this development yourself, you have few options: