Skip to content

The Resistance AI bot

  • #Project
  • #Algorithm
Read time: 2 minutes
Zane LI
Zane LI

Click here to GithubπŸ”—

RulesπŸ”—

Game Rules: The ResistanceπŸ”—

The Resistance is a multiplayer game for 5-10 players.
One third (rounded up) of the players are randomly selected to be government spies, and the remaining players are loyal members of the resistance.
The spies know who all the other spies are, but the resistance members are unable to distinguish the spies.
The spies are attempting to sabotage the resistance by deliberately failing enough missions to ruin the resistance's plans.Play proceeds as follows:

  • A player is randomly selected to be the starting leader.
  • The game consists of a series of 5 "missions":
    • Each mission has a required number of players to send on the mission, and a required number of Fail votes for the mission to fail.
    • For each mission, a team is selected by the following process:
      • The current leader proposes a team of players to send on the mission.
      • All players vote publicly on the proposed team.
      • If the team is approved, that team is sent on the mission (see below).
      • If the team is rejected, the next player becomes the leader and proposes their own team.
      • After four rejected proposals in a row, the fifth proposal is automatically accepted (in the real game, the spies win after five rejections).
    • The selected team then votes secretly on whether the mission succeeds:
      • Loyalists can only vote for the mission to succeed.
      • Spies may choose to vote for the mission to succeed or fail.
      • The total number of fail votes is revealed, and if it meets the required number of fails for that mission, the mission fails.
  • The spies win if a majority of the 5 missions fail, and the loyalists win if a majority succeed.

How to run a single game, in a terminal:πŸ”—


python3 run_game.py


How to run a tournament of games, in a terminal:

πŸ”—

python3 run_tournament.py