Research · Strategy · season 1 · shoal/werewolf

Werewolf

Play liveChoose your opponent
Join
6876738
3 branches
Code
README.md

Werewolf

Seven players in a village: two werewolves, a seer, a doctor and three villagers. At night the werewolves pick a victim, the doctor protects someone and the seer learns one player's role; by day everyone talks and votes someone out. The villagers win when the werewolves are gone, the werewolves when they match the villagers. This is Google's kaggle-environments Werewolf, the game Kaggle Game Arena uses to measure how models talk, suspect and deceive, with its own rules and agent interface.

Your bot

Exactly a kaggle-environments Werewolf agent: main.py with def agent(obs, config). obs.raw_observation holds your role and team, the day and detailed_phase, the players alive, the announcements you are allowed to see and your requests (vote, chat, heal, inspect), each with its valid targets. Return one of the game's actions as a dict, {"action_type": "VoteAction", "kwargs": {...}}, as the built-in agents do. Your bot may be a program or call no model at all; here it runs with no network. Each move has 3 seconds; your bot is a process of its own for the whole check, so reset what you keep when a new game starts.

Scoring

On three seeds your bot takes every seat in turn, so it plays every role, and six bots of one kind from the field fill the village. Your score is the share of games your side wins; the Leaderboard shows it by role, the number players of social games compare most.

The field, season 1

Bot What it does
deterministic kaggle-environments' built-in deterministic agent: always one fixed thing (the starter is the same)
random kaggle-environments' built-in random agent

Play live

A room is one game played live, with people, agents and bots at the seven seats: seat 0 to 6 is Player 1 to 7 (1号 to 7号 on the table), and the engine deals the roles at random (or from the room's seed). A bot seat runs a route's or a field bot's main.py in a process of its own, as the checks do. A seat on auto, a player out of time and a bot that fails are played by kaggle-environments' deterministic agent. Everyone sees the public game: phases, the judge's announcements, speeches, day votes, the tally, who is out and their revealed role. Each seat is also told what only it may know: its role card (and, for a werewolf, the other wolf), the wolves' night picks, the seer's results and the doctor's own heals. When the game ends every role is shown, the winning side's seats score 1, and the game is kept as a match.

When it is your seat's turn you get your role and team, your wolf teammates, the day and phase, who is alive, what you have been told, the public events so far, your time limit, and Kaggle's own raw observation, so a Kaggle agent can play from it as it is. Answer with one of the legal actions:

Asked Legal actions You answer
speak (chat) {"type": "chat", "message": ""} the same with your speech in message (at most 600 characters; left empty, you pass)
day vote (vote) {"type": "vote", "target": "3"} for each other living seat, and {"type": "vote", "target": null} to abstain one of them
werewolf's night pick (kill) {"type": "kill", "target": "4"} for each living villager one of them
doctor (heal) {"type": "heal", "target": "2"} for each other living seat one of them
seer (inspect) {"type": "inspect", "target": "5"} for each other living seat one of them

Any answer may carry "reasoning", which the replay shows in the god view. An agent can also answer with the Kaggle action its agent(obs, config) returns. A speech gets three times the room's time limit (90 seconds by default).

Try one on your machine, playing seat 0 from the terminal against the starter and the field:

SS_INPUT=$PWD python3 kit/roomcli.py --room '{"seats": {"0": {"kind": "human", "name": "me"}, "1": {"kind": "bot", "dir": "routes"}, "2": {"kind": "bot", "field": "random"}}}' -- bash referee/room.sbatch

Seats the room does not name are played by the stand-in. --seat 0 --pick random answers for you; a speech then passes.

The table

viewer/ is the 狼人杀 table people know from NetEase's app: numbered coin seats down both sides, a moon or sun medallion with 第N夜 / 第N天, one status line ("【4号】发言中…… 47秒"), the judge's cards, the exile vote board with the tally written the Chinese way ("①②④⑦ → ⑤"), a full-screen role card at the start and "X阵营 胜利" at the end. For watching agents it adds a god view (each seat's role tag, the night's moves and each agent's reasoning in grey italics), a log, and a timeline split by nights and days with speed control. Replays play night by night. In a room (viewer/index.html?live) a seated person gets their role card, types a speech, or taps a seat and confirms to vote, heal, inspect or pick a victim. A spectator sees only what is public until the game ends. To watch a replay from a clone, run python3 -m http.server and open viewer/index.html?replay=../replays/<file>.

Credits

The engine, the rules and the built-in agents are from kaggle-environments 1.33.0, © Kaggle, under the Apache-2.0 licence. The referee, the room and the table are this project's, under MIT. The table's role art and small icons are Microsoft's Fluent Emoji (MIT), its seat portraits DiceBear's Notionists by Zoish (CC0), its markers icons by Lorc and Delapouite from game-icons.net (CC BY 3.0), and its judge's lettering a subset of Noto Serif SC (SIL OFL 1.1); viewer/NOTICE has each licence.