program to generare epd file of tactical exercises from pgn

Discussion of anything and everything relating to chess playing software and machines.

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Uri Blass
Posts: 8590
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

program to generare epd file of tactical exercises from pgn

Post by Uri Blass » Fri Jan 18, 2019 8:51 am

I would like to generate epd file of tactical exercises from a pgn and I wonder if there is a program that can do it.

I would like to have the following epd files based on a pgn game:

1)good moves in the pgn that are significantly stronger than the second best move
2)good moves from positions in the pgn that are not in the pgn that are significantly stronger than the second best move

For the definition of good moves
possible parameters that you can define manually:
1)engine to analyze.
2)minimal time of search or minimal depth of search or minimal nodes to search to analyze every move.
3)minimal difference between best move and second best move in centi-pawns.
4)maximal time to analyze candidate moves that I suspect after I found a significant difference after the minimal time.

Dann Corbit
Posts: 10114
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: program to generare epd file of tactical exercises from pgn

Post by Dann Corbit » Fri Jan 18, 2019 7:20 pm

You can easily turn a chess game into EPD records with
pgn2fen <file.pgn> -e -l > <file.epd>
Now you can take a chess engine, or series of chess engines and analyze the whole game a ply at a time on multi-pv.

Something to watch for is a jump in eval from one ply to the next. That always means either a very good move was played or a very bad one. So a learning lesson or pat on the back.

With Arena, for instance, I can schedule 5 strong engines to analyze the file and let it run for a day.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Uri Blass
Posts: 8590
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: program to generare epd file of tactical exercises from pgn

Post by Uri Blass » Fri Jan 18, 2019 8:15 pm

Dann Corbit wrote:
Fri Jan 18, 2019 7:20 pm
You can easily turn a chess game into EPD records with
pgn2fen <file.pgn> -e -l > <file.epd>
Now you can take a chess engine, or series of chess engines and analyze the whole game a ply at a time on multi-pv.

Something to watch for is a jump in eval from one ply to the next. That always means either a very good move was played or a very bad one. So a learning lesson or pat on the back.

With Arena, for instance, I can schedule 5 strong engines to analyze the file and let it run for a day.
I am interested in tactical exercices for humans when the target is to find a good move that is simply better than other moves
You do not need to have a mistake for this purpose(or a very good move that cause jump in the evaluation based on evaluation of the engine).

Here is an example that is easy for computers but not for weak humans(the woman with white solved it correctly).



find the best move for white.

last move of black was correct and it is also a tactical exercise for humans that you can generate from the pgn



find the best move of black.

This is the relevant game

Dann Corbit
Posts: 10114
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: program to generare epd file of tactical exercises from pgn

Post by Dann Corbit » Fri Jan 18, 2019 11:36 pm

Uri Blass wrote:
Fri Jan 18, 2019 8:15 pm
Here is an example that is easy for computers but not for weak humans(the woman with white solved it correctly).



find the best move for white.
Is there a best move if all move choices lose?
I think the game is already lost at that point.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

Uri Blass
Posts: 8590
Joined: Wed Mar 08, 2006 11:37 pm
Location: Tel-Aviv Israel

Re: program to generare epd file of tactical exercises from pgn

Post by Uri Blass » Sat Jan 19, 2019 4:59 am

Dann Corbit wrote:
Fri Jan 18, 2019 11:36 pm
Uri Blass wrote:
Fri Jan 18, 2019 8:15 pm
Here is an example that is easy for computers but not for weak humans(the woman with white solved it correctly).



find the best move for white.
Is there a best move if all move choices lose?
I think the game is already lost at that point.
From human point of view there are cases that yes and there are cases that no.

There is a difference between -2.45 and -6.80 by the computer unless the -6.80 is a very complex win that you are sure that there are good chances that even a strong human opponent is not going to find so maybe the -6.80 is practically better.

-2.45 by stockfish at depth 30 is not something that I usually expect humans to convert easily.

I cannot use only the evaluation of the computer to decide if the position is a good or bad test for humans and I need to use common sense.

Dann Corbit
Posts: 10114
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: program to generare epd file of tactical exercises from pgn

Post by Dann Corbit » Sat Jan 19, 2019 5:18 am

Uri Blass wrote:
Sat Jan 19, 2019 4:59 am
Dann Corbit wrote:
Fri Jan 18, 2019 11:36 pm
Uri Blass wrote:
Fri Jan 18, 2019 8:15 pm
Here is an example that is easy for computers but not for weak humans(the woman with white solved it correctly).



find the best move for white.
Is there a best move if all move choices lose?
I think the game is already lost at that point.
From human point of view there are cases that yes and there are cases that no.

There is a difference between -2.45 and -6.80 by the computer unless the -6.80 is a very complex win that you are sure that there are good chances that even a strong human opponent is not going to find so maybe the -6.80 is practically better.

-2.45 by stockfish at depth 30 is not something that I usually expect humans to convert easily.

I cannot use only the evaluation of the computer to decide if the position is a good or bad test for humans and I need to use common sense.
At this point, I might not resign, even though it is clear to me that the game is lost (maybe a computer could draw it, but I do not think I could) if I played sensibly.

I might try this...

From here:

I might try to fork the rook and queen with my knight.

If the opponent did not think hard about it, they might recapture with the bishop, giving me a draw:


But chances are good I would just take a beating.
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

USGroup1
Posts: 33
Joined: Sun Oct 14, 2018 5:01 pm
Full name: Sina Vaziri

Re: program to generare epd file of tactical exercises from pgn

Post by USGroup1 » Sat Jan 19, 2019 10:02 am

Uri Blass wrote:
Fri Jan 18, 2019 8:51 am

1)good moves in the pgn that are significantly stronger than the second best move
Every sequence of trading pieces fit that description, you need more filters. ChessTricks uses similar filters, you might find it useful for this.
https://chesstricksapp.wordpress.com

User avatar
Guenther
Posts: 3052
Joined: Wed Oct 01, 2008 4:33 am
Location: Regensburg, Germany
Full name: Guenther Simon
Contact:

Re: program to generare epd file of tactical exercises from pgn

Post by Guenther » Sat Jan 19, 2019 11:00 am

USGroup1 wrote:
Sat Jan 19, 2019 10:02 am
Uri Blass wrote:
Fri Jan 18, 2019 8:51 am

1)good moves in the pgn that are significantly stronger than the second best move
Every sequence of trading pieces fit that description, you need more filters. ChessTricks uses similar filters, you might find it useful for this.
https://chesstricksapp.wordpress.com
I have tried the latest version 4.9. The error also appears with 4.8 and 4.7, but here it appears first, when starting an analyse.
With 4.9 the error appears already before the GUI starts.

my system : old Quadcore Win7-64 with .Net 4.7
(this is just the first and most important part of the error message)

Code: Select all

************** Ausnahmetext **************
System.IO.FileNotFoundException: Die Datei oder Assembly "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Dateiname: "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
...
Current foe list count : [97]
http://rwbc-chess.de/chronology.htm

USGroup1
Posts: 33
Joined: Sun Oct 14, 2018 5:01 pm
Full name: Sina Vaziri

Re: program to generare epd file of tactical exercises from pgn

Post by USGroup1 » Sat Jan 19, 2019 11:53 am

Guenther wrote:
Sat Jan 19, 2019 11:00 am
USGroup1 wrote:
Sat Jan 19, 2019 10:02 am
Uri Blass wrote:
Fri Jan 18, 2019 8:51 am

1)good moves in the pgn that are significantly stronger than the second best move
Every sequence of trading pieces fit that description, you need more filters. ChessTricks uses similar filters, you might find it useful for this.
https://chesstricksapp.wordpress.com
I have tried the latest version 4.9. The error also appears with 4.8 and 4.7, but here it appears first, when starting an analyse.
With 4.9 the error appears already before the GUI starts.

my system : old Quadcore Win7-64 with .Net 4.7
(this is just the first and most important part of the error message)

Code: Select all

************** Ausnahmetext **************
System.IO.FileNotFoundException: Die Datei oder Assembly "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.
Dateiname: "System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51"
...
Make sure that these files are in the folder:

Code: Select all

ChessTricks.exe
stockfish_19011016_x64.exe
System.Reactive.dll
System.Reactive.Linq.dll
It seems like it can't find stockfish engine file at startup. Also try "Run as administrator", see if that solves it.

User avatar
Guenther
Posts: 3052
Joined: Wed Oct 01, 2008 4:33 am
Location: Regensburg, Germany
Full name: Guenther Simon
Contact:

Re: program to generare epd file of tactical exercises from pgn

Post by Guenther » Sat Jan 19, 2019 1:08 pm

USGroup1 wrote:
Sat Jan 19, 2019 11:53 am

Make sure that these files are in the folder:

Code: Select all

ChessTricks.exe
stockfish_19011016_x64.exe
System.Reactive.dll
System.Reactive.Linq.dll
It seems like it can't find stockfish engine file at startup. Also try "Run as administrator", see if that solves it.
Of course I did all of this.

After making an offline install of .Net 4.72 all works here. Seems sth was missing in my 4.7 installation?
Current foe list count : [97]
http://rwbc-chess.de/chronology.htm

Post Reply