HPI Poker Bot Competition

Please see the README of your repositories for more information about the framework and how to setup. This page is a clone of the README but may contain updated information. Find updated infos on troubleshooting here:

Troubleshooting

Developing your Poker Bot

In the bots folder you can find different skeletons for python and C++. Choose your preferred language, copy the corresponding skeleton directory and start implementing your poker bot.

We play a 1v1 version of no limit texas hold'em, and your implementation will control one of the bots. For more information on how to run a game, see section Running your Poker Bot.

Overall, you will have to implement a class that is called to ask for an action when its the bots turn. You will have to return which action you choose to do. Furthermore, a method will be called when a new round has started and when a round has ended. The Game- and RoundState are always passed as arguments and contain all information about the state. For further information, please look at the comments and the relevant classes (player.py or src/main.cpp).

In commands.json you can configure how your bot is called. You will most likely not have to change those if you use the same structure as the skeletons. Other files ensure the correct connection between the poker engine and the poker bots. You will not have to change any files other than the main script.

Installing libraries

Before installing a library you have to check with the HPI Showdown team if this library is allowed. You have to post a message in the related discord channel (https://discord.com/channels/1308788707389607976/1326184106010087485) with a link to its documentation.

You can install the libraries in the Dockerfile of your bot. For python you can also add it to the requirements.txt. Make sure that all resources your bot requires are inside of the Dockerfile and the directory of the bot.

If you are running your bot without docker you should also add the library to your environment.yaml.

Submission

Before the competitions you will have to push the code of your current bot into the correct subdirectory of the submission directory. See submission/example as an example structure. We will only consider the code inside of this directory (make sure no files outside of this directory are referenced) that was pushed before the deadline. Edit the name.txt to give your bot a name for the final competition.

Running your Poker Bot

The engine can run an 1v1 poker game consisting of several rounds between two bots. .env contains the configuration for your matchup including the paths to the two bots you want to play against each other. The rest of the configuration is setup just as in the final tournament. You may change them while developing e.g. preventing to enforce the game clock to prevent timeouts while debugging your bot.

The final results of your match are shown in the console output. Additionally, a JSON summary with some statistics can be found in logs/summary. The logs/game_logs contains a standardized format of each round and action taken in the game. Finally, logs/bot_logs contains any stdout, stderr or print statements your bot made (if the bot was not containerized with docker). This can be useful for debugging your bot and finding error sources.

There are different ways how you can run a match between two poker bots:

Locally with Docker (Recommended for Quick Setup)

We recommend using docker to run the poker bot engine because it will save you some time setting up your environment and because this will be how the bots are run in the competitions.

You will only need to install docker. Once the docker engine is running, you need to build the docker image. There is a base image which already contains all dependencies the framework needs. You should build this first by running docker build -t pbc25base -f pbcBase.Dockerfile .. Then you specify which bots you want to run by setting the variables PLAYER1_PATH and PLAYER2_PATH in the .env file. Set the DOCKERIZE_BOTS variable to true and you can run a game by using docker compose: docker-compose up.

Everytime you change something in your code, you have to rebuild the containers. You can do this by specifying the --build flag in the docker-compose up command or running docker-compose build.

Note that the bot_logs file of a match will be empty. Your logs will only be found inside of the bot container and in the docker compose console.

Locally without Docker

For setting the environment up manually you will have to download the required dependencies. This could take a little longer but especially allows debugging your python bots easily.

Requirements & Setup

As the engine is written in python you can easily setup your environment with conda. Then you can run conda env create -f environment.yml.

We recommend implementing your bots in python since there is no additional setup required and it allows for easy debugging. If you do decide to implement your bot in a different language you will need to the following requirements:

For running C++ bots: