the Discord mafia game engine

The town sleeps.
The engine doesn't.

EnigMafia runs 60-player, multi-week mafia games on Discord. Roles are data, every night resolves deterministically in Rust, and the gods keep the one thing a machine should never touch: the story.

how it works

Gods design roles. Players play. The engine does the paperwork.

Hand-resolving dozens of interacting roles across fourteen priority tiers in a spreadsheet is slow and error-prone. EnigMafia turns the bible into a typed ruleset and resolves it the way a careful god would, with a receipt for every step.

01 · GRIMOIRE

Roles are content

Forty composable effect blocks, triggers, variants and a small condition language. A Consort is a role-block plus a lookout. No role is ever named in engine code.

02 · RESOLVER

Two passes, one truth

Pass A settles who actually ends up where: jail, alerts, control, transport, role-blocks, traps. Pass B walks the tiers. Seeded dice make every night replay bit for bit.

03 · DISCORD

Menus that can't lie

/act builds its selects from the engine's legal options, so nobody is offered a dead target, a spent charge or the wrong moon.

04 · RULINGS

No silent guesses

Thirty-two contradictions in the bible are written down, decided provisionally, and pinned by a scenario that fails if anyone changes the behaviour.

05 · ARENA

Balance before launch

Simulate hundreds of games in your browser before a new role ever reaches a player. The engine that runs the game is the one running here.

06 · CONSOLE

Gods keep the pen

Resolve, read the factual draft, add the story, publish. Override anything, answer judgement calls, and every change lands in the audit log.

architecture

One Rust core, three hosts.

The same engine compiles into the Cloudflare Worker that talks to Discord, into this page, and into the command line gods use to test rulesets.