WillFlame14 / hanabi-bot

A bot that plays on the hanab.live interface.
GNU General Public License v3.0
15 stars 9 forks source link

hanabi-bot

A deterministic NodeJS bot that plays on the hanab.live interface. Basic structure and ideas were taken from Zamiell's example bot (Python). You can play with it by inviting any of the will-bot's to your table.

It can play with H-Group and Playful Sieve conventions. The goal of the bot is to play with humans, so it can handle suboptimal play within reason. However, it still expects that the conventions are followed (in terms of focus, chop, etc.) and does not perform any "learning" during a game.

A demo game at H-Group level 3:

https://user-images.githubusercontent.com/25177576/190633432-57b527da-786e-4c24-92d0-e1d01291986e.mp4

A game played at H-Group level 5 can be seen here.

Bot features

If you're interested in understanding how the bot works, I've written some documentation.

Running locally

Supported commands

Send a PM to the bot on hanab.live (/pm <HANABI_USERNAME> <message>) to interact with it.

Some commands can be sent inside a room to affect all bots that have joined.

Watching replays

A replay from hanab.live or from a file (in JSON) can be simulated using npm run replay [-- <options>]. Possible options:

In a replay, the following commands are also supported (in addition to hand and state):

Self-play

The bot can play games with copies of itself using npm run self-play [-- <options>]. Possible options:

The final score for each seed as well as how each game terminated are logged to the console. JSON replays of each game are saved to a seeds folder, which can be loaded into hanab.live for viewing.

Feel free to report any issues here!