ICS protocol question: FRC

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ICS protocol question: FRC

Post by hgm »

Bashing you? :shock: I did not even mention you.

Fact is that there are two standards, and that it is much easier for any programmer to understand both than to do extra work in order to sabotage his own program so that he can figure out which standard is being used and then refuse it if it is not the one of his choice. It is that which I consider childish.

If you feel that this apply to you, I feel sorry for you. But it won't alter my opinion. That is just a fact, and has nothing to do with bashing anyone. I am not going to do extra work as a GUI writer that is solely aimed at facilitating vendettas, and serves no useful purpose. Make sure your engines behave like grown ups, and understand what A-H in the castling filed means when they are playing FRC.

Arena is defective in this respects, and is not able to indicate which Rook has the castling rights if both Rooks are on the same side (see post in WinBoard forum). We are not going to duplicate that here!
adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

Re: ICS protocol question: FRC

Post by adams161 »

hi,

you can do what a chess program does, at least mine works this way but they are all similar. i store 6 variables. k1c r1c r2c k1p r1p r2p and set them to teh rooks and king original spaces. i.e. if r2c is on board spot 7 i set it to 7. if a rook ever moves that is on spot 7 i set it to 0 and there is no longer caslting privaledges for that rook.

Mike
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ICS protocol question: FRC

Post by hgm »

Yes, this is exactly the way I do it in WinBoard_F. On each move it compares the from and the to square to all the 6 castling rights, and clears them if there is a match.

But the question is more how exactly the ICS is going to tell me how I should set those variables. For instance, if I want to resume a suspended FRC game.
adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

Re: ICS protocol question: FRC

Post by adams161 »

the way winboard sends suspeneded games to the engine is it first sends the board, then the move list. So i can set castle rights when i get the board, then modify them as i parse the move list to get ready for the current position. because winboard seems to know both the initial board and the move list i would assume this would work on the interface side as well.
adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

Re: ICS protocol question: FRC

Post by adams161 »

this is in winboard_x from the debug file

Feeding position and moves 0 through 4 to first chess program
57547 >first : force
57547 >first : setboard bnqbrknr/pppppppp/8/8/8/8/PPPPPPPP/BNQBRKNR w KQkq - 0 1
57547 >first : g1f3
57547 >first : g8f6
57547 >first : h2h3
57547 >first : b7b6


from that info i know everything i need to know about castle rights if i track castle right from move to move as i get ready for the initial postion.

Mike
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ICS protocol question: FRC

Post by hgm »

So you basically say there is no need to encode the castling rights in the board: if the board sent is board[0] (the first position of the game) I can simply assume that any Rook has castling rights. And for every other board I should ignore what it says, as I can reconstruct the castling rights from that initial position and the move list.

In FRC that might indeed work. In variant normal it would definitely not work, as there are some wild variants that are considered as 'normal', but with a funny initial position. There the initial position is sent as board[0], and there is no guarantee that all castling rights are present. There might not be any FRC wild variants, though, as they probably consider FRC in itself wild enough... It still seems a bit of a kludge to solve it this way.

I still would be interested to know what exactly the ICS sends for the following position if Rg1 has castling rights, and what it would send if Rf1 has castling rights:
8 
7 
6 
5 
4 
3 
2 
1 
abcdefgh

3kq3/3pp3/8/8/1PP2PP1/8/8/1K3RR1 w
User avatar
hgm
Posts: 28353
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: ICS protocol question: FRC

Post by hgm »

adams161 wrote:this is in winboard_x from the debug file

Feeding position and moves 0 through 4 to first chess program
57547 >first : force
57547 >first : setboard bnqbrknr/pppppppp/8/8/8/8/PPPPPPPP/BNQBRKNR w KQkq - 0 1
57547 >first : g1f3
57547 >first : g8f6
57547 >first : h2h3
57547 >first : b7b6


from that info i know everything i need to know about castle rights if i track castle right from move to move as i get ready for the initial postion.

Mike
Yes, I know what Winboard sents to the engine. But what does the Chess server send to WinBoard?
adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

Re: ICS protocol question: FRC

Post by adams161 »

out of the variants that are not setboard variants of variant normal, there are 3 that contain castling rights in the intial postion, fischerandom, wildcastle, and twoking. in two king the rooks are always on a1 and h1.

here is a description of wildcastle on icc:

1: In this variant both sides have the same set of pieces as in normal chess. The white king starts on d1 or e1 and the black king starts on d8 or e8, and the rooks are in their usual positions. Bishops are always on opposite colors. Subject to these constraints the position is random. Castling is similar to normal chess: o-o-o indicates long castling and o-o short castling.

so agian rooks are on a1 and h1 in initial postion.

in fr in the initial postion rooks are always set with one closer to a1 and the other closer to h1.

so for all 3 of these its simple to figure out the initial postion castle rights.

icc supports some other set board variants like reversed or advanced pawns. In all of these the first and eight rank are set up like wild 0 or regular chess and the rooks are on a1 and h1. only the pawns are on a different rank.

on fics you have style 0 and style 1 as well with castle rights. again rooks appear to be on a1 h1 in their intial postion.

Style 0: White has the typical set-up at the start. Black's pieces are the
same, except that the King and Queen are reversed, so they are not on the same
files as White's King and Queen. Castling is done similarly to normal chess:
o-o-o indicates long castling and o-o short castling.

Style 1: In this variant both sides have the same set of pieces as in normal
Type [next] to see next page.
next
chess. The white king starts on d1 or e1 and the black king starts on d8 or
e8, and the rooks are in their usual positions. Bishops are always on
opposite colors. Subject to these constraints the position of the pieces on
their first ranks is random. Castling is done similarly to normal chess:
o-o-o indicates long castling and o-o short castling.


so as far as i can tell the only wild with castle rights on an ics where the rooks are not on a1 h1 is fischer random. in wild 1 and style 1 i think its is the king can be on d1 or e1 but rooks are always on a1 h1.

Mike


note 'help wild' on both icc and fics
adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

Re: ICS protocol question: FRC

Post by adams161 »

i should add that winboard currently has support for all wild variants with castle rights except for fr. the rooks are always on a1 and h1 and the king can in 2 of the variants be on e1 or d1. otherwise the king is always on e1. nothing is broken in this support in ics mode and i've played them all with my chess program. well fics style 0 with the normal board but king and queen reversed i havent tried but that is just an offshoot of wildcastle. if you can handle wildcastle you can handle style 0 as its a subset position.

Mike
adams161
Posts: 626
Joined: Sun May 13, 2007 9:55 pm
Location: Bay Area, CA USA
Full name: Mike Adams

Re: ICS protocol question: FRC

Post by adams161 »

here is a winboard f debug file of fischer random. it has more info the game goes maybe 4 moves is adjourned and i show the start of ics feeing info and then winboard f parsing it and sending to first chess program the info. winboardf sends some characters that are not easily picked up so its work to paste the whole thing so consider the below text an example and the full debug file is at www.adam16mr.org/stuff/winboard-fr1-9-08.zip

40203 <first : level 0 17700 0
<ICS: \015\012threechecksbot (2120) vs. Mike (1415) --- 2008.01.19 16:55:38 \015\012Unrated wild(22) match, initial time: 3 minutes, increment: 0 seconds\015\012\015\012<12> qnrkbbnr pppppppp -------- -------- -------- -------- PPPPPPPP QNRKBBNR W -1 1 0 1 0 1 1029 threechecksbot Mike -3 3 0 39 39 173 170 1 none (0:00) none 0\015\012\012Move threechecksbot Mike \015\012---- ---------------- ----------------\015\012 1. d4 (0:02) d5 (0:02) \015\012 2. e3 (0:02) c6 (0:02) \015\012 3. Nf3 (0:02) \015\012 {Game in progress} *\015\012aics%
recognized 'ICS Unrated wild(22) match' (22) as variant fischerandom
Parsing board: qnrkbbnr pppppppp -------- -------- -------- -------- PPPPPPPP QNRKBBNR W -1 1 0 1 0 1 1029 threechecksbot Mike -3 3 0 39 39 173 170 1 none (0:00) none 0

Parsing game history: threechecksbot Mike
---- ---------------- ----------------
1. d4 (0:02) d5 (0:02)
2. e3 (0:02) c6 (0:02)
3. Nf3 (0:02)
{Game in progress} *
Disambiguate in: 0(3,-1)-(3,3) = 0 (
Disambiguate C: 17(2,-1)-(2,5) = 0
Disambiguate out: 17(2,6)-(2,5) = 0

CoordsToAlgebraic, piece=17
Legality test: a7a6
Legality test: a7a5
Legality test: b7b6
Legality test: b7b5
Legality test: c7c6
Legality test: c7c5
Legality test: e7e6
Legality test: e7e5
Legality test: f7f6
Legality test: f7f5
Legality test: g7g6
Legality test: g7g5
Legality test: h7h6
Legality test: h7h5
Legality test: b8a6
Legality test: b8d7
Legality test: b8c6
Legality test: d8d7
Legality test: e8d7
Legality test: e8c6
Legality test: e8b5
Legality test: e8a4
Legality test: g8f6
Legality test: g8h6
Legality test: d8c8
Legality test: d8h8
Parser Qa1: yyleng=3, 1(-1,-1)-(5,2) = 0 ( )
Disambiguate in: 1(-1,-1)-(5,2) = 0 (
Disambiguate C: 1(-1,-1)-(5,2) = 0
Disambiguate out: 1(6,0)-(5,2) = 0
CoordsToAlgebraic, piece=1
Feeding position and moves 0 through 5 to first chess program
40328 >first : force
write FEN 50-move: 0 5 0
e0. p=-4
e1. p=-4
e2. p=-4
e3. p=-4
e4. p=-4
e5. p=-4
40328 >first : setboard qnrkbbnr/pppppppp/8/8/8/8/PPPPPPPP/QNRKBBNR w HAha - 0 1
40328 >first : d2d4
40328 >first : d7d5
40328 >first : e2e3
40328 >first : c7c6
40328 >first : g1f3
40328 <first :