Does a "en passent" aware PGN2EPD converter exist

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Does a "en passent" aware PGN2EPD converter ex

Post by Don »

tpetzke wrote:Hi,

I'm looking for PGN2EPD converter that converts a PGN file into a set of EPD positions with a bm or pm specifying the played move.

So far I'm aware of the tools by Rémi Coulom and Tim Foden which seem to not fill the en passent data field in the created epd records.

Is there a tool that does it correctly ?


Rémi Coulom's pgn2epd :
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - bm e4;
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - bm e5;


Tim Foden's pgn2fen :
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - fmvn 1; hmvc 0; pm e4;
rnbqkbnr/pppppppp/8/8/4P3/8/PPPP1PPP/RNBQKBNR b KQkq - fmvn 1; hmvc 0; pm e5;

Thomas...

PS.: I read somewhere a reference to a tool from a guy named Koundinya Veluri that might be able to do it, but I wasn't able to locate it. All links were dead.
pgn-extract almost does what you want but doesn't put in the "best" move.

If you have chess processing libraries it's easy to make a tool to do this, it would take less than an hour. Let me know by PM if you don't solve this.
User avatar
Don
Posts: 5106
Joined: Tue Apr 29, 2008 4:27 pm

Re: Does a "en passent" aware PGN2EPD converter ex

Post by Don »

hgm wrote:Beware that not removing false e.p. rights will cause a serious slowdown of your engine, perhaps a hundred times as much as doing the tests for neighboring Pawns. Because it means that almost every position after a double push (and there are many in the middle game!) will now be represented by two different hash keys, leading to hash misses that would otherwise have been hits, with very costly superfluous searches as a result.
Indeed, when I create fen positions with any of my tools I do NOT set the en-passant target square unless en-passant is actually possible.

I think when Steven Edwards designed "fen" this was a serious oversight on his part. The good news is that this modification does not break anything as far as I know - even if it interacts with other tools.