fairy-stockfish / Fairy-Stockfish

chess variant engine supporting Xiangqi, Shogi, Janggi, Makruk, S-Chess, Crazyhouse, Bughouse, and many more
https://fairy-stockfish.github.io/
GNU General Public License v3.0
603 stars 189 forks source link

Xiangqi #31

Closed ianfab closed 4 years ago

ianfab commented 4 years ago

Open problems for a Xiangqi implementation:

Possible further improvement:

Current state of incomplete xiangqi implementation is on branch xiangqi.

CouchTomato87 commented 4 years ago

The general face-off is not a problem?

ianfab commented 4 years ago

That also still needs to be implemented, so I should actually add it to the list, but it is rather easy to implement, that is why I forgot to mention it.

CouchTomato87 commented 4 years ago

Gotcha. Also are you accounting for the possibility of implementing Janggi as well? It's a little annoying because you can choose your horse/elephant position as well as pass turns...

ianfab commented 4 years ago

Yes, I already thought about it, and from my perspective the most difficult are the special moves of the pieces, namely the moving options in the castle and the fact that cannons can not jump over cannons. Those really break some core assumptions within in the code (e.g., that the position on the board and the type of blocking pieces do not have any impact on the moving possibilities of a piece).

So currently I see it as very difficult, not to speak of that it basically requires the Xiangqi implementation, which will already be challenging. As soon as the latter is done (I aim to get it done still this year), I will reconsider how feasible Janggi is.

ianfab commented 4 years ago

Does anyone know other variants where the rules restrict certain pieces to specific areas of the board?

The only ones that come to my mind are all closely related to Xiangqi (minixiangqi, Janggi, congo), so I am thinking about whether this rule really needs to be implemented in a generic way or can be made specific for Xiangqi-like variants.

CouchTomato87 commented 4 years ago

Not to my knowledge, at least for well-known variants.

ianfab commented 4 years ago

Ok, thanks.

CouchTomato87 commented 4 years ago

Slight amendment to that. Apparently Rococo has a restriction, but that game is based on Ultima, and I don't think Fairy Stockfish is equipped for that.

ianfab commented 4 years ago

Thanks for the update, but I now anyway already went for a generic implementation on the Xiangqi branch, see https://github.com/ianfab/Fairy-Stockfish/commit/a4e744c839bb57bcaac7f6674d9853a43d34e146, and it seems to be working.