Chess engines for circular chess boards

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

RichV
Posts: 53
Joined: Sun Apr 14, 2019 5:33 pm
Full name: Rich VanDeventer

Chess engines for circular chess boards

Post by RichV »

Does anyone know of a chess engine that can be used to program and run chess variants that use circular chess boards?

Castle Siege Chess is a cross between Byzantine (Circular) Chess and traditional chess. To create its unique chess board, I dropped a 6x6 square chess board into the hole of the circular Byzantine board and then perfectly merged it with inner circular band. I named it "CirSquare 96" to give it a medieval sounding name and because it has 96 playing spaces.
C plus BC equals CSC 640x458.png
The board is divided into two castles (starting areas) and a battlefield (four ranks between the castles). To fill the four empty spaces in each castle, I invented two new pieces--Archer and Catapult. The two new pieces compliment the Bishops, Knights, and Rooks and make the chess set more like a medieval army.
CSC_Super_Army_fullboard_708x708.jpg
I used the Zillions of Games script language to program Castle Siege Chess. There are 18 variations of the game based on different setups of the chess pieces. They play very well (except I could not figure out how to make castling and en passant work). Zillions of Games seems to be a strong chess engine.

When I show my board game versions to potential buyers, they usually love the games, but almost always ask if there is a computer version that they can play to help them learn to play Castle Siege Chess quickly. They are disappointed when I tell them that they have to spend another $25 for Zillions of Games to be able to play it on a computer and online.

So I am looking for an open source game/chess engine that is relatively easy to use to program a free-to-use, online or computer version of Castle Siege Chess. Even better would be to find someone who would like to take on the challenge themselves. I can provide all the necessary graphics/images.

Thank you very much. Looking forward to your response.
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 »

When I clicked Submit for my original post, the second graphic disappeared. It shows the Archers and Catapults added to the chess set:
CSC_Super_Army_fullboard_708x708.jpg
User avatar
hgm
Posts: 27789
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 »

How do Rooks and Bishops move through the triangular board cell? do their trajectories bifurcate there? And how do Knight jumps work in this vicinity?
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 »

The triangular spaces act like a "fork" in the road. The Rooks and Queens moving into a triangular space can exit the triangular space across either of the other two sides. Notice that the color of the squares continues to alternate as the move continues through a triangle.

Bishops and Queens moving into a triangular space across a corner can exit the triangular space across either of the other two corners. Notice that the color of squares continues to be the same as the move continues through the triangle.

A Knight's more through a triangle is very interesting. It took about 3 years of play testing before I realized how the triangles affect their movements. You have to think of the path through a triangle is refracted similar to light through glass or water--the path has been bent by one side of a rectangle being removed. The graphic below shows how a knight moving through a triangular space covers the two spaces that next to the knight while also next to the triangle:
knight moves thru triangles.jpg
To prevent the Queens, Rooks, and Bishops from becoming too powerful on the CirSquare 96 board, I added a rule that a piece cannot have more than two wall crossings on one move.


There are many examples of piece moves on my website on the following page: http://www.castlestrife.com/03_csc_03_0 ... moves.html .


Thanks Harm.
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 »

Wow, that is a board with some seriously odd topology.
On the one hand, I like how it preserves things like parity (square colour) through the clever use of a triangular square. On the other hand, I like that regular chess is simple in the sense that you can visualise moves on the board easily. That is lost here (you end up with multiple paths leading to the same location, sometimes through some seriously curved paths), and I'm not sure I like that. It'll make the game relatively hard to play for a human (compared to a computer).

I doubt any existing software would be able to handle it easily. Certainly none of mine can (but I don't have programs written with circular boards in mind). It might be interesting to write something for it though, but I'd have to give some serious thought to things like logical ways to enumerate squares for the purpose of move generation. I'll give that some thought.

Do you have an "official" way to enumerate squares (for notation purposes)?
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 »

Thanks Evert. Great comments. It took 5 attempts before I finally came up with the easiest way to annotate spaces on the CirSquare 96 board.

The board is divided horizontally into two halves - North and South. Each half is numbered radially just outside the outer ring. The North half is numbered Na thru Nj starting from the left side. The South half is numbered Sa thru Sj, starting from the left side. Numbering inward from the outer ring, the spaces in the castles are numbered 1 thru 4 and the spaces in the battlefield (4 ranks between the castles) are numbered 1 thru 6. The numbers on an actual board are very small, as shown in second image in my original posts. See the following graphic below that shows all the squares numbered for illustration.
Anotated CirSquare 96 800x white.gif
To determine the annotation for a particular space, start from the outside to obtain the proper North or South designation (for example Nc) andthen count inward to the particular space to add the space number (for example 3). The example space full annotation would be Nc3 and would be for a space on the far left side of the north castle that is 3 spaces from the edge of the board.

Actually learning how to play Castle Siege Chess is easy for someone who already knows how to play traditional chess. All the rules for traditional chess apply. There are only 4 new rules, which pertain to the board. All the principles of traditional chess apply; however, all those memorized openings do not work. A player has to think about applying the principles of chess instead of making a series of memorized moves in the opening phase of a game. Not being one to memorize openings, I love being on more equal footing with better chess players. In 4 years of heavy game play testing at chess clubs, I have only found a couple of really good chess players, one of which is a chess coach, who is having a difficult time getting used to the moves through the 4 triangular shaped spaces. He is concentrating too hard on just a standard frontal attack and not thinking about the other two directions of attack and moves through the triangles.

The board actually provides 3 directions of attack on the opponent's starting positions - left side, frontal, and right side. Moves through the triangular spaces, which are forks in the road, allow for potential sneak attacks on an opponent who is not paying close attention to your pieces which are aligned with a triangle. I have actually had several chess players say that playing Castle Siege Chess (CSC) makes them better traditional chess players because they have to pay closer attention when playing CSC. And 2 GMs who live near me beat the crap out of me the very first time they played me in Castle Siege Chess using the Archers and Catapults. There are 4 different armies (based on what additional 4 pieces are used in the 4 spaces in the back of the castles) that can be used in Castle Siege Chess.

At my last Castle Siege Chess tournament at North Carolina State University, the president of the club (a high 1900s ranked player) won the intermediate level and a middle school girl won the beginners level. 100s of photos of people playing Castle Siege Chess (and some of my other games in the Castle Strife Collection) are posted on my meetup site at: https://www.meetup.com/Castle-Chess-Club/photos/ . The "Castle Siege Chess Tournament at NCSU 03-31-2019" album has the photos of the winners I just referred to.

As for existing software that can handle Castle Siege Chess, I programmed it in Zillions of Games, which plays it exceptionally well. You can download the Zillions .zrf file, which is just a script file, either from the Zillions of Games site or from my CastleStrife.com site. My problem with Zillions is that it costs $25 to buy it and the trial version will not run games that are not included in the Zillions of Games download. Since Zillions of Games can handle boards other than rectangular ones, I would think that surely there must be other game engines (open source and free) out there that can do it, too.

Sorry for the long post. Thanks for your interest.
User avatar
hgm
Posts: 27789
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 »

The Jocly AI should have no problems doing this. (The Jocly UI is another matter, though.) There the move generator is based on a 3d array (actually an array of arrays of arrays), graph[fromSqr][direction][range]. The 'direction' actually is an arbitrary sequence number, and for all directions all ranges up to an obstacle are traversed, and used as toSqr for a given fromSqr. It would be a pain to initialize that array for a board like this, of course. But once that is done, move generation is not more difficult than for any other variant. You would sometimes get duplicats of moves, though. (But that can happen on ordinary boards too, for pieces with multi-path moves.)
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 »

I have been rooting around in my Zillions of Games script for Castle Siege Chess to see how I avoided the "duplicates of moves" potential problem that might occur with Jocly. It will be easier for me to explain what I did if I know that you are familiar with Zillions scripting. Have you ever scripted a game for Zillions of Games?

I think that when I first began scripting my games in Zillions, I ran into the forked path problem and eventually solved it. In Zillions, path "Links" for moves can only have one starting point and one ending point. I started out trying to link all the spaces included in the entire fork (including all 3 legs) as one move definition. Zillions gave me an error and would not generate the game file. So I had to generate 3 separate links (named paths) from each beginning point for a possible move through a given triangular space. I used too many small groups of links in an effort to maintain my sanity while tracking down all the possible moves on the board. Zillions only allows a maximum of 100 named groups of links (groups of similar moves), which I soon exceeded. So I had to go back and combine links or parts of links with other ones until I was able to get below 100. I used acronyms a lot when naming the links to keep the names short. So I used letters for clockwise, counterclockwise, for heading in various directions, b for black, w for white, etc.

I am really a novice when it comes to programming games. It took a lot of effort for me to reverse engineer a Zillions traditional chess game to turn it into a Castle Siege Chess game. I am sure that my scripting will look terrible to a professional programmer like you. I don't know how to use arrays, so my code works by brute force instead of sophistication. In case you would like to look at the script, I have attached the Zillions .zrf file as a zip file. The full download including the graphics is available on my website at: http//:www.castlestrife.com/03_csc_03_08_csc_c_game.html .

I used notepad++ to highlight (mark) all the code references to the triangular spaces (Nc4, Nh4, Sc4, and Sh4), but the highlights would not save. When looking through or editing the script, I keep a copy of the numbered board (shown in an earlier post) open to make it easy to trace the links (move paths).

I have not looked at Jocly yet. Since I am not familiar with Java code, that is probably going to be a real head scratcher, especially since I am almost 75 years old. For this old dog, learning new tricks gets more difficult every 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: Mon Apr 22, 2019 7:33 pm A Knight's more through a triangle is very interesting. It took about 3 years of play testing before I realized how the triangles affect their movements. You have to think of the path through a triangle is refracted similar to light through glass or water--the path has been bent by one side of a rectangle being removed. The graphic below shows how a knight moving through a triangular space covers the two spaces that next to the knight while also next to the triangle:
I’m afraid I don’t quite follow the logic for the knight’s move as shown. I would expect the following (red arrows/blue stars overlaid on your image).
9601A9B8-E12E-4258-8133-4B6BABBDB68E.png
The logic I followed is that a knight moves as a Wazir (orthogonal) and then as a Ferz (diagonal) in the same direction (giving it two moves per W-step). So the Knight moves as a Wazir onto the triangle and then moves outward “diagonally”, meaning colourbound. That gives it the one square to the left of the triangle (it enters the square through an edge, then exits through the one opposing vertex).
What is the logic for the two extra squares next to the knight? I don’t necessarily object, but it seems odd and I don’t understand the reason behind it.
Harald
Posts: 317
Joined: Thu Mar 09, 2006 1:07 am

Re: Chess engines for circular chess boards

Post by Harald »

You described the knight move as Y shaped. You could also desribe it as T shaped.
Two steps orthogonally and then one step to each side.