Chess engines for circular chess boards

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Chess engines for circular chess boards

Post by Evert »

RichV wrote: Thu Apr 25, 2019 10:36 pm Thanks for correcting me on the name of the piece that moves one space diagonally and then one space orthogonally. In its footnote, Wikipedia gave two examples of alternate move descriptions for the Knight, the first being diagonally then orthogonally and the second being orthogonally then diagonally. It only named the latter as being for the Xiangqi. When writing my last post, I missed the word “latter” and assigned the Xiangqi to the wrong move. Wikipedia did not mention the Ferz, which led to my confusion on the moves. I have never played the other ancient chess-like games, so I am unfamiliar with their pieces and moves. So I should have said….Harm’s Ferz move – one space diagonally and then one space orthogonally.
It's a dangerously addictive topic. Beware.
I never have liked en-passant because it seems like a rule that goes against what would happen in medieval battle – if a warrior runs past an enemy warrior on the battlefield, the one being passed would not yell out an order “Hey, you did not give me a chance to kill you, so come back here and let me behead you with my sword.” He would surely only get a medieval gesture similar to the ‘bird’. 😊 I want to keep my games as true to a medieval war as I can.
I would say that trying to run past an enemy soldier comes with the risk that said soldier takes a swing at you as you pass.
However, I know that many chess purists feel that en-passant has a place in chess. That is why in my rules for Castle Siege Chess, I say that the players must agree at the beginning of the game whether or not they are going to use the en-passant rule. In the electronic version, I will make it a definite part of the game. The main audience for Castle Siege Chess is chess players, so I don’t want to create any friction with any of them by completely ignoring the en-passant rule.
As I said: your game, your rules. If you think en-passant is "in", it's "in". If you say it's out, it's out.
Your comment about my rule for castling is also good. I was trying to indicate that castling in Castle Siege Chess works as normal because for a King-side castle, the King move toward the Rook to the starting position of the Knight and then the Rook is moved over the King to the starting position of the Bishop, which are the same things that happen in traditional chess. And for the Queen-side castle, the King moves toward the Rook and is placed on the starting position of the Bishop and then the Rook is moved over the King to the starting position of the Queen, which also are the same ending positions in traditional chess. So I will take your advice and edit my rules castling description to hopefully be more clear.
Ah, I see. Yes, this is another case (beside the Knight move) where being very explicit about the rules and your own assumptions is important. To me, "castling as normal" is "the King moves two squares in the direction of the Rook, and then the Rook teleports to the other side of the King." Chess960 messes that up as "the King moves to g1/c1, and then the relevant Rook teleports to f1/d1" (not that it could do much better). Where other pieces are at the beginning of the game is irrelevant to what happens with the King and Rook.
Have you looked at http://www.chessvariants.org? It's a great place for inspiration and checking out how to concisely write down the rules as clearly as possible. As a suggestion for your website: I think examples of how pieces move on or near the triangular squares are important.
So thanks Evert. I feel like you are helping a lot and I definitely appreciate it.
You're welcome. The board is interesting.
As Daniel said, the board is topologically equivalent to a cube with the corners sanded off (these are the triangular squares) and the direction of moves changes when passing from one patch to another (for instance, a pawn starting on c1 in your notation moves "forward", meaning along the great circle labelled 1, while a pawn starting on d4 in your notation moves "forward", meaning radially). Whether pawns move radially or along the circles depends on where they are in relation to the triangular squares. These are topological defects in the board, that add a sense of curvature. In a sense, they are similar to black holes that curve space (so if you wanted to re-theme your game in a sci-fi setting, you could).
For the past 4 years, I have been heavily play-testing my games at many chess clubs. The reception has been very good. Without any advertising, other than having an Etsy.com site, I have sold 54 games (including both online sales and in person sales). I starting to have a lot of confidence about eventually having a Kickstarter. But I think it is very important that I first have Castle Siege Chess playable online (or as a compter app that can also be played online). So there is still a lot of work to be done.
Well, personally, I might be interested in writing an engine that can play this (I have one more week of easter break left, after that things will get intense until July or so, so no promises). That is to say, a program where you type the moves and it spits out a reply back at you. Not something that would work on-line or on a mobile device.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Chess engines for circular chess boards

Post by Evert »

hgm wrote: Fri Apr 26, 2019 8:46 am Like Evert says, the hard part will be to produce a GUI. When I mentioned Jocly, I only mentioned it as an example of a way to construct a move generator that would be able to handle such 'inhomogeneous' boards. I wouldn't want to suggest that it would be a good idea to implement your game in Jocly; it is a web interface, and the AI is very generic, and therefore rather weak. Still, Jocly is very general, and can do amazing things. Some variants with irregular boards have already been implemented, and could be used as a starting point:
I think a table-based generator is necessary for this variant, since it becomes very fiddly otherwise. How pieces move depends on where they are anyway, so either you need a lot of special code in the move generator, or you hide that complexity in a table. Of course, that table will be somewhat large, so it may end up being slow.
None of the Jocly examples from your page work for me, by the way. I get an "Unhandled Promise Rejection: Error: undefined is not an object (evaluating 'this.cbView.coords')" error when loading a game (Safari on OS X).
User avatar
hgm
Posts: 27788
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Chess engines for circular chess boards

Post by hgm »

Since this is not truly a location-dependent move, but more a topological irregularity in the board, a table describing the topology would be sufficient: for each square it could list for all directions through which you could leave the square what square that would bring you to, and what direction you would then look in. Normally you would stay looking in the same directionafter a step. But when stepping to the triangular squares, the trajectory forks, and you could have two directions. So you should really tabulate the direction set after the step.

Piece moves can then be encoded in the usual way, by a list of possible starting directions and a range in each of those.
RichV
Posts: 53
Joined: Sun Apr 14, 2019 5:33 pm
Full name: Rich VanDeventer

Re: Chess engines for circular chess boards

Post by RichV »

Evert. I will definitely do some research in the chessvariants.org site. I posted my game there in 1999 under the name Round Table Chess. I entered into the Large Variant 99 Contest, but not enough judges played it for it to qualify to win anything. However, it did receive the highest score in several categories. For the 84 Spaces Contest, I removed 6 spaces from the back of each castle and entered it again. However, it was decided that the game was too close to the previous version and was disqualified.
As Daniel said, the board is topologically equivalent to a cube with the corners sanded off (these are the triangular squares) and the direction of moves changes when passing from one patch to another (for instance, a pawn starting on c1 in your notation moves "forward", meaning along the great circle labelled 1, while a pawn starting on d4 in your notation moves "forward", meaning radially). Whether pawns move radially or along the circles depends on where they are in relation to the triangular squares. These are topological defects in the board, that add a sense of curvature. In a sense, they are similar to black holes that curve space (so if you wanted to re-theme your game in a sci-fi setting, you could).
When I first tried to merge a 6x6 square board into the hole of the Byzantine Chess board, I tried very hard to get rid of the 4 triangles, but without success. As I made the triangles shrink to the point of disappearing, the adjoining three 4-sided spaces merged into a single weird looking shape with no opposite color to maintain alternating colors for moves. So I had to keep the triangles. I didn’t initially know what to do with them, so I painted them red and made the unplayable. The game played terribly because pieces had to work their way the triangular obstacles. I had to make them playable, but how? I did not want to say always turn only to the left (or only to the right) and I didn’t want a piece to have to stop on a triangle, because the piece would lose tempo. That is when I decided to make the triangle a ‘fork in the road’. Since the four triangles were a natural, unavoidable part of the board creation, I don't like to think of them as "topological defects', even if that may be the way they are perceived in game programming.
Well, personally, I might be interested in writing an engine that can play this (I have one more week of easter break left, after that things will get intense until July or so, so no promises). That is to say, a program where you type the moves and it spits out a reply back at you. Not something that would work on-line or on a mobile device.
That is a very exciting thought. It would be a good place to start.
I think a table-based generator is necessary for this variant, since it becomes very fiddly otherwise. How pieces move depends on where they are anyway, so either you need a lot of special code in the move generator, or you hide that complexity in a table. Of course, that table will be somewhat large, so it may end up being slow.
None of the Jocly examples from your page work for me, by the way. I get an "Unhandled Promise Rejection: Error: undefined is not an object (evaluating 'this.cbView.coords')" error when loading a game (Safari on OS X).
Does the script snippet from my CSC .zrf file shown below look like a table element (with links referencing board named spaces)?

; Moves from the South/White Castle

; moving straight north into the Battlefield - wcn

(links wcasn

(Sc1 Sc2) (Sc2 Sc3) (Sc3 Sc4) (Sc4 Sb4) (Sb4 Sa4) (Sa4 Na4) (Na4 Nb4) (Nb4 Nc4) (Nc4 Nc3) (Nc3 Nc2) (Nc2 Nc1)
(Sd1 Sd2) (Sd2 Sd3) (Sd3 Sd4) (Sd4 Sb5) (Sb5 Sa5) (Sa5 Na5) (Na5 Nb5) (Nb5 Nd4) (Nd4 Nd3) (Nd3 Nd2) (Nd2 Nd1)
(Se1 Se2) (Se2 Se3) (Se3 Se4) (Se4 Sb6) (Sb6 Sa6) (Sa6 Na6) (Na6 Nb6) (Nb6 Ne4) (Ne4 Ne3) (Ne3 Ne2) (Ne2 Ne1)
(Sf1 Sf2) (Sf2 Sf3) (Sf3 Sf4) (Sf4 Si6) (Si6 Sj6) (Sj6 Nj6) (Nj6 Ni6) (Ni6 Nf4) (Nf4 Nf3) (Nf3 Nf2) (Nf2 Nf1)
(Sg1 Sg2) (Sg2 Sg3) (Sg3 Sg4) (Sg4 Si5) (Si5 Sj5) (Sj5 Nj5) (Nj5 Ni5) (Ni5 Ng4) (Ng4 Ng3) (Ng3 Ng2) (Ng2 Ng1)
(Sh1 Sh2) (Sh2 Sh3) (Sh3 Sh4) (Sh4 Si4) (Si4 Sj4) (Sj4 Nj4) (Nj4 Ni4) (Ni4 Nh4) (Nh4 Nh3) (Nh3 Nh2) (Nh2 Nh1)
)

; symmetrical reverse of wcasn - battlefield into the white castle

(links bfasswc

(Nc1 Nc2) (Nc2 Nc3) (Nc3 Nc4) (Nc4 Nb4) (Nb4 Na4) (Na4 Sa4) (Sa4 Sb4) (Sb4 Sc4) (Sc4 Sc3) (Sc3 Sc2) (Sc2 Sc1)
(Nd1 Nd2) (Nd2 Nd3) (Nd3 Nd4) (Nd4 Nb5) (Nb5 Na5) (Na5 Sa5) (Sa5 Sb5) (Sb5 Sd4) (Sd4 Sd3) (Sd3 Sd2) (Sd2 Sd1)
(Ne1 Ne2) (Ne2 Ne3) (Ne3 Ne4) (Ne4 Nb6) (Nb6 Na6) (Na6 Sa6) (Sa6 Sb6) (Sb6 Se4) (Se4 Se3) (Se3 Se2) (Se2 Se1)
(Nf1 Nf2) (Nf2 Nf3) (Nf3 Nf4) (Nf4 Ni6) (Ni6 Nj6) (Nj6 Sj6) (Sj6 Si6) (Si6 Sf4) (Sf4 Sf3) (Sf3 Sf2) (Sf2 Sf1)
(Ng1 Ng2) (Ng2 Ng3) (Ng3 Ng4) (Ng4 Ni5) (Ni5 Nj5) (Nj5 Sj5) (Sj5 Si5) (Si5 Sg4) (Sg4 Sg3) (Sg3 Sg2) (Sg2 Sg1)
(Nh1 Nh2) (Nh2 Nh3) (Nh3 Nh4) (Nh4 Ni4) (Ni4 Nj4) (Nj4 Sj4) (Sj4 Si4) (Si4 Sh4) (Sh4 Sh3) (Sh3 Sh2) (Sh2 Sh1)
)

Each line of space links is a represents a chain of spaces that a piece can traverse (from beginning to end) for a potential move. I think (and hope) that much of my Zillions .zrf file for Castle Siege Chess may possibly be leveraged in some manner for programming the game in another game engine. Hopefully, many parts of that code file could be leveraged to save a lot of development time.

You and Harm have been taking a lot of time reading and responding to my posts and each other’s posts. I want to offer to send you and Harm a copy of the Castle Siege Chess board game to show my appreciation. Shipping to Europe will be costly, but your help is definitely worth it. If you would like a copy, please send your mailing address to my email address – richvcreations@gmail.com , unless you are ok with posting it here.
RichV
Posts: 53
Joined: Sun Apr 14, 2019 5:33 pm
Full name: Rich VanDeventer

Re: Chess engines for circular chess boards

Post by RichV »

Harm, thanks for your latest comments.
Note that even an L description with only orthogonal steps (i.e. through cell edges) of the Knight move is ambiguous if you don't specify whether the short or long leg of the L has to be taken first. In the picture on your website you seem to mix these two moves: vertical (= forward or backward) moves start with the long leg, but sideway moves start with the short leg. This seems a very bad idea, because on this warped board it might not always be clear what is forward or sideways. (E.g. when you start in a triangle.) My advice: if you want to stick to the L-shape, require it to start with the long leg in all directions.
In order for a Knight to take full advantage of a triangle’s ability to add additional paths for a potential move, the Knight must be able to pass through the triangle on either the long leg or short leg part of the “L” move (jump) from any of the six spaces that surround (intersect) a triangle. If a Knight can only move initially 2 spaces orthogonally, then the Knight will only be able pass over a triangle from three of the six squares that intersect the triangular space, thus only allowing the Knight to cover 8 spaces when moving from a space that has a common side with a triangle or cover only 7 spaces (a loss of power) when moving from a space that shares a corner with the triangular space. When the Knight can first make either the short leg or long leg part of the “L” move, then it can cross a triangle from 2 different directions and cover 9 spaces (a gain in power) from any of the 6 spaces that intersect a triangular shape. So for the sake of allowing all of the power pieces to gain power by moving through a triangle, I will have to continue to allow the Knights to move across either the long or short leg of the “L” first.

I realize that it might create difficulty when using modern methods of game programming. Castle Siege Chess may have to use old fashioned tables, like I think Zillions of Games does, when coding it for an electronic game. All the children that I have taught to play Castle Siege Chess have been quick to catch on to moves through the triangle, even for the Knights. And almost all the really good chess players have caught on quickly.

Only one chess coach (out of 5 chess coaches that have played Castle Siege Chess) has been experiencing a problem with remembering to think about and plan for moves through the triangles. He knows how they work, but he is too entrenched with trying to make standard chess openings work, which involve only frontal moves across the center of the board. He tends to ignore the circular directions of attack and potential moves through the triangles. He is the only highly experienced chess player that has not beaten me at Castle Siege Chess on either the first, second, or third game. He didn’t beat me until the seventh game. A middle school student recently split the first four games (2-2) with me. Two GMs (Elshan Moradiabadi and his finance Sabina Foisor) teamed up on me for their first game of Castle Siege Chess, playing with Archers and Catapults, and beat the crap out of me. Anytime someone wants to learn Castle Siege Chess, I first ask them if they know how to play Chess. If no, then we start there. I closely tie my game with traditional chess. A traditional chess board is on the back of the Castle Siege Chess board.
Something about Archer and Catapult is still not entirely clear to me: when you say they capture only at a distance of 2, you mean that they can move 1 or 3 squares only if the destination square is empty, and do not capture anything in that case? (As opposed to a Checkers-like capture.)
You are correct. An Archer can be thought of as being a short-range Bishop that can jump. In making a Bishop type move, it can move 1, 2, or 3 spaces diagonally. If the first space is occupied (by either friend or foe) it can jump to the second space (to capture if occupied by a foe, or to reposition if unoccupied) or it can jump to the third space, if it is unoccupied. So yes, a foe is safe on the first and third spaces and in danger of capture on the second space. As you know, with the Knight, a foe on the first or second space (if moving in an “L” shape) is safe but is in danger of capture on the third space.

Besides making the Archer compliment the Bishop and the Catapult compliment the Rook, I made a concerted effort to make the Archer and Catapult perfectly compliment the Knight. For example, a Knight on a white space in the middle of a chess board can capture on 8 dark spaces, all of which are located on the perimeter of a 5x5 area. But the Knight misses all the white space on the perimeter. So I made the Archer and Catapult capture on those white spaces that the Knight misses, which meant that the Archer and Catapult would both have to capture on the second space.

Since the Archer and Catapult are more maneuverable (can move to 12 spaces vs 8 spaces for a Knight) than a Knight, I did not want them to also capture on space 1 and/or 3. I think that as currently configured, a Catapult is slightly more powerful than both the Archer and the Knight, and the Archer is slightly less powerful than a Knight because an Archer has a more difficult time getting past a line of Pawns. I wanted players to feel like the Archers and Catapults could have been a part of chess from the very beginning instead of being some excessively powerful new pieces that are even more powerful than the Queen. Variants that have such pieces are not usually interesting to me because the game usually becomes all about those super powerful pieces. I have had many players of Castle Siege Chess comment about how balanced the game feels and how useful the Archers and Catapults are.
Like Evert says, the hard part will be to produce a GUI. When I mentioned Jocly, I only mentioned it as an example of a way to construct a move generator that would be able to handle such 'inhomogeneous' boards. I wouldn't want to suggest that it would be a good idea to implement your game in Jocly; it is a web interface, and the AI is very generic, and therefore rather weak. Still, Jocly is very general, and can do amazing things. Some variants with irregular boards have already been implemented, and could be used as a starting point:
I looked at both the circular chess and cubic chess Jocly games. Controlling the 3D viewer was almost impossible with Microsoft Edge. But the 2D view was very good and I liked the way it looked. It would be great if my game could be done in 3D, but that is not necessary for now. 2D play initially would be fine for now. The important thing is to get the game online soon, even if that means using tables for moves, which is what I think that Zillions does. Does the script snippet from my CSC .zrf file which I included in my last response to Evert look like a table element (with links referencing board named spaces)?

If it is part of a table, then much of my Zillions code can hopefully be leveraged (maybe not in its exact form) in another chess engine’s code. That will hopefully save a lot of time in the coding effort. Even other things, such as the graphics and board layout (both the wireframe coordinates for the corners for each of the 96 spaces and the naming convention for the spaces) should be usable.

You and Evert have been taking a lot of time reading and responding to my posts and each other’s posts. I want to offer to send you and Evert a copy of the Castle Siege Chess board game to show my appreciation. Shipping to Europe will be costly, but your help is definitely worth it. If you would like a copy, please send your mailing address to my email address – richvcreations@gmail.com unless you are ok with posting it here.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Chess engines for circular chess boards

Post by Evert »

RichV wrote: Sat Apr 27, 2019 2:46 am When I first tried to merge a 6x6 square board into the hole of the Byzantine Chess board, I tried very hard to get rid of the 4 triangles, but without success. As I made the triangles shrink to the point of disappearing, the adjoining three 4-sided spaces merged into a single weird looking shape with no opposite color to maintain alternating colors for moves. So I had to keep the triangles. I didn’t initially know what to do with them, so I painted them red and made the unplayable. The game played terribly because pieces had to work their way the triangular obstacles. I had to make them playable, but how? I did not want to say always turn only to the left (or only to the right) and I didn’t want a piece to have to stop on a triangle, because the piece would lose tempo. That is when I decided to make the triangle a ‘fork in the road’. Since the four triangles were a natural, unavoidable part of the board creation, I don't like to think of them as "topological defects', even if that may be the way they are perceived in game programming.
A topological defect is a point in a lattice where the lattice structure changes or becomes irregular, in this case at the seam between the inner 4x4 board (which is a regular plain board) and the outer 4 rings (which is just the Byzantine board), which results in the three triangular squares. It means that the coordinate system changes (regular Euclidean coordinates will do for the inner 4x4 bit, polar coordinates are better for the outer ring). It doesn't mean there is anything wrong with the board.
Does the script snippet from my CSC .zrf file shown below look like a table element (with links referencing board named spaces)?

; Moves from the South/White Castle

; moving straight north into the Battlefield - wcn

(links wcasn

(Sc1 Sc2) (Sc2 Sc3) (Sc3 Sc4) (Sc4 Sb4) (Sb4 Sa4) (Sa4 Na4) (Na4 Nb4) (Nb4 Nc4) (Nc4 Nc3) (Nc3 Nc2) (Nc2 Nc1)
(Sd1 Sd2) (Sd2 Sd3) (Sd3 Sd4) (Sd4 Sb5) (Sb5 Sa5) (Sa5 Na5) (Na5 Nb5) (Nb5 Nd4) (Nd4 Nd3) (Nd3 Nd2) (Nd2 Nd1)
(Se1 Se2) (Se2 Se3) (Se3 Se4) (Se4 Sb6) (Sb6 Sa6) (Sa6 Na6) (Na6 Nb6) (Nb6 Ne4) (Ne4 Ne3) (Ne3 Ne2) (Ne2 Ne1)
(Sf1 Sf2) (Sf2 Sf3) (Sf3 Sf4) (Sf4 Si6) (Si6 Sj6) (Sj6 Nj6) (Nj6 Ni6) (Ni6 Nf4) (Nf4 Nf3) (Nf3 Nf2) (Nf2 Nf1)
(Sg1 Sg2) (Sg2 Sg3) (Sg3 Sg4) (Sg4 Si5) (Si5 Sj5) (Sj5 Nj5) (Nj5 Ni5) (Ni5 Ng4) (Ng4 Ng3) (Ng3 Ng2) (Ng2 Ng1)
(Sh1 Sh2) (Sh2 Sh3) (Sh3 Sh4) (Sh4 Si4) (Si4 Sj4) (Sj4 Nj4) (Nj4 Ni4) (Ni4 Nh4) (Nh4 Nh3) (Nh3 Nh2) (Nh2 Nh1)
)

; symmetrical reverse of wcasn - battlefield into the white castle

(links bfasswc

(Nc1 Nc2) (Nc2 Nc3) (Nc3 Nc4) (Nc4 Nb4) (Nb4 Na4) (Na4 Sa4) (Sa4 Sb4) (Sb4 Sc4) (Sc4 Sc3) (Sc3 Sc2) (Sc2 Sc1)
(Nd1 Nd2) (Nd2 Nd3) (Nd3 Nd4) (Nd4 Nb5) (Nb5 Na5) (Na5 Sa5) (Sa5 Sb5) (Sb5 Sd4) (Sd4 Sd3) (Sd3 Sd2) (Sd2 Sd1)
(Ne1 Ne2) (Ne2 Ne3) (Ne3 Ne4) (Ne4 Nb6) (Nb6 Na6) (Na6 Sa6) (Sa6 Sb6) (Sb6 Se4) (Se4 Se3) (Se3 Se2) (Se2 Se1)
(Nf1 Nf2) (Nf2 Nf3) (Nf3 Nf4) (Nf4 Ni6) (Ni6 Nj6) (Nj6 Sj6) (Sj6 Si6) (Si6 Sf4) (Sf4 Sf3) (Sf3 Sf2) (Sf2 Sf1)
(Ng1 Ng2) (Ng2 Ng3) (Ng3 Ng4) (Ng4 Ni5) (Ni5 Nj5) (Nj5 Sj5) (Sj5 Si5) (Si5 Sg4) (Sg4 Sg3) (Sg3 Sg2) (Sg2 Sg1)
(Nh1 Nh2) (Nh2 Nh3) (Nh3 Nh4) (Nh4 Ni4) (Ni4 Nj4) (Nj4 Sj4) (Sj4 Si4) (Si4 Sh4) (Sh4 Sh3) (Sh3 Sh2) (Sh2 Sh1)
)

Each line of space links is a represents a chain of spaces that a piece can traverse (from beginning to end) for a potential move. I think (and hope) that much of my Zillions .zrf file for Castle Siege Chess may possibly be leveraged in some manner for programming the game in another game engine. Hopefully, many parts of that code file could be leveraged to save a lot of development time.
From the looks of it, it's a table that links neighbouring squares. Similar to what I was thinking of, but probably not something that can be brought over directly. I'm not too familiar with Zillions of Games, never having owned the software and not having a computer that will easily run it.
You and Harm have been taking a lot of time reading and responding to my posts and each other’s posts. I want to offer to send you and Harm a copy of the Castle Siege Chess board game to show my appreciation. Shipping to Europe will be costly, but your help is definitely worth it. If you would like a copy, please send your mailing address to my email address – richvcreations@gmail.com , unless you are ok with posting it here.
You're very generous. At this point I feel like I haven't done anything more than offer feedback and ask questions, so I'm not sure I feel that I've earned something like that for free. I might nevertheless be interested though, because I'm a bit of a chess-equipment collector (board game hoarder, my wife would say) but let's hold off on it for the moment. If HGM is interested, it may be possible to arrange for some combined shipping and save on costs.
RichV
Posts: 53
Joined: Sun Apr 14, 2019 5:33 pm
Full name: Rich VanDeventer

Re: Chess engines for circular chess boards

Post by RichV »

Evert, Nice to know that a topological defect only applies to irregular changes in the direction of a 3D objects lattice (which I assume is the same thing as an object’s wireframe drawing). Speaking of wireframes, I created an AutoCAD drawing of the wireframe for the CirSquare 96 board. To color the board spaces, add the walls, and add other images and text, I imported the .dwg of the wireframe initially into Corel Draw, then later into Photoshop, and most recently into Adobe Illustrator. I also created two larger boards, CirSquare 148 and CirSquare 208, which I have not made games for yet. If you or HGM would ever like to invent your own game(s) for a CirSquare board, I would be glad to give you a native drawing of the board.

It is too bad that the owners of Zillions of Games seem to have pretty much lost interest in their chess engine. Their site has had very little activity. Whenever I have asked them a question or had difficulty scripting part of may game (castling and en-passant), they have either been very slow to respond or have not responded at all. Overall, I thought that ZoG script was fairly easy to figure out by looking at how traditional chess had been scripted for ZoG. My script is probably carrying a lot of extra and unnecessary code, but it works quite well, and that is what matters for me. The main bad part is its cost.

I did not know that you and HGM live near each other. I hope that he will want the CSC board game, too. In the summer of 2017, my wife and I vacationed to England and Amsterdam. I wish that I known you and HGM then so that I might have been able to meet you in person. While we were there, we took a train to Deventer (the town my last name comes from) and spent one night there. A festival happened to be occurring then. It was a quaint town and we had a great time. When I asked a local store owner if there were still any VanDeventers living there, she said that most of them had left during the two world wars. Now that I am retired, we probably will not be able to afford to travel overseas again. However, if my game becomes a really good seller, we will definitely come to Amsterdam again.

Tonight, I went to a local board games club meeting, for which about 50 people attended. It was my first time to attend that club and I sold 3 CSC games, my best one night of sales ever. That is 5 for this week and 57 overall. So it is starting show some great promise. I am going to have to start working even harder toward getting ready for a Kickstarter next year.
User avatar
Evert
Posts: 2929
Joined: Sat Jan 22, 2011 12:42 am
Location: NL

Re: Chess engines for circular chess boards

Post by Evert »

RichV wrote: Sat Apr 27, 2019 2:49 am In order for a Knight to take full advantage of a triangle’s ability to add additional paths for a potential move, the Knight must be able to pass through the triangle on either the long leg or short leg part of the “L” move (jump) from any of the six spaces that surround (intersect) a triangle. If a Knight can only move initially 2 spaces orthogonally, then the Knight will only be able pass over a triangle from three of the six squares that intersect the triangular space, thus only allowing the Knight to cover 8 spaces when moving from a space that has a common side with a triangle or cover only 7 spaces (a loss of power) when moving from a space that shares a corner with the triangular space. When the Knight can first make either the short leg or long leg part of the “L” move, then it can cross a triangle from 2 different directions and cover 9 spaces (a gain in power) from any of the 6 spaces that intersect a triangular shape. So for the sake of allowing all of the power pieces to gain power by moving through a triangle, I will have to continue to allow the Knights to move across either the long or short leg of the “L” first.
Ok, so the Knight can move as either a (1, 2) or as a (2, 1) leaper. That's normally exactly the same, but for your board it can be different. That is important to know.
What is confusing about the diagram you use to show the Knight move is that you derive all 8 normal squares from two initial directions (up and down) and then using the difference between (1, 2) and (2,1) to arrive at all 8 squares. It gives the impression that the Knight moves "up" or "down" initially, but never sideways initially. I don't think that's what you intend?
You are correct. An Archer can be thought of as being a short-range Bishop that can jump. In making a Bishop type move, it can move 1, 2, or 3 spaces diagonally. If the first space is occupied (by either friend or foe) it can jump to the second space (to capture if occupied by a foe, or to reposition if unoccupied) or it can jump to the third space, if it is unoccupied. So yes, a foe is safe on the first and third spaces and in danger of capture on the second space. As you know, with the Knight, a foe on the first or second space (if moving in an “L” shape) is safe but is in danger of capture on the third space.

Besides making the Archer compliment the Bishop and the Catapult compliment the Rook, I made a concerted effort to make the Archer and Catapult perfectly compliment the Knight. For example, a Knight on a white space in the middle of a chess board can capture on 8 dark spaces, all of which are located on the perimeter of a 5x5 area. But the Knight misses all the white space on the perimeter. So I made the Archer and Catapult capture on those white spaces that the Knight misses, which meant that the Archer and Catapult would both have to capture on the second space.
Ok, so in a sense your Archer and Catapult are restricted sliders that can move up to 3 spaces away rather than leapers that completely ignore the squares they pass (since they are still affected by the triangle).
Since the Archer and Catapult are more maneuverable (can move to 12 spaces vs 8 spaces for a Knight) than a Knight, I did not want them to also capture on space 1 and/or 3. I think that as currently configured, a Catapult is slightly more powerful than both the Archer and the Knight, and the Archer is slightly less powerful than a Knight because an Archer has a more difficult time getting past a line of Pawns. I wanted players to feel like the Archers and Catapults could have been a part of chess from the very beginning instead of being some excessively powerful new pieces that are even more powerful than the Queen. Variants that have such pieces are not usually interesting to me because the game usually becomes all about those super powerful pieces. I have had many players of Castle Siege Chess comment about how balanced the game feels and how useful the Archers and Catapults are.
Indeed. Pieces such as the Chancellor, Archbishop and Amazon are very popular, but they're so powerful that they dominate the game if there's more than one of them. This is a problem with Seirawan's Chess: having three super pieces on an 8x8 board is just too much.
Take a look at table 1 from https://www.gnu.org/software/xboard/Betza.html for some context on what I'm about to say next.
You Archer (GAF) combines the moves of the original Queen (the Ferz, F), the original Bishop (the Alfil, A) and the unnamed (3,3) leaper (G) which would be next to useless on a normal 8x8 board. The Catapult (WDH) combines the Wazir (W) and Dabbaba (D) (both popular pieces in historic and fairy variants) with the otherwise unnamed (3,0) leaper (H).
On a normal board, the (relative) value of leapers can be estimated based on how they move: each square pieces can move to contributes a point. Forward moves contribute two points. Capture moves are worth twice the value of normal moves.
On that scale: the Pawn is 10 points, which, somewhat surprisingly, works out to a reasonable value in such games as Shatranj and Makruk. The Knight is 36 points, which is a fairly useful reference value. The GAF is 54 points, the WDH is worth 45 points. Both are Rook-class pieces, which is a nice value point to be at: not overpowering, but stronger than a Knight or a Bishop. Note that the GAF (Archer) is expected to be stronger than the WDH (Catapult).
You can compare these to the Lieutenant (FA) and Captain (WD) of Spartan Chess (the Lieutenant also has a non-capture sideward step, but that doesn't really affect its value much), which are minor (Knight/Bishop class) pieces.

Of course, your Archer and Catapult don't move the same way they capture: they can only capture on A/D squares. That decreases their value significantly, down to 30 points for the Archer and 25 points for the Catapult, (just) below the value of a Knight. Of course, that's all based on analysis done on a regular (even 8x8) board.
RichV
Posts: 53
Joined: Sun Apr 14, 2019 5:33 pm
Full name: Rich VanDeventer

Re: Chess engines for circular chess boards

Post by RichV »

Wow! You and HGM never cease to amaze me with your chess and chess programming knowledge. I went to the Xboard Betza site and spent a while there being totally confused, but I did eventually begin to understand Table 1. The 5x5 square of 16 positions was what I used to try to make my Archers and Catapults ‘perfectly’ complement the Knight. The Knight hits 8 of the positions but misses the other 8. So I made the Archer and Catapult combined hit the 8 the Knight missed. By making the A and C capable of moving to 12 total spaces each instead of 8 for a Knight and in a more straight forward manner, I thought that might make up for only being able to capture on half the spaces of a Knight.

I got lost in your explanation where a GAF was 54 points for a leaper but only 30 points when it comes to capturing and the WDH at 45 points for a leaper and 25 points for capturing. If they can be averaged together, their values would be close to that of a Knight. Intuitively, that is what I guessed and had assigned 3 points to both the A and C on the Chess piece value scale (P = 1, N = 3, B = 3, Rook = 5, Q = 9. The CirSquare 96 board increases the power of the B, R, and Q due to the increased range based on the board being 50% larger and the triangles giving them more paths to travel when going through them. Using the same Chess piece value scale, I have given (basically arbitrarily) 2 more points to each of them (B, R, and Q). I think that maybe it should be more like B=5, R=8, Q=12 or 13.

Getting back to the Archers and Catapults, an Archer cannot get on a diagonal space in front of an opponent’s Pawn, thus it can only attack the Pawn from 2 spaces away or jump to one space behind it. This makes it a little weaker than the Catapult, which can either attack a Pawn from 2 spaces in front of it or move directly in front of the Pawn to either attack the square behind it or move to the second square behind it. In actual games, I favor the Catapult over the Archer in the opening and mid games and then tend to treat them more equally in the late end game.
I am very anxious to have you and HGM play Castle Siege Chess a few times (it takes 3 games to really get the feel of the power of moving through the triangular spaces and the ability to attack the opponent from 3 directions) to critique it and either verify or refute my logic about the triangles and the power/usefulness of the Archers and Catapults. Besides that, I would like to know if you would enjoy playing Castle Siege Chess. I am still hoping that both of you will accept my offer of giving you each a copy. And if you like the idea of adding some elements of chance to chess, I will make it copies of Castle Attack Chess (which includes 4 games – orthodox Chess (on the back side of the quad-fold board), Castle Siege Chess, Castle Action Chess, and Castle Attack Chess). Sorry for not being more creative with the names; I was trying to make the names be somewhat descriptive of what the games are about.

Not having any prior knowledge of the other chess-like ancient games or having any experience with chess programming, it was still relatively easy for me to understand the Zillions of Games script because the script is very literal in describing the moves and ZoG is a general board game engine more than just a chess game engine, so I think it is not tied to the moves referenced by Xboard Betza.

The move definitions for Castle Siege Chess pieces in ZoG are shown below (I have no idea how the ZoG engine applies the script internally to make the actual moves) (I hope this is not ‘too much information’):

************************************************
; DEFINE PIECE MOVE TYPES

; King
(define leap1
(
$1 (verify not-friend?) add
)
)

(define checkatcastlewall
(
(verify attacked?)
(verify (in-zone? $1))
$2 (verify not-friend?) add
)
)

(define notcheckatcastlewall
(
(verify not-attacked?)
(verify (in-zone? $1))
$2 (verify not-friend?) add
)
)

; Queen
; has the same moves as the Rook and Bishop

; Knight
(define leap2a
(
$1 $1 $2 (verify not-friend?) add
)
)

(define leap2b
(
$1 $2 $2 (verify not-friend?) add
)
)

; Archers and Catapults - move 1,2, or 3, jump 1 or 2, capture on 2 only
(define leap2s
(
$1 (if empty? add) $1 (if (or empty? not-friend?) add) $1 (if empty? add)
)
)

(define slide
(
$1 (while empty? add $1) (verify not-friend?) add
)
)

(define bslide
(
$1 (while empty? add $1) (verify not-friend?) add
)
)


(define cslide
(
(verify (in-zone? $1))
$2 (while (and empty? (not-in-zone? $3)) add $2)
(verify (not-in-zone? $3))
(verify not-friend?) add
)
)

; rook slides from triangular spaces

(define tslide
(
(verify (in-zone? $1))
$2 (while empty? add $2) (verify not-friend?) add
)
)

; promoting pawns

(define Pawn-add
(if (in-zone? promotion-zone) (add Knight KnightRt Bishop BishopRt Rook Queen Archer ArcherRt Catapult CatapultRt) else add)
)

(define Pawn-movez
(
$2
(verify empty?)
(verify (in-zone? $1))
(Pawn-add)
)
)

(define Pawn-moves
(
(verify never-moved?)
$2
(verify (in-zone? $1))
(verify empty?)
$2
(verify empty?)
(set-attribute never-moved? false)
add
)
)

(define Pawn-capture
(
$1 $2
(verify enemy?)
(Pawn-add)
)
)

(define Pawn-capturez
(
(verify (in-zone? $1))
$2 $3
(verify enemy?)
(Pawn-add)
)
)

; Bishops and Rooks use the same 'slide' definition of the Archer and Catapult but have more extensive link definitions
********************************************************
The talkchess.com text editor left justified all of the script.
I hope that this gives you at least little insight into how ZoG and its script works. If you want to see the full ZoG script for my game, the ZRF file is attached to a previous post. It can be read by most any text editor.
User avatar
Guenther
Posts: 4605
Joined: Wed Oct 01, 2008 6:33 am
Location: Regensburg, Germany
Full name: Guenther Simon

Re: Chess engines for circular chess boards

Post by Guenther »

RichV wrote: Sun May 05, 2019 6:10 am The move definitions for Castle Siege Chess pieces in ZoG are shown below (I have no idea how the ZoG engine applies the script internally to make the actual moves) (I hope this is not ‘too much information’):

Code: Select all

************************************************
; DEFINE PIECE MOVE TYPES

; King 
	(define leap1
		(
			$1 (verify not-friend?) add
		)
	)
	
	(define checkatcastlewall
		(
			(verify attacked?)
			(verify (in-zone? $1))
			$2 (verify not-friend?) add
		)
	)	

	(define notcheckatcastlewall
		(
			(verify not-attacked?)
			(verify (in-zone? $1))
			$2 (verify not-friend?) add
		)
	)

; Queen
;	 has the same moves as the Rook and Bishop

; Knight
	(define leap2a
		(
		$1 $1 $2 (verify not-friend?) add
		)
	)

	(define leap2b
		(
		$1 $2 $2 (verify not-friend?) add
		)
	)

; Archers and Catapults - move 1,2, or 3, jump 1 or 2, capture on 2 only 
	(define leap2s
		(
			$1 (if empty? add) $1 (if (or empty? not-friend?) add) $1 (if empty? add)
		)
	)

	(define slide
		(
			$1 (while empty? add $1) (verify not-friend?) add
		)
	)

	(define bslide
		(
			$1 (while empty? add $1) (verify not-friend?) add
		)
	)

	
	(define cslide
		(
			(verify (in-zone? $1))
			$2 (while (and empty? (not-in-zone? $3)) add $2) 
			(verify (not-in-zone? $3))
			(verify not-friend?) add
		)
	)

; rook slides from triangular spaces

	(define tslide
		(
			(verify (in-zone? $1))
			$2 (while empty? add $2) (verify not-friend?) add
		)
	)

; promoting pawns 

	(define Pawn-add
		(if (in-zone? promotion-zone) (add Knight KnightRt Bishop BishopRt Rook Queen Archer ArcherRt Catapult CatapultRt) else add)
	)

	(define Pawn-movez
		(
			$2
			(verify empty?)
			(verify (in-zone? $1))
			(Pawn-add)
		)
	)

	(define Pawn-moves
		(
			(verify never-moved?)
			$2
			(verify (in-zone? $1))
			(verify empty?)
			$2 
			(verify empty?) 
			(set-attribute never-moved? false) 
			add
		)
	)

	(define Pawn-capture
		(
			$1 $2
			(verify enemy?)
			(Pawn-add)
		)
	)

	(define Pawn-capturez
		(
			(verify (in-zone? $1))
			$2 $3
			(verify enemy?)
			(Pawn-add)
		)
	)

; Bishops and Rooks use the same 'slide' definition of the Archer and Catapult but have more extensive link definitions
********************************************************
The talkchess.com text editor left justified all of the script.
I hope that this gives you at least little insight into how ZoG and its script works. If you want to see the full ZoG script for my game, the ZRF file is attached to a previous post. It can be read by most any text editor.
You can use the <code style> for posting formatted text e.g. code. ('</>' in the feature list for editing posts)
https://rwbc-chess.de

trollwatch:
Chessqueen + chessica + AlexChess + Eduard + Sylwy