This repository serves multiple purposes:
- To implement various bots to advise about or play Diplomacy
- To provide a library containing various utilities to help implementing Diplomacy bots
- To run games in a more automatic manner than manual invocation
Use the provided Makefile to install this project by running the following from the project root directory (the same directory as this README). Ensure the python
in PATH
is 3.11 before running this command:
make install
Newer Python versions might work but have not yet been tested.
If the installation process fails, is interrupted, or for any reason needs to be restarted, run git clean -xdf
to reset the repository's state.
To build the default bot container, run the following command:
make build
Once built, you will need to manually handle distributing the generated OCI image.
To use a bot, run the following command:
docker run --rm achilles [ARGUMENTS]
To run a complete game, run the following command:
python -m chiron_utils.scripts.run_games [ARGUMENTS]
Both the bot and game running commands support a --help
argument to list available options.
RandomProposerBot
(RandomProposerAdvisor
andRandomProposerPlayer
):- Orders are randomly selected from the space of valid moves.
- Messages are proposals to carry out a set of valid moves, which is also randomly selected. One such proposal is sent to each opponent.
- Due to the random nature of play, a game consisting entirely of
RandomProposerPlayer
s can last for a very long time. I (Alex) have observed multiple games lasting past 1950 without a clear winner. RandomProposerPlayer
uses very few resources, so it are useful as stand-ins for other players.
See CONTRIBUTING.md
for instructions on how to implement new bots (i.e., advisors and players).
This project uses various code quality tooling, all of which is automatically installed with the rest of the development requirements.
All checks can be run with make check
, and some additional automatic changes can be run with make fix
.
To test GitHub Actions workflows locally, install act
and run it with act
.