Open emin63 opened 2 years ago
Good question. I didn’t implement the bot logic, but my understanding is that the Monte-Carlo Tree Search bot can at least theoretically handle incomplete information games. I would guess though that the number of simulations to get good results without fine tuning the enumerate function is probably prohibitive? Only way to find out is to try it!
You don’t need any UI logic to try this, so if you can code up a simple implementation of the game logic, you can test out running the bot in the debug panel.
The MCTS bot is a very simple implementation and does not account for hidden state or probability at all: https://github.com/boardgameio/boardgame.io/blob/aa99a9cce28012cb747fa6db8b3f8ad73c28be0a/src/ai/mcts-bot.ts#L128 ... Arguably, even Bot itself is limited in that way by their definition of BotAction
, and all of this could have been implemented with MinMax. The MCTS needs to be extended to include the possibility of probability between moves and transitions and states.
Luckily, developers are not limited by this, since you don't necessarily need to use these classes. In FBG in Chess, we use a complete independent library to simulate chess, and just the barebone API for interacting with the bgio framework: https://github.com/freeboardgames/FreeBoardGames.org/blob/master/web/src/games/chess/ai.ts
Thanks for making this project. I just came across and am really impressed with the code and the documentation. My head is spinning with projects I would like to try with it.
One question: how does your ai/bot handle games with secret state? For example, if I implement a poker game and try to use the bot, what will happen? I'm guessing I will either get an error or non-nonsensical results.
Could I get things to kind of work by hacking the enumerate function to somehow consider possible game states? For example, imagine the bot is looking at its hand in 5-card draw poker and trying to choose how many cards to discard. There aren't that many choices so the enumeration would "normally" be just a few choices. Would you hack the enumerate function to somehow imagine the possible states of the deck and other players hands?
Perhaps this is a silly question and ai/bots for games with hidden information need to be crafted separately for the particulars of each game. Just wondering if this is something you have any thoughts on.
Thanks again.