Skip to content

Writing Bots for THE RESISTANCE

alexjc edited this page Jun 28, 2012 · 1 revision

THE RESISTANCE is a card & board game where 5 players play on two teams, one team of Spies with two players (2 red) and Resistance fighters with three players (3 blue). The goal of the game is for the Resistance to demolish government buildings over the course of 5 missions, and they win if 3 missions succeed! The Spies, however, aim for the missions to be sabotaged and fail, and win if 3 missions fail.

The rest of this page describes the game rules, as seen through the API of the Bots.

onGameRevealed

  • Resistance do not know who is a spy and who is not a spy. Very little information is revealed to them, except who is taking part in the game and which order they are sitting around the table. For Resistance operatives, the game is one of deduction.
  • Spies are told who each other are, and know therefore also who is Resistance. They have full information about the game, as well as the basic information that the Resistance got. For Imperial Spies, the game is one of deception.

onMissionAttempt

Everyone around the table is a team, though of course there are Spies among the true Resistance. Still, the Resistance must go on missions to destroy government buildings.

  • Missions involve a subset of the players. By observing the players selected for the missions, you can get more information about the game to help with deduction.
  • There are five missions, each involving exactly [2, 3, 2, 3, 3] for the 5 player variation of the game. Each mission can only

select

The team leader picks the players who go on the mission.

  • As Resistance, by selecting players carefully, the leader can increase the chances of the mission succeeding.
  • As Spy, the selection must bias giving away information vs. being able to sabotage the mission safely.

vote

Once the leader has chosen, everyone around the table can vote to determine if they want the mission to proceed. There is typically negotiation, discussion and deception that happens during this phase of the game in human matches. Bots are expected to vote [True, False] whether they want the mission to proceed or not!

If the mission receives a majority of votes (3 or more), it will take place with the selected players.

onVoteComplete

All the votes are revealed at the same time to avoid influencing votes. This also creates interesting opportunities for trickery, deception and gathering more information. The bots are passed this information via a callback function, so you know exactly what each player voted.

sabotage

In human games, the selected players are given another card to determine whether they'd like to sabotage a mission or not. The bots return [True, False] depending on their choice.

  • Resistance cannot sabotage a mission, and from the API the bot is not given the chance to sabotage it.
  • Spies have the option to sabotage a mission or not, effectively deceiving the rest of the team about their identity.

If there's at least one sabotage vote, the mission fails and it counts as a win for the Spies (red). If there are no sabotage cards, then the Resistance wins (blue).

onMissionComplete

Once the sabotage has been done, everyone is notified about how many sabotages were done during the mission. The sabotages cards are mixed up in human games so nobody knows who voted what. For the bots, you only get the number of sabotages returned as an integer.

onGameComplete

Once 5 missions have taken place, the game ends.

For details about the API see this file: https://github.com/aigamedev/resistance/blob/master/player.py