• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 15:09
CET 20:09
KST 04:09
  • 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
Intel X Team Liquid Seoul event: Showmatches and Meet the Pros7[ASL20] Finals Preview: Arrival13TL.net Map Contest #21: Voting10[ASL20] Ro4 Preview: Descent11Team TLMC #5: Winners Announced!3
Community News
Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win52025 RSL Offline Finals Dates + Ticket Sales!10BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION1Crank Gathers Season 2: SC II Pro Teams10Merivale 8 Open - LAN - Stellar Fest4
StarCraft 2
General
RotterdaM "Serral is the GOAT, and it's not close" Intel X Team Liquid Seoul event: Showmatches and Meet the Pros Weekly Cups (Oct 20-26): MaxPax, Clem, Creator win Weekly Cups (Oct 13-19): Clem Goes for Four DreamHack Open 2013 revealed
Tourneys
2025 RSL Offline Finals Dates + Ticket Sales! SC4ALL $6,000 Open LAN in Philadelphia Merivale 8 Open - LAN - Stellar Fest Crank Gathers Season 2: SC II Pro Teams $5,000+ WardiTV 2025 Championship
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 497 Battle Haredened Mutation # 496 Endless Infection Mutation # 495 Rest In Peace Mutation # 494 Unstable Environment
Brood War
General
SnOw's ASL S20 Finals Review BW General Discussion [ASL20] Ask the mapmakers — Drop your questions BGH Auto Balance -> http://bghmmr.eu/ Ladder Map Matchup Stats
Tourneys
[ASL20] Grand Finals Small VOD Thread 2.0 The Casual Games of the Week Thread BSL21 Open Qualifiers Week & CONFIRM PARTICIPATION
Strategy
How to stay on top of macro? Current Meta PvZ map balance Soma's 9 hatch build from ASL Game 2
Other Games
General Games
Stormgate/Frost Giant Megathread Beyond All Reason Path of Exile General RTS Discussion Thread Nintendo Switch Thread
Dota 2
Official 'what is Dota anymore' discussion LiquidDota to reintegrate into TL.net
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread SPIRED by.ASL Mafia {211640}
Community
General
Russo-Ukrainian War Thread US Politics Mega-thread Things Aren’t Peaceful in Palestine The Big Programming Thread YouTube Thread
Fan Clubs
White-Ra Fan Club The herO Fan Club!
Media & Entertainment
Movie Discussion! [Manga] One Piece Anime Discussion Thread Korean Music Discussion Series you have seen recently...
Sports
MLB/Baseball 2023 2024 - 2026 Football Thread Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 NBA General Discussion
World Cup 2022
Tech Support
SC2 Client Relocalization [Change SC2 Language] Linksys AE2500 USB WIFI keeps disconnecting Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List Recent Gifted Posts
Blogs
Career Paths and Skills for …
TrAiDoS
KPDH "Golden" as Squid Game…
Peanutsc
Reality "theory" prov…
perfectspheres
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1673 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
Epic.LAN
13:00
Epic.LAN 46 Group Stage
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
UpATreeSC 240
JuggernautJason100
BRAT_OK 53
MindelVK 28
StarCraft: Brood War
Calm 3285
Shuttle 711
Flash 331
Mini 329
Soulkey 130
firebathero 89
NaDa 42
soO 35
Dota 2
XcaliburYe265
canceldota126
Counter-Strike
ScreaM1169
byalli196
Heroes of the Storm
Khaldor173
Other Games
summit1g3137
qojqva2057
fl0m1236
tarik_tv1171
Beastyqt812
Dendi471
Liquid`VortiX158
Hui .145
C9.Mang0127
Grubby101
Fuzer 99
Skadoodle60
QueenE47
Trikslyr44
ToD1
Organizations
Other Games
gamesdonequick1266
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• kabyraGe 135
• HeavenSC 21
• Adnapsc2 16
• Kozan
• LaughNgamezSOOP
• sooper7s
• AfreecaTV YouTube
• Migwel
• intothetv
• IndyKCrew
StarCraft: Brood War
• Michael_bg 9
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• WagamamaTV631
League of Legends
• TFBlade1016
Other Games
• imaqtpie921
• Shiphtur232
• tFFMrPink 9
Upcoming Events
Replay Cast
3h 51m
Epic.LAN
16h 51m
BSL Team A[vengers]
18h 51m
Dewalt vs Shine
UltrA vs ZeLoT
LAN Event
18h 51m
BSL 21
23h 51m
BSL Team A[vengers]
1d 18h
Cross vs Motive
Sziky vs HiyA
LAN Event
1d 19h
BSL 21
1d 23h
Replay Cast
2 days
Wardi Open
2 days
[ Show More ]
Monday Night Weeklies
2 days
Replay Cast
3 days
Sparkling Tuna Cup
3 days
Replay Cast
4 days
The PondCast
5 days
Liquipedia Results

Completed

CSL 2025 AUTUMN (S18)
WardiTV TLMC #15
Eternal Conflict S1

Ongoing

BSL 21 Points
BSL 21 Team A
C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
SOOP Univ League 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025

Upcoming

SC4ALL: Brood War
YSL S2
BSL Season 21
SLON Tour Season 2
BSL 21 Non-Korean Championship
RSL Offline Finals
WardiTV 2025
RSL Revival: Season 3
Stellar Fest
SC4ALL: StarCraft II
META Madness #9
BLAST Bounty Winter 2026: Closed Qualifier
eXTREMESLAND 2025
ESL Impact League Season 8
SL Budapest Major 2025
BLAST Rivals Fall 2025
IEM Chengdu 2025
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.