ml-research / liground

A free, open-source and modern Chess Variant Analysis GUI for the 21st century
https://ml-research.github.io/liground.github.io/
GNU Affero General Public License v3.0
108 stars 35 forks source link

Arrows are off on boards with 10 ranks #223

Closed ianfab closed 3 years ago

ianfab commented 3 years ago

For Xiangqi and Janggi the engine move suggestion arrows are off by one rank, see below. I assume this might have to do with some 0-based vs. 1-based encoding of ranks in case of 10 ranks, since for other board sizes it works fine.

arrow

QueensGambit commented 3 years ago

Thank you for the bug report and thanks to @fjscabral for the prompt pull-request. It looks to me that the problem is related to the Chessgroundx library. For version Chessgroundx@7.6.42, the arrows still behave as expected for Xiangqi and Janggi.

However, when updating to the latest version, Chessgroundx@8.3.0, both the board visualization and arrows are broken for me. Updating to the latest ffish.js version, ffish.js@0.6.2, did not seem to break anything. Maybe @gbtami can tell if some default values of the API have been changed.

gbtami commented 3 years ago

Yes, @Fulmene restored key2pos and pos2key function signatures in https://github.com/gbtami/chessgroundx/commit/900713902eb7f66d996ccc7e0acd914c23159915#diff-c54113cf61ec99691748a3890bfbeb00e10efb3f0a76f03a0fd9ec49072e410a

QueensGambit commented 3 years ago

Thanks for letting use know. This explains it. I guess we should update the code then to be compatible with the current and future Chessgroundx versions.

Was there also change regarding the rendering the pieces? Board pieces are no longer visible anymore for Chessgroundx@8.3.0, including chess and western chess variants, at least for me.

gbtami commented 3 years ago

Yes, role names was unified by @Fulmene as well in https://github.com/gbtami/chessgroundx/pull/10

For example our standard chess .css now looks like this https://github.com/gbtami/pychess-variants/blob/master/static/piece/standard/standard.css

For Shogi she also introduced "alley" and "enemy" classes in https://github.com/gbtami/chessgroundx/commit/cee6a98edf1d84fb2fd634abade5196ecd3b5792 https://github.com/gbtami/pychess-variants/blob/master/static/piece/shogi/shogi.css

This opened up the possibility to simplify our code base in several places. https://github.com/gbtami/pychess-variants/commit/f8d5d1c43134c7ad51430ce045c9e92f973ee674

QueensGambit commented 3 years ago

Ok, thanks for the information.

QueensGambit commented 3 years ago

I created a new issue (#225) regarding the broken CSS classes.