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
612 stars 191 forks source link

Can this be implemented: Dice Chess (from Wikipedia) #631

Closed eje211 closed 1 year ago

eje211 commented 1 year ago

Here is a description of Dice Chess from Wikipedia: https://en.wikipedia.org/wiki/Dice_chess

Can Fairy-Stockfish implement it? At any time, the engine will see the whole board, so the "incomplete information" limitation should not be an issue. If it is possible (or if it may be possible), where should I add the necessary rules? I can't find the location of the rules in the source code.

Thanks!

ianfab commented 1 year ago

Unfortunately randomness can not be supported either. I now made the wiki more explicit on that to cover both imperfect and incomplete information games.

eje211 commented 1 year ago

I'm sorry, but I would like to have a better understanding. Again: I could not find where in the code the rules of chess were. So what is the reason why it is impossible? Is it:

Surely, it must be possible to allow some randomness to the way the engine plays chess. So what does not work must be the way the neural network deals with that information.

ianfab commented 1 year ago

For an overview where the game rules are implemented, see e.g. https://github.com/fairy-stockfish/Fairy-Stockfish/wiki/Understanding-the-code#variant-rule-implementation.

Regarding the reason for the limitation, it has nothing to do with neural networks. The reason is that (Fairy-)Stockfish uses the alpha-beta search algorithm, and just like most minimax derived search algorithms it usually does not work well with things like incomplete information, randomness, multi-player, etc. Normally for such games some variant of a Monte Carlo tree search algorithm is used, since it is very well suited for dealing with probabilities.