If you found Duck chess too strange, here's an even weirder chess variant - Spell Chess. This may be VERY difficult to implement with code.
Two nice explainer Youtube videos from Eric Rosen:
27 minutes
https://www.youtube.com/watch?v=qRr4pZd_P7o&t=913s
43 minutes
https://www.youtube.com/watch?v=P5LCc59PhzQ
Spell Chess
Moderator: Ras
-
- Posts: 121
- Joined: Sat Dec 03, 2022 9:28 pm
- Full name: Rick Groszkiewicz
Spell Chess
Retired actuary and software developer. I love chess, coffee, wine and food
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Spell Chess
I am too impatient for 27 min. But unfortunately I found no complete rule description on chess.com, where this variant can be played. What I gathered is this:
* FIDE rules apply, except for the following:
* A turn consist of optionally casting a spell, and then making a FIDE move.
* There are two types of spells, called jump and freeze.
* Jump can be cast on a single square, and allows any piece there to be jumped over by sliders.
* Freeze works on a 3x3 area, and makes moving of pieces standing in that area impossible.
* Both apply to pieces of both color.
* Each player starts with 2 jumps and 5 freezes 'in hand', and casting those depletes their number.
* The spells only last for a finite time after they are cast (but how long?)
* Players are re-supplied with spells (but how often?)
Is that about it? At face value the branching ratio would be 129 times that of orthodox Chess, as each move can be combined with 2 spells on 64 squares. This will be counteracted by the fact that most pieces will probably be frozen most of the time. So it might not be so bad in practice.
* FIDE rules apply, except for the following:
* A turn consist of optionally casting a spell, and then making a FIDE move.
* There are two types of spells, called jump and freeze.
* Jump can be cast on a single square, and allows any piece there to be jumped over by sliders.
* Freeze works on a 3x3 area, and makes moving of pieces standing in that area impossible.
* Both apply to pieces of both color.
* Each player starts with 2 jumps and 5 freezes 'in hand', and casting those depletes their number.
* The spells only last for a finite time after they are cast (but how long?)
* Players are re-supplied with spells (but how often?)
Is that about it? At face value the branching ratio would be 129 times that of orthodox Chess, as each move can be combined with 2 spells on 64 squares. This will be counteracted by the fact that most pieces will probably be frozen most of the time. So it might not be so bad in practice.
-
- Posts: 121
- Joined: Sat Dec 03, 2022 9:28 pm
- Full name: Rick Groszkiewicz
Re: Spell Chess
Each spell only lasts for one half-move. Very few pieces will be frozen for any amount of time.hgm wrote: ↑Sat Sep 09, 2023 11:17 pm
* The spells only last for a finite time after they are cast (but how long?)
* Players are re-supplied with spells (but how often?)
Is that about it? At face value the branching ratio would be 129 times that of orthodox Chess, as each move can be combined with 2 spells on 64 squares. This will be counteracted by the fact that most pieces will probably be frozen most of the time. So it might not be so bad in practice.
The players are NOT re-supplied with spells.
After a spell is cast, you can't use the same spell on the next move. It regenerates after three half-moves.
The Jump spell is very useful for mating attacks, since it is very hard to block. The best response to a freeze spell is another freeze.
Retired actuary and software developer. I love chess, coffee, wine and food
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Spell Chess
Let me make sure I understand this:
* The jump spell only lasts for the half-move in which it was cast. So the player casting it can jump over the designated square, but it has no effect on the opponent. This seems equivalent to allowing sliders to hop over one obstacle. But only twice per game, and not twice in a row. If we make the assumption one never would want to waste a spell, this reduces the branching ratio; the jump spells only contribute moves of sliders that jumped in combination with the required jump spell, for as long as you possess the spells. The game state only has to be augmented with a jump-spell counter for each player that can take the value 3, 2, 1 or 0, where 2 would automatically decrement without the possibility to use a spell, while for 3 and 1 you could use the spell (which would decrement the counter).
* The freeze spell should be effective only on the halfmove after you cast it, otherwise it would freeze your own pieces, and not affect the opponent. So it is more like you cast that at the end of your turn. This is similar to Duck Chess (and other refusal variants): although there are many locations to cast the spell, most are equally (in)effective; only those that freeze the piece that could make the otherwise best move have any effect. There are in general 9 spell placements that do this, and these might differ because they might in addition freeze one or more of the pieces that could make the next-best move. Unlike in Duck Chess, preventing the best move for the opponent isn't a no-brainer, as it would deplete your spell supply. And a spell could be worth more than the difference with his nex-best move, in which case it would be better to 'keep it in your pocket'. So this basically drives up the branching ratio by a factor 10.
Most of the different freeze-spell placements would quickly transpose to the same line, though, as the spell would have 'evaporated' at the end of the next ply. In fact the 'two-ply branching', which would be N*M if you had N moves and the opponent M (assume for simplicity that M did not depend on which move you made) has only doubled by the possibility of the first player to cast the spell; the opponent never gets any extra moves because of the spell. So the only difference it made in the set of game states that could be reached after 2 ply is whether your spell supply was depleted or not. That is not so bad.
So an engine that would treat the freezes the naive way, searching all 64 combinations of a freeze-spell in combination with all moves, would only see a 65-fold decrease in nps, but not really a dramatic drop in nodes-to-depth. And the nps drop might be curable by clever redesign of the search. When a bare FIDE move in an all-node gets refuted, casting spells that do not freeze the piece that made the opponent's cut move are pointless, and only the 9 freezes that do need to be search in the hope for improvement. If one of those is refuted (necessarily by a move of another piece), you can forget about the spells that do not freeze both. (Which might leave no spells to be searched at all, in combination with the current move.) If you are refuted by a null move, a spell won't help, as there is nothing to freeze.
So each move in an all-node needs only be searched in combination with a quite limited number of (freeze) spells. In fact these searches can be combined (but not with the spellless search, as there the spell supply would be different), by deferring the choice for the best spell location to the daughter node. (Just like you could defer the choice for the best Duck placement.) The daughter would search for cut moves, but not stop at the first (as the piece making it would be frozen), and continue searching moves until it has two cut moves that cannot be frozen at the same time. The pair of those, as well as the score of the worst would go into the hash table. Of course each FIDE move should be searched bare or in combination with an (undetermined) freeze spell (the daughter determining where that spell would have to be cast for maximum effect).
I would say this is all very doable. It is a lot like Duck Chess, with a somewhat more powerful Duck, where Ducks are not moved over the board, but dropped from a finite supply in the hand, and then are cleared off the board. Dropping from the hand is nearly the same as a piece that can teleport on the board; in fact it removes the subtlety of the ban on leaving the Duck in place.
* The jump spell only lasts for the half-move in which it was cast. So the player casting it can jump over the designated square, but it has no effect on the opponent. This seems equivalent to allowing sliders to hop over one obstacle. But only twice per game, and not twice in a row. If we make the assumption one never would want to waste a spell, this reduces the branching ratio; the jump spells only contribute moves of sliders that jumped in combination with the required jump spell, for as long as you possess the spells. The game state only has to be augmented with a jump-spell counter for each player that can take the value 3, 2, 1 or 0, where 2 would automatically decrement without the possibility to use a spell, while for 3 and 1 you could use the spell (which would decrement the counter).
* The freeze spell should be effective only on the halfmove after you cast it, otherwise it would freeze your own pieces, and not affect the opponent. So it is more like you cast that at the end of your turn. This is similar to Duck Chess (and other refusal variants): although there are many locations to cast the spell, most are equally (in)effective; only those that freeze the piece that could make the otherwise best move have any effect. There are in general 9 spell placements that do this, and these might differ because they might in addition freeze one or more of the pieces that could make the next-best move. Unlike in Duck Chess, preventing the best move for the opponent isn't a no-brainer, as it would deplete your spell supply. And a spell could be worth more than the difference with his nex-best move, in which case it would be better to 'keep it in your pocket'. So this basically drives up the branching ratio by a factor 10.
Most of the different freeze-spell placements would quickly transpose to the same line, though, as the spell would have 'evaporated' at the end of the next ply. In fact the 'two-ply branching', which would be N*M if you had N moves and the opponent M (assume for simplicity that M did not depend on which move you made) has only doubled by the possibility of the first player to cast the spell; the opponent never gets any extra moves because of the spell. So the only difference it made in the set of game states that could be reached after 2 ply is whether your spell supply was depleted or not. That is not so bad.
So an engine that would treat the freezes the naive way, searching all 64 combinations of a freeze-spell in combination with all moves, would only see a 65-fold decrease in nps, but not really a dramatic drop in nodes-to-depth. And the nps drop might be curable by clever redesign of the search. When a bare FIDE move in an all-node gets refuted, casting spells that do not freeze the piece that made the opponent's cut move are pointless, and only the 9 freezes that do need to be search in the hope for improvement. If one of those is refuted (necessarily by a move of another piece), you can forget about the spells that do not freeze both. (Which might leave no spells to be searched at all, in combination with the current move.) If you are refuted by a null move, a spell won't help, as there is nothing to freeze.
So each move in an all-node needs only be searched in combination with a quite limited number of (freeze) spells. In fact these searches can be combined (but not with the spellless search, as there the spell supply would be different), by deferring the choice for the best spell location to the daughter node. (Just like you could defer the choice for the best Duck placement.) The daughter would search for cut moves, but not stop at the first (as the piece making it would be frozen), and continue searching moves until it has two cut moves that cannot be frozen at the same time. The pair of those, as well as the score of the worst would go into the hash table. Of course each FIDE move should be searched bare or in combination with an (undetermined) freeze spell (the daughter determining where that spell would have to be cast for maximum effect).
I would say this is all very doable. It is a lot like Duck Chess, with a somewhat more powerful Duck, where Ducks are not moved over the board, but dropped from a finite supply in the hand, and then are cleared off the board. Dropping from the hand is nearly the same as a piece that can teleport on the board; in fact it removes the subtlety of the ban on leaving the Duck in place.
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Spell Chess
I guess a nice search algorithm would be this: in nodes where a (yet undetermined) spell is in force, keep track of the best move on a per-piece basis. Then sort the piece results high to low, and determine how many at the top you can disable with the same spell. You can do this by starting with the 3x3 area around the piece with the best move, and intersect that with the areas around the subsequent pieces untill nothing is left. The score for that piece would be the score of the node.
In PV or all nodes all moves have to be searched anyway, so ordering is not that important; in PV nodes there is some benefit raising alpha as quickly as possible. But in most cases the hash moves would have already done that, so there is no big loss from an arbitrary ordering for the remaining moves.
That is different in cut nodes. As soon as you find a move that scores above beta, it becomes pointless to try other moves of the same piece, as these could be disabled by the same spell. That also holds for pieces next to it. (For an edger piece you could even assume that the spell is cast one square inward from it, to also cover some pieces standing two steps away.) Your hope must be to find another piece further away that also scores above beta, so you would search moves of such pieces first. You can use their score to increase alpha, and as soon as it gets above beta you have a cutoff. If none is found you could still be in a PV node. If the piece that brought the best move is two steps away from the piece that did score > beta, it could be disabled with the same spell, but this would liberate adjacent pieces on the other side of the cutoff piece from the effects of the spell. So that you would have to find their best move too. And if it did not top the best move outside the initially excluded area, you would shift the spell to base the score on those pieces.
In PV or all nodes all moves have to be searched anyway, so ordering is not that important; in PV nodes there is some benefit raising alpha as quickly as possible. But in most cases the hash moves would have already done that, so there is no big loss from an arbitrary ordering for the remaining moves.
That is different in cut nodes. As soon as you find a move that scores above beta, it becomes pointless to try other moves of the same piece, as these could be disabled by the same spell. That also holds for pieces next to it. (For an edger piece you could even assume that the spell is cast one square inward from it, to also cover some pieces standing two steps away.) Your hope must be to find another piece further away that also scores above beta, so you would search moves of such pieces first. You can use their score to increase alpha, and as soon as it gets above beta you have a cutoff. If none is found you could still be in a PV node. If the piece that brought the best move is two steps away from the piece that did score > beta, it could be disabled with the same spell, but this would liberate adjacent pieces on the other side of the cutoff piece from the effects of the spell. So that you would have to find their best move too. And if it did not top the best move outside the initially excluded area, you would shift the spell to base the score on those pieces.
-
- Posts: 121
- Joined: Sat Dec 03, 2022 9:28 pm
- Full name: Rick Groszkiewicz
Re: Spell Chess
Here is an interesting game between two high rated players:
https://www.chess.com/variants/spell-ch ... 311692/0/1
But I have questions ...
https://www.chess.com/variants/spell-ch ... 311692/0/1
But I have questions ...
- Why didn't White use a freeze on Black's Bishop at move five? Maybe thinking extra freeze was worth losing a minor piece?
- Why didn't Black retreat the Bishop at move five? Maybe afraid of Bxf7+
- 10... d5 looks bad
- Black had to play 13... Nf6
- White's 15.Be6+ was crushing
Retired actuary and software developer. I love chess, coffee, wine and food
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Spell Chess
Perhaps the players are not as strong as you think. 10... d5 seemed indeed bad, but not trading it away after it gets taken seems even worse, and ignoring the Pawn attack on the Knight so that it can fork last-rank squares is suicidal. Perhaps black was counting on white having to resolve the check he delivered with 13... Rhe8+, but in this variant checks can be resolved with a spell, so they are never a cure for a threat by a FIDE move. Even if all the pieces protecting Nd7 could not have been frozen together with Re8, it would still have cost him the Knight. (But I cannot exclude a freeze spell is worth a minor, so that he doesn't worry about that.) Nevertheless threatening to deliver a contact check is always very dangerous in this variant, as it could be combined with a King freeze, which on the side freezes some other close-by pieces that were potential capturers of the checker. So there is a good chance the only check evasion is a freeze, robbing you of the possibility to use a freeze on the next move, where you would still be in check. Even though you would not be paralyzed for that evasion, the opponent can have added another threat to this by his latest move (as he does with Be6+ here), which you cannot simultaneously resolved. So it always means very bad trouble, and you should never allow the freeze +contact check unless you are sure it ends well. That this is a blitz game is no excuse; if you don't have the time to thoroughly calculate you will survive the contact check you should assume it will be fatal, and not frivolously play a counter threat.
The high rating might be due to their performance in orthodox Chess, or other variants.
The high rating might be due to their performance in orthodox Chess, or other variants.
-
- Posts: 121
- Joined: Sat Dec 03, 2022 9:28 pm
- Full name: Rick Groszkiewicz
Re: Spell Chess
The real key was that Be6+ also blocked Black from using the Jump spell to capture White's king.
Here is another interesting game. White cleverly wins Black's Queen, then loses his own Queen. Maybe he forgot to do the Freeze spell before playing 14.Nxe6+
https://www.chess.com/variants/spell-ch ... 328639/0/1
Here is another interesting game. White cleverly wins Black's Queen, then loses his own Queen. Maybe he forgot to do the Freeze spell before playing 14.Nxe6+
https://www.chess.com/variants/spell-ch ... 328639/0/1
Retired actuary and software developer. I love chess, coffee, wine and food
-
- Posts: 28353
- Joined: Fri Mar 10, 2006 10:06 am
- Location: Amsterdam
- Full name: H G Muller
Re: Spell Chess
It seems an interesting variant. And I am impressed by the effort chess.com must have put into creating the interface for such an outlandish novelty.
-
- Posts: 121
- Joined: Sat Dec 03, 2022 9:28 pm
- Full name: Rick Groszkiewicz
Re: Spell Chess
Another nice example of the power of having a Jump spell, when combined with a Freeze.
https://www.chess.com/variants/spell-ch ... 338234/0/1
https://www.chess.com/variants/spell-ch ... 338234/0/1
Retired actuary and software developer. I love chess, coffee, wine and food