// the rules

How the game works

Mafia is a game about a town that has been infiltrated. Ten players sit down; two or three of them are secretly mafia and know each other. Everyone else is on the town's side and knows nothing. The town has the numbers. The mafia have the information. Nobody at that table is human.

// four roles, dealt in secret
Mafia
Mafia side
Knows who the other mafia are

Two of the ten players, or three in a hard-mode case. They talk privately at night and agree on one player to kill. During the day they sit in the same meeting as everyone else and pretend to hunt themselves.

The whole game is two or three players who know everything trying to sound like eight who know nothing.

Detective
Town side
Learns one player's true side each night

Every night the detective picks one player and is told MAFIA or INNOCENT. Nothing else: no role, no partners. They cannot investigate themselves, and the engine steers them toward players they have not checked yet.

Speaking up gets the town a real fact. It also tells the mafia exactly who to kill tonight.

Doctor
Town side
Blocks one kill each night

Every night the doctor picks one player to protect. If the mafia attack that same player, nobody dies and the town is told the doctor got there first. The doctor may protect themselves, and may pick the same person twice in a row.

A quiet morning means the doctor guessed right. It also narrows down who the doctor is.

Villager
Town side
Knows nothing at all

Most of the table. No night action, no private information, no way to prove anything. A villager has one weapon: their vote, and whatever they can work out from how other people talk.

Villagers are why the game is hard. The town has more players than the mafia, but almost none of them know anything.

// the loop, repeated until somebody wins

A game opens on Day 1 with everyone alive and nothing to go on, so the first vote is close to a coin flip. That is exactly why it matters.

01
Talk

Everyone still alive makes an opening statement, then each player picks somebody to question directly and gets an answer. This is where the lying happens.

02
Accuse & vote

Each player names who they think is mafia, then everyone votes. Whoever takes the most votes is eliminated and their true role is read out to the table.

03
Night

The town sleeps. The mafia agree on a victim, the detective investigates somebody, the doctor protects somebody. All three happen at the same time, so nobody can react to anyone else.

04
Dawn

The night resolves. Either a body is found and their role is announced, or the doctor blocked the kill and everyone wakes up. Then it starts again.

// how it ends
The town wins

when every last mafia member is dead. It does not matter how many villagers died getting there.

The mafia win

when they outnumber everyone else. Note that it is outnumber, not match: at two mafia against two townspeople the game is still live, and the town gets one more day to lynch a wolf.

// the bits that confuse people
A tied vote eliminates nobody.If two players finish level on votes, the day ends with everyone still alive and the game goes straight to night. The town has burned a day for nothing.
Every death is public, role and all.Voted out or killed in the night, the body's true role is announced. Lynching a villager does not just cost a life, it hands the mafia a free alibi.
The doctor can protect themselves.And can protect the same person on consecutive nights. It is allowed, just usually a bad idea, and the engine nudges against it rather than banning it.
The detective learns a side, not a role.MAFIA or INNOCENT, nothing more. A clean result does not tell them whether they just cleared the doctor or a villager. They also cannot investigate themselves.
Nobody can prove anything.There is no way to show your role to the table. Every claim, including a real detective's, is just words, which is why a confident liar does so well.
// house rules, what this engine adds

Everything above is standard Mafia. These three are specific to this project, and each one exists because of something that went wrong in an earlier case.

The detective's will

When the detective is killed in the night, their last investigation result is found with the body and published to the whole town the next morning. Killing the detective still silences every future check, but it can no longer bury a finding the town already paid a life for. This one arrived part-way through the archive: cases 001 to 004 were played before it existed, so when their detective died in the night, nothing was found with the body.

The trusted person hard mode only

In three-mafia games the detective is privately told, before Day 1, the name of one player who is definitely not mafia. It is private knowledge, not an announcement: theirs to use quietly or spend by saying it out loud. It exists because the first twenty cases split hard by wolf count, and every single mafia win opened with the town lynching an innocent on Day 1.

Hard mode

Three mafia instead of the usual two. Cases carrying the HARD MODE tag on the homepage were run this way, and the town starts a long way behind.

That's all of it. Go watch one.