Here's my take on the idea:
2 red mafia, 1 blue mafia, 10 townies.
if a townie dies, red and blue get a point. A new player joins, and is assigned a role based on this formula:
x% chance of being town, where x = T/(R+B+T)
y% chance of being scum, where y = (R+B)/(R+B+T)
this is to prevent role spec based on incoming players. for example, if a townie dies and another player joins, they're confirmed town unless there is a system like this in place.
if the result is scum, they join the scum faction with the lowest number of members (so the first townie would probably join blue). If they have the same number of members, they join the faction that did NOT receive a member last time scum was added to the game (so it would alternate blue-red-blue-red) unless some scum died.
If its a tie and no scum has been added to the game yet, blue takes priority. (for example if red is lynched D1 and Town is killed N1, and the new player rolls scum, they join blue even though its a tie.)
if a scum player dies, a new player joins the game. they are assigned as town.
then, one random town player becomes scum, following the same rules for joining a faction as above.
red kills on odd nights, blue kills on even nights.
now, obviously, this system would eventually result in scum inflation, and eventually everyone would be scum if the game went on long enough. This is the main problem I have with this method, as there's no way to reduce the number of scum players without
a) confirming a player as town (if I made it so if there is too many scum, newly joined player will automatically be town)
b) force-replacing a player (if I want to implement a system where scum can become town)
can anyone think of a solution to this problem?
THIS POST IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.