🗡️ PettingZoo Coup API

An implementation of the hidden information card game Coup as a Gymnasium/PettingZoo environment.

In Coup, players want to attack and remove other players' cards and win by being the last player standing with cards. Players may, and often should, lie about the hidden roles they are holding in their hand, but they risk losing cards if they are caught. To play well, players should keep track of each other's actions throughout the game and play the odds set by the cards.

Being a stochastic multi-agent game like Poker, the optimal strategy would be defined as a Nash equilibrium. Many game situations are not trivial to solve, and may lead to stand-offs where no player wants to attack first. Reinforcement learning methods like "Counterfactual Regret Minimization" can find a Nash equilibrium by training a model through self-play.

Gymnasium is a reinforcement learning library that specifies a standard API for creating single-agent environments, while PettingZoo is the Gymnasium extension for multi-agent environments. I implemented Coup as a PettingZoo AEC environment with the goal of training an agent through self-play (WIP).

More information on the game and implementation is available on the Github page.