Add dataset card with usage instructions
Browse files
README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
tags:
|
| 4 |
+
- beasty-bar
|
| 5 |
+
- game-ai
|
| 6 |
+
- tablebase
|
| 7 |
+
- endgame
|
| 8 |
+
---
|
| 9 |
+
|
| 10 |
+
# Beasty Bar Tablebase
|
| 11 |
+
|
| 12 |
+
Endgame tablebase for [Beasty Bar](https://www.zoch-verlag.com/zoch_en/brands/beasty-bar/), providing optimal play for positions with 4 or fewer cards remaining per player.
|
| 13 |
+
|
| 14 |
+
**GitHub**: [diegooprime/beastybar](https://github.com/diegooprime/beastybar)
|
| 15 |
+
|
| 16 |
+
## Files
|
| 17 |
+
|
| 18 |
+
| File | Description | Size |
|
| 19 |
+
|------|-------------|------|
|
| 20 |
+
| `endgame_4card_final.tb` | Complete 4-card endgame tablebase | ~1.2GB |
|
| 21 |
+
|
| 22 |
+
## What is a Tablebase?
|
| 23 |
+
|
| 24 |
+
A tablebase pre-computes optimal moves for all possible game positions within a certain scope. For Beasty Bar, this covers all positions where each player has 4 or fewer cards remaining in hand.
|
| 25 |
+
|
| 26 |
+
When the neural network encounters these endgame positions, it can use the tablebase for perfect play rather than relying on learned approximations.
|
| 27 |
+
|
| 28 |
+
## Usage
|
| 29 |
+
|
| 30 |
+
```python
|
| 31 |
+
from huggingface_hub import hf_hub_download
|
| 32 |
+
|
| 33 |
+
# Download tablebase
|
| 34 |
+
tablebase_path = hf_hub_download(
|
| 35 |
+
repo_id="shiptoday101/beastybar-tablebase",
|
| 36 |
+
filename="endgame_4card_final.tb",
|
| 37 |
+
repo_type="dataset"
|
| 38 |
+
)
|
| 39 |
+
|
| 40 |
+
# Load with the game repo
|
| 41 |
+
from _02_agents.tablebase import Tablebase
|
| 42 |
+
|
| 43 |
+
tb = Tablebase.load(tablebase_path)
|
| 44 |
+
optimal_action = tb.lookup(game_state)
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
## Coverage
|
| 48 |
+
|
| 49 |
+
- **Positions covered**: All 2-player positions with <= 4 cards per hand
|
| 50 |
+
- **Format**: Binary lookup table with state hashing
|
| 51 |
+
|
| 52 |
+
## Related
|
| 53 |
+
|
| 54 |
+
- **Neural Network**: [shiptoday101/beastybar-ppo](https://huggingface.co/shiptoday101/beastybar-ppo) - PPO-trained agent for full game play
|
| 55 |
+
- **Game Rules**: [Beasty Bar PDF](https://tesera.ru/images/items/1525203/BeastyBar_EN-online.pdf)
|
| 56 |
+
|
| 57 |
+
## License
|
| 58 |
+
|
| 59 |
+
MIT
|