Jump to content

SF Mafia Info Dump & Resources


Kaoz
 Share

Recommended Posts

  • Replies 467
  • Created
  • Last Reply

Top Posters In This Topic

Hmm this should be about enough I think... if you are interested in further discussing player specific information, I would like to ask you to make a new thread for it.

Maybe someone can think of some more attributes and we can have a player database or something.

Link to comment
Share on other sites

in future games mods need to start enforcing a "if you request a sub and don't have a good reason, then it will be denied and you will be dealt with by inactivity modkill rules" clause

Link to comment
Share on other sites

in future games mods need to start enforcing a "if you request a sub and don't have a good reason, then it will be denied and you will be dealt with by inactivity modkill rules" clause

I'd actually prefer that moderators KNOW how to deal with excessive subbing out in advance. I mean, yeah it's annoying when people sub out for no reason but that's why you guys take subs, right -- in case someone has to sub out for any reason?

Me, I already have a feeling that at least two specific players in the game I'm modding will have sketchy activity, so the first two subs I can get I'm going to GLUE to those two players.

Link to comment
Share on other sites

It becomes a problem when 25-30% of the players in a game sub out before Day 2, because oftentimes by that point games can have an upwards of 600 posts and a lot of people do not want to read through that.

Link to comment
Share on other sites

It becomes a problem when 25-30% of the players in a game sub out before Day 2, because oftentimes by that point games can have an upwards of 600 posts and a lot of people do not want to read through that.

That much is true. But I'd think that people who sign up to be subs would be following the thread just as closely as the actual participants, since they expect to be called to sub in at any time.

Link to comment
Share on other sites

When so many people sub out you have to start asking people who weren't following the game.

Ah, right. I guess that's a good point. >_<

Link to comment
Share on other sites

Took me a while to realize I posted this in the wrong place.

While this wasn't written for mafia, the techniques described are some of the things I do when scumhunting. Don't mind the URL; it's the Sophos blog, and their naming scheme is terrible.

How Fox News and mafia are related

Link to comment
Share on other sites

hey this is a cool thing

only includes glorious noc / limited oc master race though because oc might as well be a different game (somebody could make a different spreadsheet for it though). also, only contains FE4 onwards, and not Stop Crying Psych because that game is non-canon

yo, update

Link to comment
Share on other sites

  • 3 weeks later...

So the other day I was writing up some python for balance testing purposes. I think the logic is all sound, and it runs without crashes or infinite loops as far as I can find.

Currently produces results similar to

C:\Users\[user]>python mafia.py

Town Wins: 56198

Scum Wins: 43802

C:\Users\[user]>python mafia.py

Town Wins: 56198

Scum Wins: 43802

It's possible to alter for D1 Start, N0 Start, N1 Start, and obvious minor things like different town sizes. Putting in any more complicated roles than Doc, Cop, Vanillage, Vanillafia, and Miller would take a lot of alteration, but maybe I'll tinker around in the future with it.

I don't know if anybody actually cares, or if they'd want to code up their own programs. But it might be useful or some sort of inspiration.

[spoiler=mafia.py]

import re
import random
import os
import math
from operator import itemgetter

random.seed()



Village={
0:"Town",
1:"Mafia",
2:"Town",
3:"Miller",
4:"Cop",
5:"Town",
6:"Mafia",
7:"Doctor",
8:"Town",
9:"Town",
10:"Miller",
11:"Town",
}

FullVillage={}
for book in Village.keys():
FullVillage[book]=Village[book]

Village.update(FullVillage)
# myRandom=int(math.floor(random.random()*len(Village)))
# print myRandom
# print Village
# print Village[myRandom]

# while len(Village) > 1:
# myRandom=int(math.floor(random.random()*len(Village)))
# print myRandom
# Village.pop(myRandom)
# print Village

copClears=[]
graveyard=[]

# def doRandom(size=len(Village)):
# return int(math.floor(random.random()*size))
size=12
def doRandom():
global size
return int(math.floor(random.random()*size))


docOutted="False"
docDead="False"
copDead="False"
doc=7
cop=4
gameOver="False"

def NightZero():
#Cop Target
#Don't SelfScan
scanGood="False"
scan=0
while scanGood=="False":
	scan=doRandom()
	if Village[scan] == "Cop":
		pass
	else:
		scanGood="True"
copClears.append(scan)

def Day(clearlist):
global docOuted
if len(clearlist) >0:
	scan=clearlist[-1]
	if scan in graveyard:
		pass
	else:
		#Lynch Guilty Scans
		if Village[scan] == "Mafia":
			graveyard.append(scan)
			Village.pop(scan)
		elif Village[scan] == "Miller":
			graveyard.append(scan)
			Village.pop(scan)
		#Random Lynch
		else:
			lynchGood="False"
			lynchTarget=0
			while lynchGood=="False":
				lynchTarget=doRandom()
				if lynchTarget in graveyard:
					pass
				else:
					#Don't Lynch Cop
					if Village[lynchTarget] == "Cop":
						pass
					#Don't Lynch Doc
					elif Village[lynchTarget] == "Doctor":
						docOutted="True"
					else:
						lynchGood="True"
			graveyard.append(lynchTarget)
			Village.pop(lynchTarget)
#Random Lynch
else:
	lynchGood="False"
	lynchTarget=0
	while lynchGood=="False":
		lynchTarget=doRandom()
		if lynchTarget in graveyard:
			pass
		else:
			#Don't Lynch Cop
			if Village[lynchTarget] == "Cop":
				pass
			#Don't Lynch Doc
			elif Village[lynchTarget] == "Doctor":
				docOutted="True"
			else:
				lynchGood="True"
	graveyard.append(lynchTarget)
	Village.pop(lynchTarget)


def Night(clearlist):
global docOutted
global docDead
global copDead
global cop
global doc
#Cop Target
#Don't double target
if copDead == "False":
	scanGood="False"
	scan=0
	while scanGood=="False":
		scan=doRandom()
		if scan in graveyard:
			pass
		else:
			if Village[scan] == "Cop":
				pass
			if scan in clearlist:
				pass
			else:
				scanGood="True"
	copClears.append(scan)
#Doc Target
#Assume Cop is outed, Doc on Cop, Mafia not on Cop

#Mafia Target
kill=0
#If Doc Dead, kill Cop
if copDead == "False" and docDead == "True":
	kill=cop
#If Doc Outted, kill Doc
elif docDead == "False" and docOutted == "True":
	kill=doc
#Else randomkill
else:
	killGood="False"
	while killGood=="False":
		kill=doRandom()
		if doc in graveyard and docDead=="False":
			break
		if kill in graveyard:
			pass
		else:
			#Don't target Cop
			if Village[kill] == "Cop":
				pass
			#Don't target Mafia
			elif Village[kill] == "Mafia":
				pass
			else:
				killGood="True"
if Village[kill] == "Cop":
	copDead="True"
if Village[kill] == "Doctor":
	docDead="True"
graveyard.append(kill)
Village.pop(kill)


def checkWinNight():
scum=0
town=0
global gameOver
#	print Village.values()
for body in Village.values():
	if body=="Mafia":
		scum+=1
#	print len(Village)
#	print scum
town = len(Village) - scum
if scum == town:
#		print "Mafia Wins"
	gameOver="True"
	return "Scum"
elif scum == 0:
#		print "Town Wins"
	gameOver="True"
	return "Town"

def checkWinDay():
scum=0
global gameOver
for body in Village.values():
	if body=="Mafia":
		scum+=1
if scum == 0:
#		print "Town Wins"
	gameOver="True"
	return "Town"
elif scum == len(Village):
#		print "Scum Wins"
	gameOver="True"
	return "Scum"

def gameCycle():
Village.update(FullVillage)
copClears[=[]
graveyard[=[]
global docOutted
docOutted="False"
global docDead
docDead="False"
global copDead
copDead="False"
global gameOver
gameOver="False"

#NightZero()
# print copClears
# print Village[copClears[0]]

while gameOver=="False":
	Day(copClears)
	# print graveyard
	# print Village
	gameWonBy = checkWinDay()
	if gameOver=="True":
		break

	Night(copClears)
	# print copClears
	# if copClears[-1] in graveyard:
		# pass
	# else:
		# print Village[copClears[-1]]
	# print Village
	gameWonBy = checkWinNight()
#print gameWonBy
return gameWonBy

loopMax=100000
loops=0
grandscum=0
grandtown=0
while loops < loopMax:
loops+=1
outcome=gameCycle()
if outcome=="Town":
	grandtown+=1
elif outcome=="Scum":
	grandscum+=1
print "Town Wins: %s" %(grandtown)
print "Scum Wins: %s" %(grandscum)

Link to comment
Share on other sites

have you made it so lynch probabilities are altered based on cop results, so like, there's a possibility a cop will "claim" to get scum lynched and increase own likelihood as a doc/kill target? i usually factor in stuff like that when rng testing

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...