I've never played Chess960/FRC ("free range chickens" as I like to think of it ) but was wondering how hard it is to add to an engine?
I just did some reading and it seems that the only real difference is castling, so I guess the code changes would just be in the routine to generate castling moves and the Make/Unmake routines to execute them.
Is that it? Is it really that simple?
Or am I missing something?
Implementing FRC?
Moderators: hgm, Rebel, chrisw
-
- Posts: 69
- Joined: Thu Nov 21, 2013 12:37 am
- Location: Manchester, UK
- Full name: Martin Bryant
-
- Posts: 895
- Joined: Mon Jan 15, 2007 11:23 am
- Location: Warsza
Re: Implementing FRC?
Royal mess with GUI compatibility. When bcm314 kindly added FRC to Rodent, he ended up writing some code to detect Arena GUI.
Pawel Koziol
http://www.pkoziol.cal24.pl/rodent/rodent.htm
http://www.pkoziol.cal24.pl/rodent/rodent.htm
-
- Posts: 127
- Joined: Sat Aug 21, 2021 9:55 pm
- Full name: Jen
Re: Implementing FRC?
Yes that's it. Though there's a few tricky things to be mindful of when implementing castling - king not moving, king moving to a square that is occupied by the castling rook, or stepping into a discovery attack, that would otherwise be blocked by the rook ... I found it easiest to just remove the rook -> check all squares are safe -> move the king -> place a new rook at the destination square. Maybe this will help you avoid some bugs i found in my code when implemeting FRC Also, Ethereal's FRC Perft test suite was very helpful for making sure everything works properly.
Since there is no official UCI command for FRC (as far as i know), the biggest problem i found was trying to figure out how to encode the castling move when sending it to the GUI (and decoding the move sent from GUI). I believe most GUIs and engines just encode the castling move as king capturing the rook on the side you are trying to castle towards. But as PK said, Arena seems to be broken when playing FRC matches, i never got that one working properly.
Since there is no official UCI command for FRC (as far as i know), the biggest problem i found was trying to figure out how to encode the castling move when sending it to the GUI (and decoding the move sent from GUI). I believe most GUIs and engines just encode the castling move as king capturing the rook on the side you are trying to castle towards. But as PK said, Arena seems to be broken when playing FRC matches, i never got that one working properly.
-
- Posts: 2488
- Joined: Tue Aug 30, 2016 8:19 pm
- Full name: Rasmus Althoff
Re: Implementing FRC?
There is, in the last section of the spec (version: April 2006). It also includes how to encode the castling move to the GUI: "castling moves are sent in the form king "takes" his own rook."
Rasmus Althoff
https://www.ct800.net
https://www.ct800.net
-
- Posts: 1442
- Joined: Wed Apr 21, 2010 4:58 am
- Location: Australia
- Full name: Nguyen Hong Pham
Re: Implementing FRC?
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
The most features chess GUI, based on opensource Banksia - the chess tournament manager
-
- Posts: 69
- Joined: Thu Nov 21, 2013 12:37 am
- Location: Manchester, UK
- Full name: Martin Bryant
Re: Implementing FRC?
Thanks for all the excellent replies. I'll look into them.
-
- Posts: 3554
- Joined: Thu Jun 07, 2012 11:02 pm
Re: Implementing FRC?
Plenty of open source engines that support FRC that you could look at to get an idea how to handle it