Jonathan003 wrote on 11/14/20 at 21:08:30:
I managed to do what you described.
How can I use the output to fill in the gaps of my repertoire?
Yes!
For each move in the
new pgn, it steps through your
repertoire pgn and finds the place where it matches. Look for the far right column having a "0". If there is a long run of "0" on the right, that represents a "novelty" for your repertoire. A short run of "0" represents a transposition.
rnbqkbnr/pp3ppp/4p3/2ppP3/3P4/2P5/PP3PPP/RNBQKBNR b KQkq -;hmvc 0;fmvn 4;id 1;fk 2;fmvnmax 4;
rnb1kbnr/pp3ppp/1q2p3/2ppP3/3P4/2P5/PP3PPP/RNBQKBNR w KQkq -;hmvc 1;fmvn 5;id 1;fk 0;fmvnmax 0;
rnb1kbnr/pp3ppp/1q2p3/2ppP3/3P4/2P2N2/PP3PPP/RNBQKB1R b KQkq -;hmvc 2;fmvn 5;id 1;fk 0;fmvnmax 0;
r1b1kbnr/pp3ppp/1qn1p3/2ppP3/3P4/2P2N2/PP3PPP/RNBQKB1R w KQkq -;hmvc 3;fmvn 6;id 1;fk 2;fmvnmax 6;
Opcode translations
- hmvc - half-move clock, number of ply since the last pawn move or capture in the new game
- fmvn - full move number, number of moves so far in the new game
- id - identity, game number in the new pgn
- fk - foreign key, game number(s) in the repertoire pgn
- fmvnmax - full move number max, (largest) number of moves so far in the repertoire game(s)
In the sample output above
- fmvn 4;id 1;fk 2;fmvnmax 4; - new game 1 move 4 matches repertoire game 2 move 4
- fmvn 5;id 1;fk 0;fmvnmax 0; - new game 1 move 5 does not match the repertoire
- fmvn 5;id 1;fk 0;fmvnmax 0; - new game 1 move 5 does not match the repertoire
- fmvn 6;id 1;fk 2;fmvnmax 6; - new game 1 move 6 matches repertoire game 2 move 6
So on move 4 black played a "new" move (reached a position not in the repertoire), then on move 5 white played a "new" move (in reply to black's "new" move), then on move 5 black played a "non-new" move. Therefore black's "new" move on move 4 was a simple transposition. Whether the transposition is important for your repertoire is up to you. The simple idea is you open the
new pgn, scroll down to game number
id, scroll across to move number
fmvn (having
fmvnmax = 0), then use your brain (or engine) to decide whether or not to import that game to your repertoire. Software can only automate things up to a certain point.
Jonathan003 wrote on 11/14/20 at 21:08:30:
For my white repertoire, I only want to find the games in the new database, with moves for black, where I don't already have a reply for.
And I want to do the same for my black repertoire.
I think that was also the question of the original poster of this topic.
You do realize that
all the games in the new database will have a move you don't already have a reply for. Unless one of them is an exact duplicate of a repertoire game that will always be the case. There is no way around the fact that you will have to look at every game. But it's not hopeless. You can use the fmvn/fmvnmax to reject some of the "novelties". Most people do an arbitrary cut-off at move 15 or 20. Only in certain critical lines would you go much beyond that.
Jonathan003 wrote on 11/14/20 at 21:08:30:
I basically want to do what's described here:
See attachment
Under the title Book Merging
I'm not sure about the polyglot book idea. Those are designed for engines. You might find some use for practicing against an engine, but otherwise I would look at different avenues. There are good reasons for tracking more than one move for your side in a repertoire, but there's no way to tell the polyglot book what that reason is. To the engine, every move in a polyglot book is the same.
Jonathan003 wrote on 11/14/20 at 21:08:30:
I can import the best moves from the merged bin books to Opening Lines in Lucas Chess, and then export to pgn.
But I want to be able to do this directly with pgn games, so the game data information gets preserved. There is also some weird explosion of number of games if I use Lucas Chess for this.
Exactly. Most repertoire tools have some facility for
importing pgn, but when it comes to
exporting pgn, the situation is, shall we say, lossy. As an example, I think Chess Openings Wizard (Bookup) is a great piece of software, as long as you only intend to use COW exclusively. But I use lots of other software, so any effort I put into COW is wasted when I switch to another tool.
I haven't used Lucas Chess, so I don't know how it handles these things. You say it can "import the best moves", but I rather doubt that. Isn't it going to import "all" the moves? I recommend you search on brabo's blog for "green moves" where he uses a ChessBase tree. The idea is that a repertoire should show best moves and second-best moves, and a way to know which is which. After all, theory changes and today's best move can become tomorrow's second-best. Or you may decide second-best is less work while still being good enough. You should also look at Scid's "tree mask" feature -- very cool. I don't like the ChessBase tree at all, and I do like the Chess Assistant tree very much. But all these tools can only give ideas for how to handle your own repertoire.
I strongly believe that keeping the repertoire in pgn in a form that allows for easy import to your repertoire tool of choice is, in the long run, the only way to avoid significant pain. By all means import to the tool, but consider it to be read-only, and make any changes to the repertoire in the original pgn. Otherwise, at some point, you are going to end up with information you can't export. The farther in the future that point is, the more information you will have lost.