I am implementing a graphical (web)interface that should help users create diagrams for arbitrary chess variants. The intention is to facilitate creating articles that describe new chess variants for publishing those on the chessvariants.com website. Such articles are supposed to have a 'Setup' section, showing a diagram of the initial position, and a 'Pieces' section with verbal description of the pieces.
The graphical interface I inserted in the submission form for such articles allows the user to alter format and colors of a displayed diagram, select a piece theme, and set up the position by dragging pieces from a table with available pieces to the board diagram. It is also possible to alter the properties of the piece (name, ID, move) that are listed in the table. Once the user has done that he can press a button to get the HTML code for either a static diagram or an interactive one (against which one could play the game), and a table of verbal piece descriptions in the appropriate sections.
A replica of the submission form can be seen at https://www.chessvariants.com/index/test4.html . (It would not really allow you to submit anything, but the interface in it is fully functional, and would place the generated HTML in the edit windows of the form.)
Is this the easiest conceivable way for specifying a diagram and describing piece moves? (The latter is needed to create the list of verbal descriptions, and to make a diagram that can play the variant.) What is still missing, and what could be improved?
Looking for feedback on graphical interface
Moderator: Ras
-
hgm
- Posts: 28438
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
-
Eelco de Groot
- Posts: 4694
- Joined: Sun Mar 12, 2006 2:40 am
- Full name: Eelco de Groot
Re: Hannibal's last battle chess variation
I had no comments as yet about the interface, sorry HGM but I was just thinking about a simple variant to play and avoid all the centuries of chess opening knowledge. I have not tried it out yet on paper. I would start with a simple 9 x 9 board a bit like this one:
https://www.chessvariants.com/play/chess-9x9
So the Kings would now be on the middle row, still called "e" but there are no Amazons, Camels and Dragon Horses in this variation, but it has to be a bit about Hannibal so the Blacks would have to have at least one elephant. Elephants historically are related to Rooks in the game so I was thinking a Rook but it can move only up and down at first, to move horizontally you would have to turn it and this turning costs a move. I am afraid it would make a poor Rook then in development but has some value, I hypothesize, in defending one. It would be on h9 next to a normal black rook and to speed up short castling, the Black King can jump over both Rook and Elephant. The White Romans do not have an elephant, they would have another piece of cavalry instead, with an extra Knight on h1. It can not be jumped over so the Romans have to move both Knights to castle "short". (After Black short castling, Black King on h9, Elephant g9, Rook f9. But maybe you could change that a bit). All other rules can remain the same as in chess. Increasing the number of Knights make them stronger so maybe the Romans have too much an edge now, I have really no idea. If so it could be called maybe "Hannibal's last battle". There are no Alps yet in this version, or a Mediterranean Sea to cross, with ships, from Carthage
https://www.chessvariants.com/play/chess-9x9
So the Kings would now be on the middle row, still called "e" but there are no Amazons, Camels and Dragon Horses in this variation, but it has to be a bit about Hannibal so the Blacks would have to have at least one elephant. Elephants historically are related to Rooks in the game so I was thinking a Rook but it can move only up and down at first, to move horizontally you would have to turn it and this turning costs a move. I am afraid it would make a poor Rook then in development but has some value, I hypothesize, in defending one. It would be on h9 next to a normal black rook and to speed up short castling, the Black King can jump over both Rook and Elephant. The White Romans do not have an elephant, they would have another piece of cavalry instead, with an extra Knight on h1. It can not be jumped over so the Romans have to move both Knights to castle "short". (After Black short castling, Black King on h9, Elephant g9, Rook f9. But maybe you could change that a bit). All other rules can remain the same as in chess. Increasing the number of Knights make them stronger so maybe the Romans have too much an edge now, I have really no idea. If so it could be called maybe "Hannibal's last battle". There are no Alps yet in this version, or a Mediterranean Sea to cross, with ships, from Carthage
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
-
hgm
- Posts: 28438
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Hannibal's last battle chess variation
Nope.Eelco de Groot wrote: ↑Fri Jan 13, 2023 3:27 amElephants historically are related to Rooks in the game...
Elephants were the pieces in ancient Arabic/Persian Chess (Shatranj) that were later replaced by Bishops. The Spanish still call the Bishop 'Alfil', which is the Arabic word for Elephant. The Russians seem to use the modern Russian word for Elephant to designate the modern Chess pieces that start on the c- and f-file. The cut in the head of a Staunton Bishop is there to symbolize the tusks.
The Rook already participated in the earliest known form of Chess exactly as it is now. In fact the word Rook is derived from the Persian word Rukh, which means Chariot. The Italians mistook this for the word Rocca, meaning Fortress, and so it became a castle tower. In Chinese Chess (Xiangqi) the Rook is still called a Chariot.
I have not really tested this, but the Elephant piece that you describe seems very weak. I would be surprised if it was worth more than 2 Pawns. One could argue that it is half a Rook at any time, but the two perpendicular sets of Rook moves have a lot of synergy. The fact that you can rotate it is not really different from giving it an extra move (which cannot be used to capture); if it would be allowed to make a non-capture sideway step in addition to the vertical slide, it would also cover a completely new set of squares, just like after rotation. Non-capture moves are typically only worth half as much as capture moves. So yes, the Romans would probably have a significant edge if you give them an extra Knight.
Below is the best approximation the Interactive Diagram can do for your variant. It does not implement the 'double-castling' for black. To rotate the Elephant you have to open the piece table (by clicking the 'here' link), and move the Elephant you have in hand to the square of the Elephant on the board, so they get swapped. (In fact the Diagram will allow you to swap it with any piece, or even just drop it on an empty square. But since the AI doesn't know you can do that, this can only make the AI blunder by overlooking the possibility of Elephant rotation, and won't make it cheat.)
[diag]files=9
ranks=9
symmetry=none
castleFlip=1
useMarkers=1
darkShade=#CF8948
lightShade=#FFCC9C
rimColor=#111199
coordColor=#CCCC11
firstRank=1
handSwap=1
Pawn::::a2-i2,,a8-i8
Elephant (v)::vR:Elephant:,,h9
Elephant (s)::sR:Elephant::0,1
Knight::N::b1,g1,h1,,b9,g9
Bishop::::c1,f1,,c9,f9
Rook::::a1,i1,,a9,i9
Queen::::d1,,d9
King::KilO2irO3::e1,,e9
[/diag]
-
Eelco de Groot
- Posts: 4694
- Joined: Sun Mar 12, 2006 2:40 am
- Full name: Eelco de Groot
Re: Hannibal's last battle chess variation
Dankjewel HGM!hgm wrote: ↑Sat Jan 14, 2023 1:33 pmNope.Eelco de Groot wrote: ↑Fri Jan 13, 2023 3:27 amElephants historically are related to Rooks in the game...
Elephants were the pieces in ancient Arabic/Persian Chess (Shatranj) that were later replaced by Bishops. The Spanish still call the Bishop 'Alfil', which is the Arabic word for Elephant. The Russians seem to use the modern Russian word for Elephant to designate the modern Chess pieces that start on the c- and f-file. The cut in the head of a Staunton Bishop is there to symbolize the tusks.
The Rook already participated in the earliest known form of Chess exactly as it is now. In fact the word Rook is derived from the Persian word Rukh, which means Chariot. The Italians mistook this for the word Rocca, meaning Fortress, and so it became a castle tower. In Chinese Chess (Xiangqi) the Rook is still called a Chariot.
I have not really tested this, but the Elephant piece that you describe seems very weak. I would be surprised if it was worth more than 2 Pawns. One could argue that it is half a Rook at any time, but the two perpendicular sets of Rook moves have a lot of synergy. The fact that you can rotate it is not really different from giving it an extra move (which cannot be used to capture); if it would be allowed to make a non-capture sideway step in addition to the vertical slide, it would also cover a completely new set of squares, just like after rotation. Non-capture moves are typically only worth half as much as capture moves. So yes, the Romans would probably have a significant edge if you give them an extra Knight.
Below is the best approximation the Interactive Diagram can do for your variant. It does not implement the 'double-castling' for black. To rotate the Elephant you have to open the piece table (by clicking the 'here' link), and move the Elephant you have in hand to the square of the Elephant on the board, so they get swapped. (In fact the Diagram will allow you to swap it with any piece, or even just drop it on an empty square. But since the AI doesn't know you can do that, this can only make the AI blunder by overlooking the possibility of Elephant rotation, and won't make it cheat.)
[diag]files=9
ranks=9
symmetry=none
castleFlip=1
useMarkers=1
darkShade=#CF8948
lightShade=#FFCC9C
rimColor=#111199
coordColor=#CCCC11
firstRank=1
Pawn::::a2-i2,,a8-i8
Elephant (v)::vR:Elephant:,,h9
Elephant (s)::sR:Elephant::0,1
Knight::N::b1,g1,h1,,b9,g9
Bishop::::c1,f1,,c9,f9
Rook::::a1,i1,,a9,i9
Queen::::d1,,d9
King::KilO2irO3::e1,,e9
[/diag]
My very own chess variant! And I can play it too! I was totally perplexed.
I do kind of hope that people will try to find variants for themselves and stop using computers that are practically invincible at chess, or go, or most other well known strategy games like Stratego now. Denksporten after all, are meant to use your own brain more, not less. And so many variations are possible.
Debugging is twice as hard as writing the code in the first
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
place. Therefore, if you write the code as cleverly as possible, you
are, by definition, not smart enough to debug it.
-- Brian W. Kernighan
-
hgm
- Posts: 28438
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Looking for feedback on graphical interface
The design goal of the Interactive Diagram is to be able to play an arbitrary chess variant with as little configuration as possible. When you look at the info I had to supply for posting it (e.g. by hitting the quote button on the posting that contains it), you can see that I had to specify little more than the board size and the list of participating pieces, how these move, and where they start. (E.g. sR means 'sideway Rook'; for the standard pieces it has a default move.) In this case I also added some color specs for prettier appearence.
It then guesses the piece values that it will use when playing. (You can see those by clicking on the 'move' header of the piece table.)
It does support various types of castling, but no moves where you move 3 pieces at once. This is rarely seen in any variant; I think I have only seen it once before. Reorienting pieces occurs more often, and the Diagram can implement this as a promotion, treating the different orientations as a different piece type. What you have here is promotion without moving, though. This is not supported yet, but might be common enough to warrant support.
The biggest problem often is to design a good interface, both for configuring a feature, as well as for using it during play. In the case of your Elephant I used a work-around of treating it as piece drops, making use of the fact that the Diagram already treated dropping on pieces of your own color as a swap. (This for facilitating setting up positions.) The AI of the Diagram doesn't support piece drops yet. Which is a thing I regret, but for general drops like in Shogi and Crazyhouse it would need an entirely different search and evaluation. There are plenty of variants that have some very limited, less aggressive form of dropping (e.g. only on your own back rank), and the AI would be able to handle that with its current search. Swapping your own piece for another that you have in hand would also not be a problem.
The issue is how to tell the AI what exactly it can do with the pieces it has 'in hand', though. Limiting the promotion choice to such pieces is already a standard option. Perhaps I should make swapping for 'on board' pieces that have the same ID as another standard option, which can then be switched on in the game definition by including a parameter handSwap=1.
It then guesses the piece values that it will use when playing. (You can see those by clicking on the 'move' header of the piece table.)
It does support various types of castling, but no moves where you move 3 pieces at once. This is rarely seen in any variant; I think I have only seen it once before. Reorienting pieces occurs more often, and the Diagram can implement this as a promotion, treating the different orientations as a different piece type. What you have here is promotion without moving, though. This is not supported yet, but might be common enough to warrant support.
The biggest problem often is to design a good interface, both for configuring a feature, as well as for using it during play. In the case of your Elephant I used a work-around of treating it as piece drops, making use of the fact that the Diagram already treated dropping on pieces of your own color as a swap. (This for facilitating setting up positions.) The AI of the Diagram doesn't support piece drops yet. Which is a thing I regret, but for general drops like in Shogi and Crazyhouse it would need an entirely different search and evaluation. There are plenty of variants that have some very limited, less aggressive form of dropping (e.g. only on your own back rank), and the AI would be able to handle that with its current search. Swapping your own piece for another that you have in hand would also not be a problem.
The issue is how to tell the AI what exactly it can do with the pieces it has 'in hand', though. Limiting the promotion choice to such pieces is already a standard option. Perhaps I should make swapping for 'on board' pieces that have the same ID as another standard option, which can then be switched on in the game definition by including a parameter handSwap=1.
-
hgm
- Posts: 28438
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Looking for feedback on graphical interface
I have now implemented this handSwap parameter, and specified it for the posted Diagram. So the AI now also knows that it can replace the sideway Elephant for a vertical one. This can be tested by opening the e-file through e2-d3 (the Diagram is always in edit mode, so you can play illegal moves), Ke1-e2, Qd1-e1 and Eh9-e7, and then replace the vertical Elephant for the sideway one from the table. If you then switch on the AI by hitting 'play it', and play a meaningless move like a2-a3, it will in reply 'rotate' the Elephant to skewer K and Q.
(You might have to flush the browser cache to use the updated script.)
(You might have to flush the browser cache to use the updated script.)
-
CornfedForever
- Posts: 650
- Joined: Mon Jun 20, 2022 4:08 am
- Full name: Brian D. Smith
Re: Hannibal's last battle chess variation
Side note: those 'centuries' of opening knowledge are littered with far more bad/poor "knowledge" after the first few moves than you could spend a lifetime enumerating on your own. It is really only the output supplied from fairly recent computer infested games that are relevant. So...sounds cool, but lets not overstate things.Eelco de Groot wrote: ↑Fri Jan 13, 2023 3:27 am I had no comments as yet about the interface, sorry HGM but I was just thinking about a simple variant to play and avoid all the centuries of chess opening knowledge.