Moderator: Andres Valverde
2)castling when the king move one square
In this case I probably need to understand only 0-0 or o-o as short castling and 0-0-0 or o-o-o as long castling.
In supporting shredder-fen I need to have #if defined(FRC) only in the function that give the moves output(understanding does not need to have it because I can change my code to understand both FRC notation of shredder FEN and FRC notation of X-FEN)
if ( last FEN was Shredder-FEN )
{
print king takes rook
}
else if ( Option UCI_Chess960 /* UCI */ || variant fischerandom /* WB */ )
{
print O-O
}
else
{
print e1g1
}
Uri Blass wrote:3)change the make move to enable it to change information about castling rights correctly in FRC(
today I calculate future castling rights simply by
if (castle>0)
{
castle&=castle_mask[from]&castle_mask[to];
}
I will need to change it to something similiar to glaurung like
if (from==..,)||(from==...)||(from==...)||(to==...)||(to==...)||(to==...)
Richard Allbert wrote:Uri Blass wrote:3)change the make move to enable it to change information about castling rights correctly in FRC(
today I calculate future castling rights simply by
if (castle>0)
{
castle&=castle_mask[from]&castle_mask[to];
}
I will need to change it to something similiar to glaurung like
if (from==..,)||(from==...)||(from==...)||(to==...)||(to==...)||(to==...)
I've started the same thing, although for the castling I kept the same function using the square bits. castleflags & board[from].
When the fen string is parsed, I just reset the castle bits array according to where the king and rooks are placed.
Richard
Uri Blass wrote:What do programmers need to add in order to support FRC?
I want to support both shredder-fen and x-fen.
steps to do:
1)change the move generator to generate FRC castling moves
2)change the make move to enable it to make FRC castling moves
3)change the make move to enable it to change information about castling rights correctly in FRC(
today I calculate future castling rights simply by
if (castle>0)
{
castle&=castle_mask[from]&castle_mask[to];
}
I will need to change it to something similiar to glaurung like
if (from==..,)||(from==...)||(from==...)||(to==...)||(to==...)||(to==...)
3)change the function that get fen to get shredder-fen and translate it to the board structure
4)change the function that get fen to get x-fen and to translate it to the board structure.
5)change the function that get moves to understand shredder moves and x fen moves(shredder moves are king take rook for castling)
Did I forget something?
known problem that I need to handle with xfen:
1)getting fen when there is a rook that moved between the rook that can castle and the king.
In this case xfen tell me that
"traditional castling tag will be replaced by the file letter of the involved R"
2)castling when the king move one square
In this case I probably need to understand only 0-0 or o-o as short castling and 0-0-0 or o-o-o as long castling.
In supporting shredder-fen I need to have #if defined(FRC) only in the function that give the moves output(understanding does not need to have it because I can change my code to understand both FRC notation of shredder FEN and FRC notation of X-FEN)
Am I right?
Did I forget something?
Uri
Uri Blass wrote:
- Code: Select all
if (castle>0)
{
castle&=castle_mask[from]&castle_mask[to];
}
Nicolai Czempin wrote:Uri Blass wrote:
- Code: Select all
if (castle>0)
{
castle&=castle_mask[from]&castle_mask[to];
}
It's probably not the bottleneck, and won't get you lots of Elos, but why are you using if (castle>0) instead of if (castle!=0)?
My intuition tells me that the second would be slightly faster, but then again my assembly knowledge is about 7 years out of date (and out of mind...)
Engin Üstün wrote:Hi,
i see i am not only ones that have all kind of problems, i had before go mainz
there is a big confusing of implementation of the castles, the solution what i found is very simple.
using always O-O input/output for castles, they are not need UCI_Chess960 options, x-fen or shredder fen.
the PGN standard is O-O/O-O-O for castles, and if we humans write on the game formular to understand also O-O and O-O-O format.
Or we must wait a while if there are found a standard solution for castles for computerchess.
but for now you must implement the O-O format for Arena, the king takes rook for Shredder and winboard.
i will make a UCI option for castles IO can selectable in 3 ways.
1) O-O/O-O-O (chess960 under Arena)
2) e1g1/e1c1 (standard)
3) e1h1/e1a1 (chess960 under shredder/winboard)
best wishes,
Engin
Uri wrote:... I guess that reading input should be always clear and I will assume that move in the format e1g1 is castling move only in case that the distance is different than 1 square(otherwise I will assume that it is king move) ...
Reinhard Scharnagl wrote:Uri wrote:... I guess that reading input should be always clear and I will assume that move in the format e1g1 is castling move only in case that the distance is different than 1 square(otherwise I will assume that it is king move) ...
More precise is:
a) UCI-2 standard: use source and target coordinates, this would be downwards compatible to old UCI GUIs playing traditional chess. I suggest to use the "Rook jostling" move, King's and Rook's source coordinates, only, when the King's castling move consists of less than two steps (to avoid misinterpretations with regular King steps and technical nullmoves). To remain compatible it is necessary to support X-FEN, if the engine should be aware of all possible positions, if not being merely starting array positions.
(That encoding moreover does define a clear input gesture for to enter castling moves at the GUI simply by clicking at the two involved coordinates, without changing the behaviour for traditional castlings. P.S.: I am just writing such an UCI-engine, the SMIRF TMCI GUI acts like that already for long.)
b) Arena handling: UCI engines supply a (constant) option "FRC" and a switch to always communicate castlings using "O-O/O-O-O".
c) Shredder UCI: uses an option switch into a UCI_Chess960 mode, where an incompatible FEN extension is used (different position encodings exist for identical positions), and castlings are communicated always by a "Rook jostling".
Reinhard.
Uri wrote:Movei is aware of both x-FEN and smk-FEN
Uri wrote:I still need to check that it has no bugs and I still did not check SMK-fen or X-fen in the rare cases when there are 2 rooks on the same side of the king.
Uri wrote:I understand that you suggest king take rook even when the king does not move to avoid understanding castle as null move.
I did not think about b1b1 as null move(if I need to translate null move to string then I translate it to a1a1 that is not possible castling move) but
if you say that your interface is going to understand b1b1 as null move and b1a1(when white has rook at a1 and king at b1) as castling move then of course there is a reason to use b1a1 for castling in that case.
Volker Annuss wrote:Hello Uri,2)castling when the king move one square
In this case I probably need to understand only 0-0 or o-o as short castling and 0-0-0 or o-o-o as long castling.
Your engine needs to understand O-O (Oh) for Arena and king takes rook for Shredder.In supporting shredder-fen I need to have #if defined(FRC) only in the function that give the moves output(understanding does not need to have it because I can change my code to understand both FRC notation of shredder FEN and FRC notation of X-FEN)
To support both, Shredder and Arena, your move-to-string-conversion can do
something like this:
- Code: Select all
if ( last FEN was Shredder-FEN )
{
print king takes rook
}
else if ( Option UCI_Chess960 /* UCI */ || variant fischerandom /* WB */ )
{
print O-O
}
else
{
print e1g1
}
Code like that is in Hermann. I think it is ugly but still better than another option that tells the engine which GUI it runs in or to compile different versions with #if defined( FRC ).
Greetings
Volker
Reinhard Scharnagl wrote:Uri wrote:Movei is aware of both x-FEN and smk-FEN
I try to have the same with SMIRF X-UCI version then.Uri wrote:I still need to check that it has no bugs and I still did not check SMK-fen or X-fen in the rare cases when there are 2 rooks on the same side of the king.
That is just, where X-FEN would be needed (or Shredder FEN).Uri wrote:I understand that you suggest king take rook even when the king does not move to avoid understanding castle as null move.
I did not think about b1b1 as null move(if I need to translate null move to string then I translate it to a1a1 that is not possible castling move) but
if you say that your interface is going to understand b1b1 as null move and b1a1(when white has rook at a1 and king at b1) as castling move then of course there is a reason to use b1a1 for castling in that case.
Well, it has to do with the idea to relate the move encoding also to a clearly defined input gesture of the GUI to enter castling moves. It would be more difficult to enter a double field click for to define a King's move.
Reinhard.
P.S.: I am rather talking of 'jostling' the Rook instead of 'capturing' it.
Engin Üstün wrote:winboard send the variant=fischerrandom option to the engine to play FRC/Chess960
UCI engines use polyglot 1.4 that can handle FRC for winboard.
and use winboard_X a modified winboard for FRC, but something is wrong with this.
Uri wrote:If I understand correctly the notation is the same for jostling and capruring.
Return to Programming and Technical Discussions
Users browsing this forum: No registered users and 33 guests