[EV] 8p Multiball

This forum is for discussion of individual Open Setups, including theoretical balance.
User avatar
shos
shos
Survivor
User avatar
User avatar
shos
Survivor
Survivor
Posts: 17862
Joined: November 28, 2011

Post Post #25 (ISO) » Mon Nov 21, 2016 4:56 am

Post by shos »

Thanks for the input. If a programmed script can find out whose chances are best, and what town strat is best, it'll be awesome.
In post 836, Lucky2u said:

Rule # 5h05: players should not attempt to use or manipulate the mod for any purpose.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #26 (ISO) » Mon Nov 21, 2016 8:51 am

Post by Infinity 324 »

Ok I wrote a program for this and am currently in the process of running it 500 times.

If anyone else also wants to run it so we have as much info as we can, that'd be great.

Also if anyone sees any problem with my code point it out. But it's not super readable so sorry :?

Spoiler: python code

Code: Select all

import random

class Player():
    def __init__(self, team, blocker):
        self.block = blocker
        self.team = team
        self.killing = False
        self.BP = False

        if self.team == "town":
            self.BP = True

    def __str__(self):
        return self.team

def main():
    wins = [0,0,0]
    n = int(input("How many times would you like it to run?\n"))
    scumA = True
    scumB = True
    
    players = initPlayers()
    done = ""
                
    for i in range(n):
        while(done == ""):

            if done == "":
                players = day(players)

            for player in players:
                print(str(player))
            print()
            
            teams = checkWinCon(players)
            done = teams[0]
            scumA = teams[1]
            scumB = teams[2]

            if done == "":
                players = night(players, scumA, scumB)

            for player in players:
                print(str(player))
            print()
            
            teams = checkWinCon(players)
            done = teams[0]
            scumA = teams[1]
            scumB = teams[2]
            
        end(done)
        
        if done == "Town":
            wins[0] += 1

        if done == "Scum A":
            wins[1] += 1

        if done == "Scum B":
            wins[2] += 1
        
        players = initPlayers()
        done = ""

    print("Town wins: " + str(wins[0]))
    print("Scum A wins: " + str(wins[1]))
    print("Scum B wins: " + str(wins[2]))

def initPlayers():
    players = []
    for i in range(4):
        players.append(Player("town", False))
        
    players.append(Player("scumA", True))
    players.append(Player("scumA", False))
    players.append(Player("scumB", True))
    players.append(Player("scumB", False))
    
    return players

def day(players):
    print("Day")
    random.seed()
    del players[random.randint(0,len(players)-1)]
    return players

def night(players, scumA, scumB):
    print("Night")
    random.seed()

    if scumA:
        killerA = findEnemy("scumA", players)
        players[killerA].killing = True

    if scumB:
        killerB = findEnemy("scumB", players)
        players[killerB].killing = True

    for player in players:
        if player.block and not player.killing:
            blocked = findEnemy(player.team, players)
            players[blocked].killing = False

    for player in players:
        if player.killing:
            target = findEnemy(player.team, players)
            players = kill(target, players)
            player.killing = False

    return players


def checkWinCon(players):
    scumA = 0
    scumB = 0
    Aexists = True
    Bexists = True

    for player in players:
        if player.team == "scumA":
            scumA += 1
        if player.team == "scumB":
            scumB += 1

    if scumA == 0:
        Aexists = False

    if scumB == 0:
        Bexists = False

    if scumA >= len(players)/2.0:
        return ["Scum A", 0, 0]

    if scumB >= len(players)/2.0:
        return ["Scum B", 0,0]

    if scumA == 0 and scumB == 0:
        print("sup")
        return ["Town", 0,0]

    return ["", Aexists, Bexists]

def end(team):
    print(team + " wins!\n")

def kill(index, players):
    if players[index].BP == True:
        players[index].BP = False
        print("checkBP")
    else:
        del players[index]
        print("checkNonBP")

    return players

def findEnemy(team, players):
    random.seed()
    enemy = Player("", False)

    while(enemy.team == team or enemy.team == ""):
        enemy = players[random.randint(0,len(players)-1)]

    return players.index(enemy)

main()
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #27 (ISO) » Mon Nov 21, 2016 8:55 am

Post by Infinity 324 »

Town wins: 343
Scum A wins: 76
Scum B wins: 81

That's pretty fucking townsided
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #28 (ISO) » Mon Nov 21, 2016 9:15 am

Post by Infinity 324 »

Town wins: 1018
Scum A wins: 254
Scum B wins: 228

Which adds up to:

Town wins: 1361
Scum A wins: 330
Scum B wins: 309

Still very townsided
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
ThinkBig
ThinkBig
Jack of All Trades
User avatar
User avatar
ThinkBig
Jack of All Trades
Jack of All Trades
Posts: 5530
Joined: September 11, 2016
Contact:

Post Post #29 (ISO) » Mon Nov 21, 2016 9:18 am

Post by ThinkBig »

What would happen if only 2 townies were 1-shot BP?
I have officially retired this account. My new account is Virtuoso.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #30 (ISO) » Mon Nov 21, 2016 9:20 am

Post by Infinity 324 »

I'll test that, but first I'm gonna test what happens at 3:2:2 and no lynch d1
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
Pine
Pine
In Your Head
User avatar
User avatar
Pine
In Your Head
In Your Head
Posts: 16763
Joined: February 27, 2011
Location: Upstate New York

Post Post #31 (ISO) » Mon Nov 21, 2016 9:21 am

Post by Pine »

Ehhh. This takes the human component out of consideration, which I'm never a big fan of. For example, I doubt it considers that shooting someone who doesn't die is effectively a cop inno on that person. I dunno, I'd hesitate to beef up scum anti-Town power much. Maybe make the goon a 1-shot Doctor?
"Cry havoc, and let slip the wombat of war!"

Act 3, Scene 1 of
Julius Caesar
, by W. Shakespeare
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #32 (ISO) » Mon Nov 21, 2016 9:23 am

Post by Infinity 324 »

In post 31, Pine wrote:Ehhh. This takes the human component out of consideration, which I'm never a big fan of. For example, I doubt it considers that shooting someone who doesn't die is effectively a cop inno on that person. I dunno, I'd hesitate to beef up scum anti-Town power much. Maybe make the goon a 1-shot Doctor?
Yeah, that's the issue with EV.

Also going to test what happens when town doesn't lynch until a scum faction is eliminated
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #33 (ISO) » Mon Nov 21, 2016 9:48 am

Post by Infinity 324 »

No lynching until 1 scum faction is gone:

Town wins: 1586
Scum A wins: 220
Scum B wins: 194

Which is, interestingly enough, an even higher win percentage than the others. Now, if scum knows town is doing that they'll try to aim at town, making the strategy pretty ineffective, but it's certainly interesting.
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
ThinkBig
ThinkBig
Jack of All Trades
User avatar
User avatar
ThinkBig
Jack of All Trades
Jack of All Trades
Posts: 5530
Joined: September 11, 2016
Contact:

Post Post #34 (ISO) » Mon Nov 21, 2016 9:49 am

Post by ThinkBig »

Should the scum team be effective at eliminating two townies, the townies that are left are essentially kingmakers. That's the problem.
I have officially retired this account. My new account is Virtuoso.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #35 (ISO) » Mon Nov 21, 2016 9:57 am

Post by Infinity 324 »

Actually, if town gets lynched in that case then scum have to shoot each other

Very weird but yeah
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
ThinkBig
ThinkBig
Jack of All Trades
User avatar
User avatar
ThinkBig
Jack of All Trades
Jack of All Trades
Posts: 5530
Joined: September 11, 2016
Contact:

Post Post #36 (ISO) » Mon Nov 21, 2016 9:59 am

Post by ThinkBig »

Really? How does that work?
I have officially retired this account. My new account is Virtuoso.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #37 (ISO) » Mon Nov 21, 2016 10:09 am

Post by Infinity 324 »

There are 2 possibilities for each scum. Either it gets shot or it doesn't. If it gets shot it loses no matter what. If it doesn't get shot, it's better off shooting the opposing scum because that gets it a win instead of a draw.

But that assumes the townie is confirmed, which isn't necessarily true. Look at this thread for in-depth explanation for that scenario and others

http://forum.mafiascum.net/viewtopic.ph ... 7&start=25

And also that reminds me, that thread would be pretty useful for determining the EV in terms of if everyone followed optimal play.
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
ThinkBig
ThinkBig
Jack of All Trades
User avatar
User avatar
ThinkBig
Jack of All Trades
Jack of All Trades
Posts: 5530
Joined: September 11, 2016
Contact:

Post Post #38 (ISO) » Mon Nov 21, 2016 10:11 am

Post by ThinkBig »

Very interesting!

If there was a town vig, he could almost act as a cop in the game. If the player doesn't die, then he's obviously town...
I have officially retired this account. My new account is Virtuoso.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #39 (ISO) » Mon Nov 21, 2016 10:18 am

Post by Infinity 324 »

It would be great if I incorporated mith's conclusions from that thread into my program, but it seems very complicated taking into account BPs
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #40 (ISO) » Mon Nov 21, 2016 10:35 am

Post by Infinity 324 »

Ooh, interesting.

3:2:2 with random lynch every day:

Town wins: 776
Scum A wins: 649
Scum B wins: 575
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
ThinkBig
ThinkBig
Jack of All Trades
User avatar
User avatar
ThinkBig
Jack of All Trades
Jack of All Trades
Posts: 5530
Joined: September 11, 2016
Contact:

Post Post #41 (ISO) » Mon Nov 21, 2016 10:37 am

Post by ThinkBig »

That is interesting! Though how can we prevent the scum teams from hammering no-lynch?
I have officially retired this account. My new account is Virtuoso.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #42 (ISO) » Mon Nov 21, 2016 10:41 am

Post by Infinity 324 »

In post 41, ThinkBig wrote:That is interesting! Though how can we prevent the scum teams from hammering no-lynch?
Hmm, good point. If all scum vote no lynch every day, or just refuse to lynch, then they can force no lynch every day.

The question is, is that worth outing themselves to the other team? Might be worth plurality lynch in the setup anyway though.
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
ThinkBig
ThinkBig
Jack of All Trades
User avatar
User avatar
ThinkBig
Jack of All Trades
Jack of All Trades
Posts: 5530
Joined: September 11, 2016
Contact:

Post Post #43 (ISO) » Mon Nov 21, 2016 10:44 am

Post by ThinkBig »

In post 42, Infinity 324 wrote:
In post 41, ThinkBig wrote:That is interesting! Though how can we prevent the scum teams from hammering no-lynch?
Hmm, good point. If all scum vote no lynch every day, or just refuse to lynch, then they can force no lynch every day.

The question is, is that worth outing themselves to the other team? Might be worth plurality lynch in the setup anyway though.
That is true...if the same people continue to vote no lynch, it could out themselves as scum
I have officially retired this account. My new account is Virtuoso.
User avatar
shos
shos
Survivor
User avatar
User avatar
shos
Survivor
Survivor
Posts: 17862
Joined: November 28, 2011

Post Post #44 (ISO) » Mon Nov 21, 2016 10:45 am

Post by shos »

how comes scum A wins less/more than scum B? :confused:
In post 836, Lucky2u said:

Rule # 5h05: players should not attempt to use or manipulate the mod for any purpose.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #45 (ISO) » Mon Nov 21, 2016 10:51 am

Post by Infinity 324 »

In post 43, ThinkBig wrote:
In post 42, Infinity 324 wrote:
In post 41, ThinkBig wrote:That is interesting! Though how can we prevent the scum teams from hammering no-lynch?
Hmm, good point. If all scum vote no lynch every day, or just refuse to lynch, then they can force no lynch every day.

The question is, is that worth outing themselves to the other team? Might be worth plurality lynch in the setup anyway though.
That is true...if the same people continue to vote no lynch, it could out themselves as scum
Especially if they don't give a reason.
In post 44, shos wrote:how comes scum A wins less/more than scum B? :confused:
It's not a real EV calculation, I'm just generating a lot of sample runs. So there's the randomness factor.
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #46 (ISO) » Mon Nov 21, 2016 11:02 am

Post by Infinity 324 »

3:2:2 with no lynch d1:

Town wins: 1500
Scum A wins: 280
Scum B wins: 220

Pretty crazy
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
shos
shos
Survivor
User avatar
User avatar
shos
Survivor
Survivor
Posts: 17862
Joined: November 28, 2011

Post Post #47 (ISO) » Mon Nov 21, 2016 11:20 am

Post by shos »

lol
I guess EV isn't quite working... because after a couple of runs, 3:2:2 was really antitown imo.....
In post 836, Lucky2u said:

Rule # 5h05: players should not attempt to use or manipulate the mod for any purpose.
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #48 (ISO) » Mon Nov 21, 2016 11:22 am

Post by Infinity 324 »

Well for lynch every day town had a well below 50% winrate.

EV just heavily favors no lynch d1 with 3:2:2 for some reason.
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
User avatar
Infinity 324
Infinity 324
they (pl.)
Survivor
User avatar
User avatar
Infinity 324
they (pl.)
Survivor
Survivor
Posts: 18337
Joined: April 7, 2013
Pronoun: they (pl.)
Contact:

Post Post #49 (ISO) » Mon Nov 21, 2016 11:23 am

Post by Infinity 324 »

The question is do you want 50% town winrate or 33% for everyone
Show
new GTKAS

<3 you are valid

plural system, we may or may not sign
Post Reply

Return to “Open Setup Discussion”