• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 12:20
CEST 18:20
KST 01:20
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
[ASL20] Ro16 Preview Pt1: Ascent8Maestros of the Game: Week 1/Play-in Preview12[ASL20] Ro24 Preview Pt2: Take-Off7[ASL20] Ro24 Preview Pt1: Runway132v2 & SC: Evo Complete: Weekend Double Feature4
Community News
Weekly Cups (Sept 1-7): MaxPax rebounds & Clem saga continues6LiuLi Cup - September 2025 Tournaments2Weekly Cups (August 25-31): Clem's Last Straw?39Weekly Cups (Aug 18-24): herO dethrones MaxPax6Maestros of The Game—$20k event w/ live finals in Paris69
StarCraft 2
General
Weekly Cups (Sept 1-7): MaxPax rebounds & Clem saga continues #1: Maru - Greatest Players of All Time Team Liquid Map Contest #21 - Presented by Monster Energy Production Quality - Maestros of the Game Vs RSL 2 Geoff 'iNcontroL' Robinson has passed away
Tourneys
Maestros of The Game—$20k event w/ live finals in Paris Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series Chzzk MurlocKing SC1 vs SC2 Cup Sea Duckling Open (Global, Bronze-Diamond)
Strategy
Custom Maps
External Content
Mutation # 490 Masters of Midnight Mutation # 489 Bannable Offense Mutation # 488 What Goes Around Mutation # 487 Think Fast
Brood War
General
FlaSh on ACS Winners being in ASL BGH Auto Balance -> http://bghmmr.eu/ ASL20 General Discussion BSL Polish World Championship 2025 20-21 September [ASL20] Ro16 Preview Pt1: Ascent
Tourneys
[ASL20] Ro16 Group A [IPSL] ISPL Season 1 Winter Qualis and Info! [Megathread] Daily Proleagues Is there English video for group selection for ASL
Strategy
Simple Questions, Simple Answers Muta micro map competition Fighting Spirit mining rates [G] Mineral Boosting
Other Games
General Games
General RTS Discussion Thread Stormgate/Frost Giant Megathread Nintendo Switch Thread Path of Exile Warcraft III: The Frozen Throne
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread The Games Industry And ATVI UK Politics Mega-thread Russo-Ukrainian War Thread
Fan Clubs
The Happy Fan Club!
Media & Entertainment
[Manga] One Piece Anime Discussion Thread Movie Discussion! [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion MLB/Baseball 2023 2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread High temperatures on bridge(s)
TL Community
The Automated Ban List TeamLiquid Team Shirt On Sale
Blogs
Collective Intelligence: Tea…
TrAiDoS
A very expensive lesson on ma…
Garnet
hello world
radishsoup
Lemme tell you a thing o…
JoinTheRain
RTS Design in Hypercoven
a11
Evil Gacha Games and the…
ffswowsucks
INDEPENDIENTE LA CTM
XenOsky
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1259 users

Mafia Simuator

Forum Index > TL Mafia
Post a Reply
Cyber_Cheese
Profile Blog Joined July 2010
Australia3615 Posts
Last Edited: 2012-01-01 00:41:00
September 16 2011 20:22 GMT
#1
I found a really awesome mafia simulator on the SC2 mafia forums, thought I'd share it here
Please note that it is *not* made by me.

Link to the site I found it: http://www.sc2mafia.com/forum/showthread.php/2117-Mafia-Simulator?highlight=simulator
+ Show Spoiler [The introductory paragraphs] +

~ Introduction ~
Mafia Simulator is a program based on Dark.Revenant's SC2 Map "-Mafia-" and Forum Mafia on councilofmages.com.
It features almost all roles present in those environments and their options, as well as some new stuff added by the programmers.

With this program, you can simulate almost every setup you could see in SC2Mafia, or even add players for simulating more populated environments. The AI is pretty simple, as it cannot properly emulate human brain and players interaction, however it takes into account all actions that in-game roles could do, memorize them, and use them when time is due. For example, if a sheriff finds mafia, that player will be lynched next day.

Organized teams will also try their best to accomplish their victory condition: mafia and cult will never vote against their own members, culted doctors will heal the cult leader, consigliere will find town power roles and send mafia to kill them the following night, and so on.

Set roles options as you see fit to recreate some of the most entertaining conditions for a mafia game. Then enjoy reading the log and see what happened.
Alternatively you can run a high number of simulations - multithread helps - and then check the graphs to see if it is nearly balanced or if it needs more tweaks.

A summary: It's a program that can take a list of roles which the user customises into the ones that will and won't be in the game, and simulates it over the course of X games, displaying statistical results that can be used to help balance mafia setups. If one of the games has a curious result, e.g no winner, the log can be viewed and you can check how the game went down.

Important notes are that it does not factor player skill, and there a few things about the AI that players might not choose to do, i.e a sheriff who detects mafia will immediately reveal and get attacked right afterwards.
The moment you lose confidence in yourself, is the moment the world loses it's confidence in you.
Hesmyrr
Profile Blog Joined May 2010
Canada5776 Posts
Last Edited: 2011-09-16 20:37:15
September 16 2011 20:35 GMT
#2
I'll stick with old-school pen & paper, RNG calculator thanks xD
While pretty cool don't think it will help with any game that tries to introduce novel mechanics. Interesting find though.
"If watching the MSL finals makes you a progamer, then anyone in Korea can do it." - Ha Tae Ki
kitaman27 *
Profile Blog Joined April 2009
United States9245 Posts
September 25 2011 13:32 GMT
#3
Just out of curiosity, I ran the four possible setups from SNMMVI and here is what came out. Probably can't much faith into this, but it was interesting to see how big of a swing there was between 1 medic and 1 detective.

Town % / Mafia %

36/63
1 Mafia Role Blocker, 1 Mafia Goons, 8 Town

27/73
2 Mafia Goons, 1 Medic, 7 Town.

50/50
2 Mafia Goons, 1 Detective, 7 Town.

55/45
1 Mafia Role Blocker, 1 Mafia Goons, 6 Town, 1 Medic, 1 Detective



I'm better than dirt. Well, most kinds of dirt. I mean not that fancy store bought dirt. That stuffs loaded with nutrients. I... I can't compete with that stuff.
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 25 2011 15:48 GMT
#4
That actually makes no sense whatsoever.

Second setup can't possibly be worse for town than the first setup. There's no way having a medic is worse for town because the only blockable night kills are mafia kills, therefore setup 2 should have a higher win % for town than setup 1
Radfield
Profile Joined September 2009
Canada2720 Posts
September 25 2011 17:31 GMT
#5
Yep, makes no sense.

Assuming the medic saves no one, then the setup is the exact same as 8VT. If the medic makes a save then it's pretty much GG.
GMarshal
Profile Blog Joined March 2010
United States22154 Posts
Last Edited: 2011-09-25 17:44:13
September 25 2011 17:43 GMT
#6
I guess an all medic vs regular scum setup would be scum favored then :-P
Moderator
Radfield
Profile Joined September 2009
Canada2720 Posts
September 25 2011 18:16 GMT
#7
On September 26 2011 02:43 GMarshal wrote:
I guess an all medic vs regular scum setup would be scum favored then :-P



It would be fun to run a game like that. High scum KP, lotsa medics. SO MUCH WIFOM!
Kurumi
Profile Blog Joined April 2010
Poland6130 Posts
September 25 2011 19:04 GMT
#8
On September 26 2011 03:16 Radfield wrote:
Show nested quote +
On September 26 2011 02:43 GMarshal wrote:
I guess an all medic vs regular scum setup would be scum favored then :-P



It would be fun to run a game like that. High scum KP, lotsa medics. SO MUCH WIFOM!

And my next mafia setup got figured out...
I work alone. // Visit TL Mafia subforum!
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 25 2011 19:38 GMT
#9
all town setup lol
Radfield
Profile Joined September 2009
Canada2720 Posts
September 25 2011 20:00 GMT
#10
On September 26 2011 04:04 Kurumi wrote:
Show nested quote +
On September 26 2011 03:16 Radfield wrote:
On September 26 2011 02:43 GMarshal wrote:
I guess an all medic vs regular scum setup would be scum favored then :-P



It would be fun to run a game like that. High scum KP, lotsa medics. SO MUCH WIFOM!

And my next mafia setup got figured out...



You can even mix in doctor sanities for extra fun! Sane, Paranoid(jailer), Naive, Weak..... CPR!?

Toss in some mafia roleblockers and poof!.... a set-up.
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 25 2011 20:01 GMT
#11
LOL

that would be freaking hilarious
GMarshal
Profile Blog Joined March 2010
United States22154 Posts
September 25 2011 20:21 GMT
#12
On September 26 2011 05:00 Radfield wrote:
Show nested quote +
On September 26 2011 04:04 Kurumi wrote:
On September 26 2011 03:16 Radfield wrote:
On September 26 2011 02:43 GMarshal wrote:
I guess an all medic vs regular scum setup would be scum favored then :-P



It would be fun to run a game like that. High scum KP, lotsa medics. SO MUCH WIFOM!

And my next mafia setup got figured out...



You can even mix in doctor sanities for extra fun! Sane, Paranoid(jailer), Naive, Weak..... CPR!?

Toss in some mafia roleblockers and poof!.... a set-up.

Dont forget to add a serial killer and a bunch of town/scum vigilantes.
Moderator
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 25 2011 20:23 GMT
#13
no just doctors GMarsh gawd
wherebugsgo
Profile Blog Joined February 2010
Japan10647 Posts
September 25 2011 20:23 GMT
#14
I'd call it med school mafia
Radfield
Profile Joined September 2009
Canada2720 Posts
September 25 2011 22:24 GMT
#15
GMan always recking stuff geez
GreYMisT
Profile Blog Joined October 2010
United States6736 Posts
September 25 2011 23:47 GMT
#16
ready?
30 people
25 medics
4 mafia busdrivers
1 arsonist

Ready set go
"life of lively to live to life of full life thx to shield battery" / Join TL Mafia! http://www.teamliquid.net/forum/index.php?show_part=31
Cyber_Cheese
Profile Blog Joined July 2010
Australia3615 Posts
Last Edited: 2011-09-29 06:14:40
September 29 2011 05:59 GMT
#17
On September 26 2011 00:48 wherebugsgo wrote:
That actually makes no sense whatsoever.

Second setup can't possibly be worse for town than the first setup. There's no way having a medic is worse for town because the only blockable night kills are mafia kills, therefore setup 2 should have a higher win % for town than setup 1


To a small degree I think I can explain it.
How many games did he simulate?
Over 10k games I got:

+ Show Spoiler [Initial Results] +
1 Mafia Role Blocker, 1 Mafia Goons, 8 Town
Results for 10000 iterations after 5.87 seconds:
Pure: 6553 town wins, 3447 mafia wins.

2 Mafia Goons, 1 Medic, 7 Town.
Results for 10000 iterations after 5.18 seconds:
Pure: 6234 town wins, 3766 mafia wins.

2 Mafia Goons, 1 Detective, 7 Town.
Results for 10000 iterations after 5.20 seconds:
Pure: 7806 town wins, 2194 mafia wins.

1 Mafia Role Blocker, 1 Mafia Goons, 6 Town, 1 Medic, 1 Detective
Results for 10000 iterations after 4.94 seconds:
Pure: 7360 town wins, 2640 mafia wins.

The Docs must be broken though because
2 Mafia Goons, 8 Medics
Results for 10000 iterations after 5.65 seconds:
Pure: 3812 town wins, 6188 mafia wins.

I actually really want to see a game full of medics now :D
EDIT: LOLWAIT, under citizen settings, turn wins ties with mafia off.

+ Show Spoiler [New Results] +
1 Mafia Role Blocker, 1 Mafia Goons, 8 Town
Results for 10000 iterations after 5.30 seconds:
Pure: 2184 town wins, 7816 mafia wins.

2 Mafia Goons, 1 Medic, 7 Town.
Results for 10000 iterations after 3.97 seconds:
Pure: 2548 town wins, 7452 mafia wins.

2 Mafia Goons, 1 Detective, 7 Town.
Results for 10000 iterations after 3.99 seconds:
Pure: 3604 town wins, 6396 mafia wins.

1 Mafia Role Blocker, 1 Mafia Goons, 6 Town, 1 Medic, 1 Detective
Results for 10000 iterations after 4.11 seconds:
Pure: 3890 town wins, 6110 mafia wins.

Edit 2: And I just realised they all look imbalanced because there is supposed to be 10 town, not 10 total.
The moment you lose confidence in yourself, is the moment the world loses it's confidence in you.
Cyber_Cheese
Profile Blog Joined July 2010
Australia3615 Posts
September 29 2011 06:11 GMT
#18
On September 26 2011 08:47 GreYMisT wrote:
ready?
30 people
25 medics
4 mafia busdrivers
1 arsonist

Ready set go


If only it were compatible with mafia bus drivers.
The moment you lose confidence in yourself, is the moment the world loses it's confidence in you.
Please log in or register to reply.
Live Events Refresh
Monday Night Weeklies
16:00
MNW 22
SteadfastSC352
TKL 149
IndyStarCraft 55
BRAT_OK 46
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 418
SteadfastSC 352
TKL 149
mcanning 103
IndyStarCraft 55
BRAT_OK 46
UpATreeSC 28
MindelVK 7
StarCraft: Brood War
Calm 8599
Flash 2292
Jaedong 1008
Mini 442
firebathero 326
Light 322
hero 309
Hyuk 259
Soma 230
sSak 200
[ Show more ]
ggaemo 129
Snow 107
Dewaltoss 80
Sharp 60
soO 45
Hyun 44
sas.Sziky 38
sorry 37
Rock 24
Free 20
Terrorterran 16
Hm[arnc] 15
JYJ15
scan(afreeca) 14
ajuk12(nOOB) 13
Noble 10
Britney 0
Dota 2
Gorgc9327
qojqva3761
Dendi1957
XcaliburYe150
Other Games
singsing1664
B2W.Neo930
hiko926
FrodaN797
Lowko334
ceh9286
Hui .271
Beastyqt216
ArmadaUGS123
QueenE116
Khaldor113
SortOf71
KnowMe61
Organizations
Other Games
gamesdonequick1181
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 16 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• FirePhoenix14
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV617
League of Legends
• Nemesis1668
• Jankos1525
• TFBlade599
Other Games
• Shiphtur312
Upcoming Events
Afreeca Starleague
17h 40m
BeSt vs Alone
Queen vs Bisu
PiGosaur Monday
1d 7h
OSC
1d 23h
OSC
2 days
RSL Revival
2 days
Cure vs SHIN
Reynor vs Zoun
The PondCast
2 days
RSL Revival
3 days
Classic vs TriGGeR
ByuN vs Maru
Online Event
3 days
BSL Team Wars
4 days
Team Bonyth vs Team Dewalt
BSL Team Wars
4 days
[ Show More ]
RSL Revival
4 days
Maestros of the Game
4 days
ShoWTimE vs Classic
Clem vs herO
Serral vs Bunny
Reynor vs Zoun
Cosmonarchy
4 days
Bonyth vs Dewalt
[BSL 2025] Weekly
5 days
RSL Revival
5 days
Maestros of the Game
6 days
BSL Team Wars
6 days
Afreeca Starleague
6 days
Snow vs Sharp
Jaedong vs Mini
Liquipedia Results

Completed

Copa Latinoamericana 4
SEL Season 2 Championship
HCC Europe

Ongoing

BSL 20 Team Wars
KCM Race Survival 2025 Season 3
BSL 21: BSL Points
ASL Season 20
CSL 2025 AUTUMN (S18)
LASL Season 20
RSL Revival: Season 2
Maestros of the Game
Chzzk MurlocKing SC1 vs SC2 Cup #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1

Upcoming

2025 Chongqing Offline CUP
BSL Polish World Championship 2025
BSL Season 21
BSL 21 Team A
EC S1
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
MESA Nomadic Masters Fall
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.