Moderator: Community Team
This is difficult to quantify because a lot of how the actions will play out depend upon the players and game situations.DoomYoshi wrote:Basically, I am going to analyze the Pokemon game quite well to ensure that it is close to balance.
Option 1 is to do everything randomly. I mean, predict that day 1s lynch is random night 1s actions are random etc.
However, mafia actions aren't random. The doctor isn't likely to protect His most likely scumster for instance. Does anyone know of an existing formula to figure out town win %?
If it came complete with SAS code, I would appreciate it. If not, I will use random ish actions.
Rule 1: mafia does not target mafia (not always true, but true often enough)
Rule 2: town does not lynch cop/doctor
Rule 3: vig doesn't kill night 1 or night 2
Rule 4: chance of mafia(scum) lynch increases every day
Rule 5: if one player targets another, then subsequent players are more likely to target that player
Then I will run a sim and see if it is roughly balanced. Any other simple rules you think I should add?

Good catch there!pmchugh wrote:I think it is worth a try. All models of reality are not going to be completely accurate but by making educated guesses you can make useful predictions. Also it allows you to see some potential gaps in the balance.
Also I think you could make two categories of roles, repeated and non. For instance a cop would not repeat his target where as a doctor is quite likely to repeat his targets because of claimed players.
Can you explain how exactly you're modelling this?pmchugh wrote:I started doing this, but don't ever bet on me finishing it
I am doing it in OO and I have a series of "GamePath"s. One to start with and one caused by every death (the complication is in multiple kill night scenes). If a faction meets its win condition then the probability of the winning faction is increased by the probability of that game path occurring. All other actions are merely used to affect the probability of someone being killed, or to affect the probabilities of another action. For instance if the doctor has a 0.25 chance of protecting player A and the mafia has a 0.25 chance of killing player A in one night then two new game paths are created:Haggis_McMutton wrote:Can you explain how exactly you're modelling this?pmchugh wrote:I started doing this, but don't ever bet on me finishing it
I've actually thought about doing this before, it might be an interesting project.
Commander9 wrote:Trust Edoc, as I know he's VERY good.
zimmah wrote:Mind like a brick.
everywhere116 wrote:You da man! Well, not really, because we're colorful ponies, but you get the idea.
So a kind of trial and error type thing then, thats easier to understand but probably not as accurate. It would be fun (in the geekiest way possible) to try use an evolutionary algorithm to perfect setups but I think that is going too farshieldgenerator7 wrote:I had a thought to make a computer model that could "play" all the roles of the game. It would go through all the days and randomyl select different players to target and to lynch, with exceptions (i.e. if cop found scum that scum would be lynched next day). Then the outcome would be the combination of the paths chosen (however many billions of them there are). ANd then the computer would run the test again with same setup and then after many iterations it would show the average amount of town wins and mafia wins and whatever faction you had.
I have the feeling the mafiascum forum has probably discussed things like this already and you could get a nice boost to your project by checking what they have already accomplished.pmchugh wrote:matlab![]()
So a kind of trial and error type thing then, thats easier to understand but probably not as accurate. It would be fun (in the geekiest way possible) to try use an evolutionary algorithm to perfect setups but I think that is going too farshieldgenerator7 wrote:I had a thought to make a computer model that could "play" all the roles of the game. It would go through all the days and randomyl select different players to target and to lynch, with exceptions (i.e. if cop found scum that scum would be lynched next day). Then the outcome would be the combination of the paths chosen (however many billions of them there are). ANd then the computer would run the test again with same setup and then after many iterations it would show the average amount of town wins and mafia wins and whatever faction you had.
Well in theory, if you know the code which plays the roles, you would have a possible outcome probability chart unless a game is not easily solveable. Simpler games could be equation-based, but more complex games would need the trial/error system. Unfortunately, the ones that you can get a nice clean equation-based output from would also be the ones that are already easiest to balance.pmchugh wrote:matlab![]()
So a kind of trial and error type thing then, thats easier to understand but probably not as accurate. It would be fun (in the geekiest way possible) to try use an evolutionary algorithm to perfect setups but I think that is going too farshieldgenerator7 wrote:I had a thought to make a computer model that could "play" all the roles of the game. It would go through all the days and randomyl select different players to target and to lynch, with exceptions (i.e. if cop found scum that scum would be lynched next day). Then the outcome would be the combination of the paths chosen (however many billions of them there are). ANd then the computer would run the test again with same setup and then after many iterations it would show the average amount of town wins and mafia wins and whatever faction you had.
Good point. That does seem to be another limitation.Rodion wrote:I think you can only do this to balance closed setups (role distribution is laid out before game starts) as you can't estimate probability of town lynches in a game whose roles are not clear.
For instance, mafia busdriver swaps two people and cop gets a guilty result on a VT. VT is lynched.
Those things could happen the next day:
a) cop claim disbelieved, cop lynched
b) cop claim believed, existence of mafia busdriver assumed
c) cop claim believed but town treats him as insane, thus they treat his following result the opposite way
d) cop claim believed but town treats him as paranoid, thus his results are outright ignored
If you can't accurately stipulate how likely town is to treat each of the mentioned outcomes, then you can't do the minimax tree.

I wouldn't call it a minimax tree, it is a tree structure but it has nothing to do with finding the best course of action or minimising your loss.Haggis_McMutton wrote:@ the game paths. If I didn't misunderstand you are talking about something like Minimax tree, keeping track of the probabilities on each branch. I think this is the best option for simple setups but I'm not sure it'll work on bigger/weirder ones. As I see it, there's 2 problems:
1. Deciding on the probabilities for non-trivial decisions. How is the roleblocker blocking the killer represented? How about the busdriver driving the victim? How do you probabilistically represent the info those actions give them?
2. Sheer computational limit. Let's take a 20 man NV game and let's say there's a mafia, SK, doctor, busdriver(so basically anyone can get killed or saved). There are 1(no one dies) + 20(one person dies) + 190(2 people die) = 211 paths for N1. Let's say the average throughout the game will be a quarter of this, a branching factor of 50 every night. If the game has 7 nights, that would put the total number of paths at 50^7 = 780 billion.
The trial and error approach seems more feasible to me too (at least if you want arbitrarily complex roles & big games). Technically I guess it would be MCMC.
However, the question is how much do you "correct" the randomness based on our knowledge of the game.
Can mafia randomly kill itself? How does the cop finding mafia affect the lynch next day? etc etc.
One option would be to make it completely random on the assumption that the dumbness of both mafia and town evens out. But that essentially makes investigative roles useless, so maybe not.
What would be REALLY cool is if we had a database of setups and outcome, that way we could evaluate (and maybe even train) any algorithms we come up with.
Goddamnit, now I'm really getting into this idea and I really don't have time for another project right now.