top of page

Mafia Game - Real-time Multiplayer Web Application

Project Statement

Game Setup:

• Players: Minimum 6 players required, each uses their own mobile device to join
• Room Creation: One player creates a game room and shares the unique room code with others
• Role Assignment: System randomly assigns roles - roughly 30% become Mafia, others are Citizens with special roles
• Roles Distributed: 1+ Mafia, 1 Doctor, 1 Police, 1 Terrorist, remaining Citizens, 1 God (moderator)

The Roles Explained
• Mafia: Evil team that secretly coordinates to eliminate all good players, knows who other Mafia are
• Citizens: Good team trying to identify and vote out all Mafia during day discussions
• Doctor: Can protect one player each night from being killed (including themselves, but only once)
• Police: Can investigate one player each night to learn if they're Mafia or Citizen
• Terrorist: Wild card who can detonate a bomb once per game, killing both themselves and their target
• God: Moderator who sees everyone's roles, controls game flow, and makes final decisions

Game Phases - How Each Round Works
Night Phase (Secret Actions)
• All players close their eyes/look away except those taking actions
• Mafia secretly choose someone to eliminate
• Doctor secretly chooses someone to protect from death
• Police secretly investigates someone to learn their team
• Terrorist can choose to bomb someone (optional, one-time use)
• God sees all actions and resolves conflicts (e.g., if Doctor protects Mafia's target)

Day Phase (Discussion)
• Everyone opens their eyes and discusses what happened
• Players share information, make accusations, form alliances
• Police may hint at investigation results without revealing their role
• Doctor learns if their protection was successful
• Dead players are revealed and eliminated from the game

Voting Phase (Democratic Elimination)
• All living players vote to eliminate someone they suspect is Mafia
• Majority vote eliminates that player
• Tie Handling: If votes are tied, ALL tied players are eliminated
• God cannot be voted out (moderator protection)
• Eliminated player's role is revealed to everyone

Win Conditions
• Citizens Win: Successfully eliminate ALL Mafia members through voting
• Mafia Wins: When Mafia members equal or outnumber the remaining Citizens
• Game Continues: Until one side achieves their win condition through multiple rounds

Strategic Elements
• Information Warfare: Police gather intel, Mafia spread misinformation, Citizens deduce from behavior
• Bluffing: Players may lie about their roles or what they know to survive
• Alliance Building: Citizens must work together while Mafia pretend to be helpful
• Timing: Terrorist must choose optimal moment to reveal and bomb
• Protection Strategy: Doctor must guess who Mafia will target each night

Special Mechanics
• Doctor Feedback: Learns whether their protection saved someone from death
• Self-Protection Limit: Doctor can only protect themselves once per entire game
• Terrorist Sacrifice: Bombing eliminates both terrorist and target (high-risk, high-reward)
• Dead Player Exclusion: Eliminated players cannot participate but can observe the game
• Round Progression: Game continues through multiple night/day/voting cycles until victory

Social Dynamics
• Deception: Mafia must act innocent while secretly coordinating kills
• Deduction: Citizens analyze voting patterns, behavior, and claims to identify Mafia
• Pressure: Accusations and defenses create intense social interactions
• Trust: Players must decide who to believe in a game built on lies and misdirection

  • LinkedIn
  • GitHub
  • Medium
bottom of page