Post
by H.G.Muller » Sat Nov 30, 2019 11:34 am
Oh, apart from Chexx I had all these in my local Jocly git repository already. Did you redo them from scratch?
Several of them use modified versions of base-model.js, rather than locating the required patches in their own model file, and redirecting the calls to the standard chessbase functions to those. Which in the new method of hosting was a bit inconvenient. Although once the library is made the model file in there for every chess game will contain its own (uglified) copy of base-model.js. So it was mainly a pre-compilation problem. I solved that by moving the deviating base-model.js files each to their own sub-folder of /src/games/chessbase.
I somehow got stuck in further development of Jocly because of the issue of opening books and repetition detection. The existing method for the latter is flawed, as the hash key is derived in a way that makes swapping the location of two pieces of identical type be considered an alteration of the position. In the already implemented variants this occurs so rarely that it wasn't much of a problem. But when I started to implement variants with piece drops, it turned out to be quite common, and especially in variants where repetitions can be losing (e.g. mini-Shogi, or perpetual checking in regular Shogi) it lead to annoying blunders.
The problem is that when I fix the hash key the opening books for normal Chess and Xiangqi (AFAIK the only variants that did have an opening book) no longer work works. As it is stored and accessed by hash key. I am not sure what to do about this. A very ugly work-around would be to keep using the old version of base-model.js (which calculates the key) for normal Chess and Xiangqi only, as if it was a private, modified version. And then update the main base-model.js to maintain a proper key, and have all other chess variants use that.