PolyBot learns to play an unofficial Polytopia-like game in PolyEnv. One network encodes the visible map, player context, action history and every legal move, with policy, value and belief heads. Training uses PPO/PPG self-play; belief-guided MCTS is an optional stage.
Use an activated Python 3.12 environment. Native build tools and CUDA setup are covered in the installation guide.
git clone https://github.com/FryOne2137/PolyBot.git
cd PolyBot
python -m pip install -r requirements.txtUse your trained checkpoint as models/model.pt; pretrained weights are not bundled. Play and save ten games without training:
python scripts/play_self.py --model models/model.pt --mode flat --games 10 --seed 2137 --max-moves 1600 --visible-action-history 32 --output-dir runs/selfplay --device autoOpen the saved .polygame files in the PolyEnv replay viewer. --device auto selects an available GPU or CPU.
Compare against another checkpoint on paired maps with player swaps:
python scripts/evaluate.py --mode flat --model-a models/model.pt --model-b models/reference.pt --games 40 --seed 1531842 --max-moves 1600 --visible-action-history 32 --device autoScore is (wins + 0.5 × draws) / games. Self-play shows behavior; matches against a reference measure playing strength.
MIT license · Citation · Contributing
Unofficial research project, not affiliated with The Battle of Polytopia or its developers.
