|
Automatic Balance Tester
I recently started studying computer science - and about a week ago I had the idea of automating the balancing process for creating a new setup in Mafia. I had several (pretty complicated) ideas for how to do it, but then I found this page: http://hamumu.com/forum/showthread.php?p=263954 It was a very simple, yet effective way of evaluating balance automatically.
Around that time I PM’d Foolishness for advice and suggestions about building this balance tester. He had several valuable suggestions and also helped a ton with the actual balancing.
The balance tester itself is programmed with Java so Java Runtime Environment ( http://java.com/en/download/index.jsp ) is required to use it. As long as you have JRE installed, it should work fine on any computer. A web implementation might have been slightly more user-friendly, but I have zero experience in using JavaScript so I decided to just program it with Java. A web implementation is definitely a possibility at some point, though.
So how does the balance tester work? The first window asks you to select the amount of players as a starting point (8-24) and generates a somewhat balanced default setup based on that number. It also asks if the game starts at day (default setting) or at night (giving a slight bonus to Mafia and Serial Killers). Then it opens the ”main” window where you can select from 23 different roles and add new roles to the setup, remove roles from the setup, remove all roles from the setup or switch to day/night start. The town vs anti-town balance value (+X for town, -X for anti-town) updates automatically as you make any changes. The text fields for player amount, day/night start and victory odds (%) for each team also update as you make any changes.
The balance and functionality of the program seem OK at this point, but I have no doubt that there’s still room for improvement. That’s why I thought it would be best to gather some feedback and suggestions before making an ”official” release of the program. Once released, it’s supposed to function as a helpful guideline especially for newer hosts (and why not for more experienced hosts as well!). It can’t completely replace an experienced player’s evaluation, but at least in most cases it should work just fine (and of course very fast)! It’s quite unusable for themed setups, though.
Here’s the download link. Any kind of feedback, suggestions and constructive criticism is appreciated.
https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar (EDIT: latest version)
(Currently there’s no way to adjust how much KP the Mafia have at their disposal. You can assume that Mafia KP increases logically - in a linear fashion - as the number of Mafia players increases. So 1-2 Mafia would have 1 KP, 3-4 would have 2 KP or something along those lines. It’s a bit tricky to balance Mafia KP so it should be just assumed that Mafia KP is ”fair” considering the size of the game.)
|
Neat.
A little while back, I made a post, which listed five different setups and asked people to vote on the most balanced and least balanced.
I thought it would be interesting to see what your program thought and got the following results: (I assumed the framer would be roughly equivalent to the godfather at -7)
(Town Win %/Mafia Win %) Setup A 60/40 +5 Setup B 38/62 -6 Setup C 47/52 -2 Setup D 42/57 -4 Setup E 39/52/7 -8
The funny part is that setup B was voted as the most balanced and setup C was voted as the least balanced. The numbers your program comes up with seems to suggest the exact opposite. That doesn't necessarily make either conclusion correct considering so much of this is opinion based and there really isn't a huge sample size to go by.
Just curious, how did you calculate the third party win percentages? They seem to be the most off from what I'd expect, but there probably isn't a very clean way to estimate using the +/- system.
I wouldn't really know where to start with evaluating the actual numbers, but they seem fairly reasonable. The blues might need to be scaled down a bit in comparison to the vanilla. For example, you'd obviously want 10 vanilla townies over 2 cops. The miller at -2 might be a bit much.
I did notice a small bug where the roleblocker/godfather/rolecop seem to disappear from the role list when adding the equivalent blue role, rather than update their value.
Nice job!
Edit: Opps wrong account
~ Kita ~
|
My biggest issue with this is the metric used. I do not think a simple +/-X is sufficient to measure a role. Further, I don't agree with the specific values assigned. For example, look at Town RB vs Town JK - equal balance, but JK is more valuable as a townie.
Before I go on, let me say that my measures are completely arbitrary as well.
Generally, when I am looking at balance, I break down each super-mechanic in the game into each role's effectiveness, conditions, and consequences. Here is an example from a setup I am aching to run, but haven't found the proper time yet.
Original Message From iGrok:Analysis of the following data at the bottom Abilities * Conditions ` Effectiveness - Negatives ^ Oneshot Kills in the game Alpha*```` Alpha*``^ Beta*```` Beta**`` Charlie****``^ One**``^ Two***`````^ Three**``--^ Four****``----^ Five*****```-^ Total: 2+7^ ************************* 25 (+14 for ^) ```````````````````````````` 28 ------- 7 Avg: 2.8* (4.3*^), 3.1`, 0.8- Alpha 9* 14` 2^ Numeric 16* 14` 7- 5^ Defenses in the game Alpha`````^ Six`````^ Seven**```- Eight**``` Total: 2+2^ **** 4 (+4 for ^) ``````````````` 15 - 1 Avg: 1* (2*^), 3.75`, 0.25- Alpha 0* 5` 1^ Numeric 4* 11` 1- 1^
Lynch manipulation Alpha*``- Beta*``- Charlie**`` One****`- Two***-- Three*``` Four*`` Five` Six**--- Seven*```` Total: 8 *************** 15 ````````````````` 17 -------- 8 Avg: 1.9*, 2.1`, 1.0- Alpha 4* 6` 2- Numeric 12* 11` 6-
Information Charlie*````-- One***```` Two``` Three*``` Total: 4 ***** 5 `````````````` 14 ------ 6 Avg: 1.3*, 3.5`, 0.5- Alpha 1* 4` 2- Numeric 4* 10`
So, what does this show? Lets look at the averages. Kills are the most common ability. However, they are also the most conditional abilities there are. If you include oneshot as +**, you're looking at a ridiculous 4.3 average conditional score on kills. Defenses, on the other hand, are the most effective abilities in the game, especially when matched against their conditions. This should balance out the high number of kills. Lynch-manipulation is one of the most balanced ability types, though to be fair this one is the most difficult to score. The key here is that it has the highest -/` ratio, meaning that these abilities are tradeoffs. Combined with the anti-vote mechanic, and lynches likely will nolynch often, revealing only a bit of information regarding estimated Combat Powers. And finally, Information abilities have (as they should) the highest `/* and `/- ratios
This message is one I sent to GMarshal a while back for a game with two teams: Alpha and Numeric. The setup is designed to be extremely violent, and has a lot of odd roles and mechanics, but analyzing the components of each role gives me a much better vision of the balance of the setup.
As far as the program goes, it looks like a good start! I don't understand why the Day/Night start option window pops up first, seems like that could just be taken care of in the main window. Also, if you're looking to develop this further, being able to save/load setups from the clipboard (assuming of course that they are properly formatted) would be nice!
|
On December 01 2013 02:30 Xatalos wrote:Automatic Balance TesterI recently started studying computer science - and about a week ago I had the idea of automating the balancing process for creating a new setup in Mafia. I had several (pretty complicated) ideas for how to do it, but then I found this page: http://hamumu.com/forum/showthread.php?p=263954 It was a very simple, yet effective way of evaluating balance automatically.
I not so recently studied computer science. I also studied some other stuff related to the scoring algorithm.
While these are comments, on the program(actually just on the web page you started with) The program does what it does. If people use it to do what it doesn't, it wont help. If they use it for what it does, it will help. I know that sounds cryptic and nonsense, but what it means is that the scoring model is of some merit in assessing balance, but it will have its limitations. (Time and tweaking will improve that up to some limit.) It will if the weight numbers are right at least get you in the ball park with balance. It will have merit as a tool.
It, your program, may have limitations.
NOT having yet looked at the app but just the page linked.
+ Show Spoiler + I expect there will be corner cases and interaction effects.
One that comes to mind is doc that can repeatedly protect and cops generate "follow the cop" Whereas as repeat docs without cops just/merely make the best analyst unkillable, which may be worse or better for scum depending on the particular analyst.
Whether or not the existence of both (repeat docs + cops) in the game breaks the game and how often it does, in part depends whether the roles are open or closed set-up.
Irrespective its a good start and a good idea.
Even if nothing else a tool that inexperienced players can get feel for balance with is useful. I know I spent some time playing with what the various C9 and etc setups meant for balance. When my head vs standard wisdom, disagreed with what setups were balanced i knew I needed to think some more.
|
Thanks for the feedback! Actually I forgot to add Framer so that's probably in the next version.
That's an interesting comparison. I looked at the poll results and the following comments, and it seemed like several people had different opinions. On average, though, it seemed like B and D were considered the most balanced and A, C and E the least balanced setups.
Setups A and E are similarly unbalanced according to both sources so that's probably the case. Setup D is a bit more appreciated among the polls than in the program, but it's not that big of a difference. On the other hand, funnily enough, the winner of the "least balanced" poll (setup C) is actually the MOST balanced setup according to this calculation. And the winner of the "most balanced" poll (setup B) is actually the LEAST balanced setup......
I guess I can try explaining why there might be this big of a difference. I and Foolishness compared different all VT / all Goon setups as the "basis" of this balance tester. According to those comparisons, one Goon is roughly worth 4-5 VT's. We ended up with 5 for now. In that sense, it seems pretty logical that 9 VT's vs 3 Goons is pretty unbalanced. Although if we ended up with -4 as the value for a Goon, setup B would be pretty close to balanced.
It's a tough call. I'd certainly like more feedback on if Goon should be -4 or -5. I see you thought that setup B was fairly unbalanced in favor of Mafia, right, Kita? So do you think the current value is OK or should it be adjusted?
It's interesting that setup C was generally thought to be so unbalanced while the program considered it as the most balanced setup. I'd definitely want to see some more opinions on this! The Cop+Doctor combo is certainly powerful, but then again, this goes back to setup B. If we consider that 9 VT's vs 3 Goons is pretty unbalanced in favor of Mafia, then 6 VT's & 3 blues vs 3 Mafia (including power roles) should theoretically be pretty close to balanced. But if we consider that 9 VT's vs 3 Goons is pretty close to balanced, then 6 VT's 3 blues vs 3 Mafia would be pretty town-favored.
This all goes back to if Goon should be -4 or -5 again. If it's -4, then B would be pretty balanced and C pretty unbalanced in favor of town (just as the polls suggested). If it's -5, then B is pretty unbalanced in favor of Mafia and C is pretty close to balanced (which is against the poll results, but I'm not completely sure it's incorrect even so). More opinions please! 
The balance of the neutral roles is certainly the most untrustworthy right now. I don't think we even went through ANY setups including neutral roles with Foolishness. The values are all pretty much untested and came from "thin air", so to say. On the other hand, neutral roles are relatively rare in TL Mafia, so it's harder to have an educated opinion on them. It'd be very helpful if someone had a solid opinion on how to balance neutral roles properly.
Assassin win percentage is calculated as simply 1 / (the amount of Assassins) - since one Assassin always wins the game, no more, no less. Survivor is always 25%, which is pretty much conjured from thin air (not sure how to calculate it well?). Anti-town Survivor is (Mafia's victory odds / 3) / (the victory odds of town + Mafia + SK) since he only wins with Mafia but is less likely to win than Mafia. Serial Killer is simply (SK balance score / the amount of SK's) / (the balance scores of town + Mafia + all SK's).
Actually the blues are already scaled down compared to the original source ( http://hamumu.com/forum/showthread.php?p=263954 ). It's possible that they need to be tuned down even more, but I'm not sure about that yet. Should Cop maybe be +4 for example?
Ah yes, adding roles is working a bit weirdly in some scenarios. Currently if there are conditional values, and the condition for that role changes, it just removes the role from your choices. I can try making it to change the value instead of removing the whole role.
That's a good start but more feedback is definitely needed!
|
Oh, more posts were posted as I was typing... That was in response to Kita. I have to go now but I'll be answering ASAP.
|
AxleGreaser: oh, a fellow (former?) computer science student! I look forward to your opinion on the program.
iGrok: that's some pretty advanced methodology for balancing! I'll have to think of maybe remaking the whole balancing process with your method, although I think simplicity also has its benefits. Your method definitely takes role interactions better into account than simple +/- balancing.
Yeah, I guess it's unnecessary to ask for day/night start twice. I'll also have to consider adding some setup-saving support.
|
On December 01 2013 21:39 Xatalos wrote:AxleGreaser: oh, a fellow (former?) computer science student!  I look forward to your opinion on the program. iGrok: that's some pretty advanced methodology for balancing! I'll have to think of maybe remaking the whole balancing process with your method, although I think simplicity also has its benefits. Your method definitely takes role interactions better into account than simple +/- balancing. Yeah, I guess it's unnecessary to ask for day/night start twice. I'll also have to consider adding some setup-saving support. Setup-Saving doesn't even have to be done in-program, being able to load from the clipboard would be fine like Cockatrice does, we could have a library in this thread.
|
So iGrok, do you mean like that there would be a button along the lines of "Copy to Clipboard" that would just copy the current chosen roles list to your clipboard? That seems relatively simple to do.
I also looked at your method (not very in-depth yet) and I think it's well worth considering to break the roles into components and evaluate these components rather than specific roles. It would be easier to balance the different interactions and combos if you just consider a few components rather than 20+ roles. Currently there's some conditional balancing (for example Miller's negative effect only affects balance if there's a Cop - actually it should also trigger from Parity Cop I guess! - and Mafia Roleblocker only gains extra value from Goon if town has a blue role - but nothing to the extent of your method).
On the other hand, it gets a bit more complicated than the simple +/- system. I'll have to test this method as well to see how efficiently it can be automated. In the end, if it's more accurate (which I think it probably could be), it should indeed be used instead.
It's a bigger rework of the balancing system, though, so I think I'm first focusing on improving the current system and the overall usability of the program. But it seems likely that a component/interaction-based method would work better than the current method if there are several blue roles.
|
Ah ok, I see you meant copy FROM clipboard. Although both could be useful, I guess.
|
Yeah I meant to/from.
I think what you have is a good basic balance program. More refined methods can be subbed in later once you have the basic framework down.
|
Okay, I just implemented quite a bit of new stuff. Only iGrok's suggestion for a new method to balance the roles has yet to be implemented, but I'll probably be doing some testing on that method in the near future.
Here are the complete "patch notes":
- Changed Cop’s value to +4 (reasoning: as Kita mentioned, +5 does seem slightly excessive, but this is by no means final)
- Changed the basic value of all Mafia to -4 and adjusted Mafia power roles accordingly (reasoning: makes Kita's poll results match quite closely with the balancing results of this program - and overall seems slightly more appropriate, but again, this is by no means final)
- Removed the unnecessary day/night start choice from the starting window (reasoning: not much to say about this)
- Added a new role: Mafia Framer (-4/-6) (depending on if town has a Cop / Parity Cop or not) (reasoning: a pretty common role that should be in this balance tester)
- Added a new feature: import & export a setup from clipboard (reasoning: as iGrok suggested, this makes it possible to easily save tested setups and to test setups that have been saved for future reference)
- Fixed the bug that Kita mentioned in his feedback (reasoning: the less bugs the better)
Here is a download link to the new version of the balance tester:
https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar
Thanks for the very helpful feedback so far!
|
iGrok:
1) Is the current clipboard functionality working as you intended?
2) Any other good features that should be added?
3) Overall, how well do you think the current balance system performs? Are there balancing results or role values that you'd disagree with?
4) I see you disagreed with RB and JK having the same value. I agree that JK's power is more versatile, but doesn't it also have the potential drawbacks of saving a Mafia or roleblocking a blue role? Of course RB can also roleblock a blue role, but it seems more likely in JK's case (since JK would be more likely targeting a pro-town player). Maybe JK should still be higher though. RB +2, JK +3?
5) Could you maybe explain your balancing method a bit more? I'm not sure if I completely understand it yet.
Kita:
1) How do you like the current balance values (for example in comparison to your poll results)?
2) Especially, do you think Mafia's basic value should be -4 or -5?
3) What specifically was wrong with the neutral roles? How should they be changed?
|
|
Note i am pretty sure i am not helping with this, so you may be wise to ignore it. At the very least mainly ignore it for now.
On December 01 2013 20:55 Xatalos wrote: It's a tough call. I'd certainly like more feedback on if Goon should be -4 or -5. I see you thought that setup B was fairly unbalanced in favor of Mafia, right, Kita? So do you think the current value is OK or should it be adjusted?
Id think (know) folishness and Igrok know about balance. and the below is motherhood stuff Thus the existence of the above question is a confusion for me as I just see answers not questions. perhaps its because I have the other skillz.
TBMK. (GIVEN 1 NK per night not rounded(SCUM/2) ) A basic All vanilla setup that closeish to balanced.
is 9 players (7 Town 2 scum) 13 players (10 town 3 scum)
Ref POINT 1 (see below)
The reason is, you get one mislynch for each lynch. At this point or shortly after that TBMK breaks.
17 players (13 town 4 scum) is I believe thought to be hard on scum at 1 kp per night.
My mathematical modelling spidy senses tell me that is for a few reasons.
Firstly elapsed days matter: Which ever scum is trying to survive to the last day has too much trouble keeping all their ducks(lies) in a row for that long. Hence 1 for 1 mislynches and lynches does not go on forever. Secondly, as each scum flips there are more and more scum scum interactions that can look wonky.
Apart from knowing what is valid by real world experience and simply modelling/fitting that with a function I am not sure there is much chance of guessing theoretically what the effects of Firstly and Secondly are.
AT Ref POINT 1 a plauible mathematical algorithm is to decide each goon is worth -4 and the FIRST VT is worth zero as you must survive with 1. ( ) and each subsequent VT is worth 1. (or each VT is worth 1 but game set-ups start set at -1 scum favoured)
Note How valuable a doctor is in terms of VTs is not likely at all to be a fixed number. (for larger games) TBMK 12 player setups with Doc are kinda balanced. BUT adding a doc to an 8 player setup will make a different amount of difference. (I think less)
The reason is the number of days on which the Doc may save a player is lower in an 8 game than a 12. However the odds that a doc will make it to 3 man LYLO and claim (maybe eliminating the patsy...) is lower.
While your question asks for an integer value for a goon, decimal fractions are not fatal.
Neither is it implausible to just use a Lookup Table that specifies for Each sized Town How many goons it should have.
Eg Town size 12 is 3 goons but is +1 goon favoured. Eg Town size 13 is 3 goons but is +0 goon favoured. Eg Town size 14 is 3 goons but is -1 goon favoured. ... but it might not quite follow that pattern later as the above discussion on larger games indicates.
There are yet other even finer distinctions.
Eg Town size 13 is 3 goons but is +0 goon favoured. This game if it goes according to PAR and ends at a 3 man lylo, at one time it had (2 scum nks for each town mislynch & scum lynch.) x 2 thus it gets to 5 townies 1 scum. At that point there have been 4 scum controlled towny deaths and 2 town controlled ones. Scum has twice as much control over whether skilled and keen to play townies wind up making the next decision.
Eg Town size 12 (1 doc) is 3 goons but is probably also about +0 goon favoured. This game if it goes according to PAR and ends at a 3 man lylo, at one time it had (2 scum nks for each town mislynch & scum lynch.) x 2 (-1 town nk if the doc saves 1 and is thus on par) gets to 5 townies 1 scum. At that point there have been 3 scum controlled towny deaths and 2 town controlled ones. Scum has less than twice as much control over whether skilled and keen to play townies wind up making the next decision.
|
On December 02 2013 20:18 iGrok wrote:Hmmm....
Heh Well, the point is to generate a default setup based on the amount of players. It's intended as kind of a starting point. If you wish to start from scratch, you can easily just click "Remove All Roles". I tried making it bigger, but I think it looks best as a small box. The JComboBox (where you select the amount of players) looks pretty stupid if it spreads to a larger area.
Okay, I'll demote RB in the next version.
That's a good idea to consider; showing the roles as "X x Role" makes the interface a bit cleaner. That might even be in the next version - we'll see how it works out.
I'll have to think about that editing option. It seems pretty hard to implement with the way my interface functions currently, so it'd require some major reworking.
Okay, good that the clipboard works. I wasn't exactly sure how Java handles clipboards of different operating systems.
By the way, could you explain your balancing system with a bit more detail? Maybe with examples from the roles I have in the program? I wouldn't want to implement the system and then realize that it's completely wrong
|
On December 02 2013 21:03 AxleGreaser wrote:Note i am pretty sure i am not helping with this, so you may be wise to ignore it. At the very least mainly ignore it for now. Show nested quote +On December 01 2013 20:55 Xatalos wrote: It's a tough call. I'd certainly like more feedback on if Goon should be -4 or -5. I see you thought that setup B was fairly unbalanced in favor of Mafia, right, Kita? So do you think the current value is OK or should it be adjusted?
Id think (know) folishness and Igrok know about balance. and the below is motherhood stuff Thus the existence of the above question is a confusion for me as I just see answers not questions. perhaps its because I have the other skillz. TBMK. (GIVEN 1 NK per night not rounded(SCUM/2) ) A basic All vanilla setup that closeish to balanced. is 9 players (7 Town 2 scum) 13 players (10 town 3 scum) Ref POINT 1 (see below) The reason is, you get one mislynch for each lynch. At this point or shortly after that TBMK breaks. 17 players (13 town 4 scum) is I believe thought to be hard on scum at 1 kp per night. My mathematical modelling spidy senses tell me that is for a few reasons. Firstly elapsed days matter: Which ever scum is trying to survive to the last day has too much trouble keeping all their ducks(lies) in a row for that long. Hence 1 for 1 mislynches and lynches does not go on forever. Secondly, as each scum flips there are more and more scum scum interactions that can look wonky. Apart from knowing what is valid by real world experience and simply modelling/fitting that with a function I am not sure there is much chance of guessing theoretically what the effects of Firstly and Secondly are.
AT Ref POINT 1 a plauible mathematical algorithm is to decide each goon is worth -4 and the FIRST VT is worth zero as you must survive with 1. (  ) and each subsequent VT is worth 1.(or each VT is worth 1 but game set-ups start set at -1 scum favoured) Note How valuable a doctor is in terms of VTs is not likely at all to be a fixed number. (for larger games) TBMK 12 player setups with Doc are kinda balanced. BUT adding a doc to an 8 player setup will make a different amount of difference. (I think less) The reason is the number of days on which the Doc may save a player is lower in an 8 game than a 12. However the odds that a doc will make it to 3 man LYLO and claim (maybe eliminating the patsy...) is lower. While your question asks for an integer value for a goon, decimal fractions are not fatal. Neither is it implausible to just use a Lookup Table that specifies for Each sized Town How many goons it should have. Eg Town size 12 is 3 goons but is +1 goon favoured. Eg Town size 13 is 3 goons but is +0 goon favoured. Eg Town size 14 is 3 goons but is -1 goon favoured. ... but it might not quite follow that pattern later as the above discussion on larger games indicates.
There are yet other even finer distinctions. Eg Town size 13 is 3 goons but is +0 goon favoured. This game if it goes according to PAR and ends at a 3 man lylo, at one time it had (2 scum nks for each town mislynch & scum lynch.) x 2 thus it gets to 5 townies 1 scum. At that point there have been 4 scum controlled towny deaths and 2 town controlled ones. Scum has twice as much control over whether skilled and keen to play townies wind up making the next decision. Eg Town size 12 (1 doc) is 3 goons but is probably also about +0 goon favoured. This game if it goes according to PAR and ends at a 3 man lylo, at one time it had (2 scum nks for each town mislynch & scum lynch.) x 2 (-1 town nk if the doc saves 1 and is thus on par) gets to 5 townies 1 scum. At that point there have been 3 scum controlled towny deaths and 2 town controlled ones. Scum has less than twice as much control over whether skilled and keen to play townies wind up making the next decision.
Actually, the program already basically takes into account if Mafia auto-wins (if there are more or as many Mafia as there are town, Mafia victory odds are 100% and town victory odds are 0%). The same happens if it's night start, but town just requires one more player not to auto-lose. Although currently there's no way to account for the scenario where Mafia KP is 2+ and it's night start (where Mafia might auto-win even if the program shows that town has a chance). But, in the end, it's pretty simple to see for yourself if Mafia would auto-win - and a setup where Mafia would auto-win would probably show as pretty unbalanced in favor of Mafia anyways.
That's an interesting point about how adding an even/odd amount of players for town has a different level of impact. I actually read about this on Wikipedia the other day:
"Moreover, it was shown that the parity of the initial number of players plays an important role. In particular, when the number of mafiosi is fixed and an odd player is added to the game (and ties are resolved by coin flips), the mafia-winning chance do not drop but rise by a factor of approx. \sqrt{\pi/2} (equality in the limit of the infinite number of players)."
That might be a bit complicated to include in the balance tester, but probably not anyhow impossible...
Well, it's good that all sorts of matters are considered. The current system is very simple and easy to understand (so that the user can immediately understand how making different changes affects the balance), but it's definitely not 100% accurate. Then again, I'm not sure if any system can be...
It's definitely worthwhile to improve the accuracy of the program, though, so that it can be useful to more experienced users. On the other hand, I don't really want to make it too complicated. Well, there's no hurry to get it finished, I guess
|
I just made a small update to the balance tester:
- Reduced the value of Roleblocker to +2 - Altered some victory odds calculations for neutral roles - A couple of small bug fixes
Version #3 can be downloaded here:
https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar
iGrok's suggestions for reworking the balancing method and the user interface are going to be explored a bit later on (most likely at least), but I didn't have enough time today to even begin implementing those things.
Meanwhile, I'd appreciate more suggestions! Especially suggestions that are relatively easy to implement but still can have a considerable effect
|
This has my utmost thanks coming your way. When I finally earn the ability to host, this will be very valuable to me! I appreciate your work even not having used it yet! :D
Would this be able to account for nonstandard mechanics or is that like trying to determine the load characteristics of a one of a kind experimental aircraft?
|
I highly doubt non-traditional mechanics can be balanced like this. Hell, it's almost impossible to balance them by hand.
|
On December 03 2013 04:42 Alakaslam wrote: This has my utmost thanks coming your way. When I finally earn the ability to host, this will be very valuable to me! I appreciate your work even not having used it yet! :D
Would this be able to account for nonstandard mechanics or is that like trying to determine the load characteristics of a one of a kind experimental aircraft?
Nice to hear It's certainly meant for experimenting with different (somewhat) normal setups. So for example, if you had vague ideas or even concrete plans for different setups, you could use it as a guideline for what's relatively balanced and what's not. It's not exact science, but it should give a good general picture of balance.
Unfortunately, it's pretty hard (or impossible?) to use this kind of balancing tool for themed setups. As you can see, even the most basic roles require tons of evaluation and testing before being decently balanced. It'd be an unreliable shot in the dark to try automatically balancing setups without necessary basic information beforehand. Maybe some kind of a learning algorithm or a very complicated algorithm with all possible situations pre-programmed could do it, but that seems like pretty much a pipe dream
|
On December 03 2013 04:49 Mid or Feed wrote: I highly doubt non-traditional mechanics can be balanced like this. Hell, it's almost impossible to balance them by hand.
Yeah, pretty much 
By the way, what do you think of the current balance values (in comparison to your poll results and otherwise)?
Can you elaborate on your opinion of the neutral roles? I agree that they're in the worst position of the balance tester, but it's pretty hard to balance them... So any help is good
|
Cool.
I am more a flavah dude than a new roles dude but I can try and do both.
Mah flavah games will be usin' your tools
|
I probably won't have time to detail my system more until this weekend.
As far as values go, right now they seem decent to me. If you can't decide if goon is 4 or 5, make it 4.5 - don't limit yourself to integers for no reason.
|
On December 03 2013 20:33 iGrok wrote: I probably won't have time to detail my system more until this weekend.
As far as values go, right now they seem decent to me. If you can't decide if goon is 4 or 5, make it 4.5 - don't limit yourself to integers for no reason.
Okay, I'll be busy until the weekend anyways 
Actually, according to Foolishness, one Goon is worth approximately 4,25 VT's. I guess it might be better to start using decimals (or maybe just larger integers) to be slightly more accurate. The original idea was to have VT as the "base value" and derive everything else from that, but that isn't really necessary, in the end.
Yeah, I think it's overall better to just be more accurate with the balance values. It makes it harder to get to 0 ("perfect") balance, but if that "perfect" balance is not perfectly accurate, then it's more like an illusion of perfect balance
|
kitaman27
United States9244 Posts
On December 03 2013 04:59 Xatalos wrote:Show nested quote +On December 03 2013 04:49 Mid or Feed wrote: I highly doubt non-traditional mechanics can be balanced like this. Hell, it's almost impossible to balance them by hand. Yeah, pretty much  By the way, what do you think of the current balance values (in comparison to your poll results and otherwise)? Can you elaborate on your opinion of the neutral roles? I agree that they're in the worst position of the balance tester, but it's pretty hard to balance them... So any help is good 
I wouldn't be too concerned about matching the poll results since I don't necessarily agree with them. A good basis would probably be commonly accepted mini-game setups like 2of4 or C9++, although even those have issues.
Here is my general thought process with balancing a serial killer. I'm sure I'm overlooking several factors and a lot of it is guesswork. It's tricky to define what a serial killer is, since it varies so often from game to game. Are they bulletproof or 1-shot bulletproof. Do they have 1 bullet or unlimited shots? Can a roleblocker block their kp? Are they compulsive? Is the setup open? How are win conditions handled at endgame? A serial killer's victory odds is probably going to be impacted more on these factors, rather than the setup itself, aside from the number of players.
Lets look at a possible C9++ setup. Suppose there are 13 players: 3 mafia, 9 town, 1 SK (Unlimited shot)
Serial Killer needs to reach night at 2v1 before they are lynched or mafia gains majority during the day.
Assuming there a no blue roles (a flawed assumption), the game is likely ending on night four. Even with blues, a n4 or d5 endgame is most likely.
d1: 13 n1: 12 d2: 10 n2: 9 d3: 7 n3: 6 d4: 4 n4: 3
Random lynching during these four cycles results in 1/13 + 1/10 + 1/7 + 1/4 = 57% odds of the serial killer surviving to n4.
The lynches aren't going to be completely random due to mafia influence and the serial killer's ability to shoot threats at night. I'd think the survival percentage would be a bit less than random taking these two factors into account, but you could argue the other way. Either way, lets call this change in win percentage X.
There is a small possibility that the mafia team reaches day four at 3-0-1 or slightly higher possibility at 2-1-1. This is also going to decrease the survival percentage by a small amount. Lets call this Y.
We also have blues to consider. I'm not putting much thought into this part, but overall I'd think it's safe to conclude this would also decrease the serial killer's chances. Lets call this Z.
Assuming the serial killer is bulletproof, we have their win percentage as .57 - X - Y - Z
However, the c9++ serial killer is only 1-shot bulletproof.
If the mafia team shoots the serial killer on n1, n2, or n3 and is able to identify their target as the serial killer (not automatic, but likely), they will kill the serial killer on n4, before the SK is able to achieve victory.
I'm probably doing some fuzzy math, but shooting it random would be around 40%.
We would now be at .17 - X - Y - Z.
In theory, you want to create a setup where third party roles to have a chance of winning equal to the mafia or town factions. However, I'm not sure if this is ever very realistic. Obviously, .17 - X - Y - Z is going to be nowhere near the 33% we were hoping to achieve in the balancing stage, yet this is still considered one of the better setups, which shows how difficult balancing a setup really is.
Is it possible to apply a decent estimation to the value of X, Y, and Z that we can be confident about? Probably not.
Looking at Third Party win percentages at completed games might be your best bet, but the sample size is far too low and there are too many other external factors to consider.
As for a neutral survivor, looking at their odds of surviving the lynch and night shots at random is flawed because they can simply claim survivor at the beginning of the game. This won't always result in a victory, but it's tough to estimate a victory percentage, other than looking at completed games. Maybe I could take a look at the database of tl games to see how successful they have been in the past, since they are probably less reliant on setup.
|
On December 04 2013 06:44 kitaman27 wrote:Show nested quote +On December 03 2013 04:59 Xatalos wrote:On December 03 2013 04:49 Mid or Feed wrote: I highly doubt non-traditional mechanics can be balanced like this. Hell, it's almost impossible to balance them by hand. Yeah, pretty much  By the way, what do you think of the current balance values (in comparison to your poll results and otherwise)? Can you elaborate on your opinion of the neutral roles? I agree that they're in the worst position of the balance tester, but it's pretty hard to balance them... So any help is good  I wouldn't be too concerned about matching the poll results since I don't necessarily agree with them. A good basis would probably be commonly accepted mini-game setups like 2of4 or C9++, although even those have issues. Here is my general thought process with balancing a serial killer. I'm sure I'm overlooking several factors and a lot of it is guesswork. It's tricky to define what a serial killer is, since it varies so often from game to game. Are they bulletproof or 1-shot bulletproof. Do they have 1 bullet or unlimited shots? Can a roleblocker block their kp? Are they compulsive? Is the setup open? How are win conditions handled at endgame? A serial killer's victory odds is probably going to be impacted more on these factors, rather than the setup itself, aside from the number of players. Lets look at a possible C9++ setup. Suppose there are 13 players: 3 mafia, 9 town, 1 SK (Unlimited shot) Serial Killer needs to reach night at 2v1 before they are lynched or mafia gains majority during the day. Assuming there a no blue roles (a flawed assumption), the game is likely ending on night four. Even with blues, a n4 or d5 endgame is most likely. d1: 13 n1: 12 d2: 10 n2: 9 d3: 7 n3: 6 d4: 4 n4: 3 Random lynching during these four cycles results in 1/13 + 1/10 + 1/7 + 1/4 = 57% odds of the serial killer surviving to n4. The lynches aren't going to be completely random due to mafia influence and the serial killer's ability to shoot threats at night. I'd think the survival percentage would be a bit less than random taking these two factors into account, but you could argue the other way. Either way, lets call this change in win percentage X. There is a small possibility that the mafia team reaches day four at 3-0-1 or slightly higher possibility at 2-1-1. This is also going to decrease the survival percentage by a small amount. Lets call this Y. We also have blues to consider. I'm not putting much thought into this part, but overall I'd think it's safe to conclude this would also decrease the serial killer's chances. Lets call this Z. Assuming the serial killer is bulletproof, we have their win percentage as .57 - X - Y - Z However, the c9++ serial killer is only 1-shot bulletproof. If the mafia team shoots the serial killer on n1, n2, or n3 and is able to identify their target as the serial killer (not automatic, but likely), they will kill the serial killer on n4, before the SK is able to achieve victory. I'm probably doing some fuzzy math, but shooting it random would be around 40%. We would now be at .17 - X - Y - Z. In theory, you want to create a setup where third party roles to have a chance of winning equal to the mafia or town factions. However, I'm not sure if this is ever very realistic. Obviously, .17 - X - Y - Z is going to be nowhere near the 33% we were hoping to achieve in the balancing stage, yet this is still considered one of the better setups, which shows how difficult balancing a setup really is. Is it possible to apply a decent estimation to the value of X, Y, and Z that we can be confident about? Probably not. Looking at Third Party win percentages at completed games might be your best bet, but the sample size is far too low and there are too many other external factors to consider. As for a neutral survivor, looking at their odds of surviving the lynch and night shots at random is flawed because they can simply claim survivor at the beginning of the game. This won't always result in a victory, but it's tough to estimate a victory percentage, other than looking at completed games. Maybe I could take a look at the database of tl games to see how successful they have been in the past, since they are probably less reliant on setup.
Well, that's some detailed analysis!
I think you'd have to assume that SK is probably not a likely NK target (pro-town etc.) which would lessen the chances of him being NK'd. Even if Mafia thought that someone was SK, it would probably not be wise to shoot him...
1) Enemy of my enemy is my friend - town is the worse enemy for Mafia than SK (at least for the early game) 2) There's a considerable chance that SK might be bulletproof (at least in common TL setups where he can choose check-immunity or NK-immunity) - making it more lucrative to get the SK lynched instead of NK'd 3) Even if he does get NK'd, he could be bulletproof
All in all, I think the threat of being NK'd is considerably lower for SK than for town (on average).
I took a look at your Mafia database and here's the win count per alignment (non-newbie games):
Mafia 108 (52%) Third Party 19 (9%) Town 79 (38%)
Doesn't seem exactly balanced :O
The very low chances of 3rd parties are probably also affected by the fact that not every game even has 3rd parties. Still, I think it's safe to say that if you're playing as a 3rd party, you're playing at a disadvantage (on average).
I'm quite surprised to see that Mafia dominates so hard, though. I wonder if the TL setups are generally Mafia-favored or if the players are generally better at playing Mafia than town. I guess it could be a combination of both.
In the end, I think predicting the victory odds for neutral roles is very hard - probably a rough estimate would be enough. I'm more focused on town vs Mafia at the moment.
If you had to give a rough estimate, what kind of a victory percentage would you give for each of the neutral roles?
Also, here's the math on how I currently calculate the neutral role victory odds (pretty flawed probably ). I guess you'd be interested to comment on that.
if (team == 2) { // 2 = Serial Killer if (skRoles.size() == 0) { return 0; // if there are no SK's = zero chance to win } if (mafiaRoles.size() >= townRoles.size() + skRoles.size()) { return 0; // if there are more Mafia than town + SK's combined = automatic loss for SK } return (double) (skScore / skRoles.size()) / allScore; // otherwise SK's victory odds are basically the balance value of a single SK divided by the balance value of all // town, Mafia and SK's combined }
if (team == 3) { if (survivorRoles.size() == 0) { return 0; } if (!chosenRoles.contains(getSpecificRole(21))) { return 0; } if (mafiaRoles.size() >= townRoles.size() + skRoles.size()) { return 1; } return (double) (townScore + mafiaScore) / allScore / 4; // Survivor's victory odds are generally the victory odds of (town + Mafia) / 4 }
if (team == 4) { if (antitownSurvivorRoles.size() == 0) { return 0; } if (mafiaRoles.size() == 0) { return (double) mafiaScore / allScore; } if (!chosenRoles.contains(getSpecificRole(22))) { return 0; } if (mafiaRoles.size() >= townRoles.size() + skRoles.size()) { return 1; } if (mafiaRoles.size() + 1 >= townRoles.size() + skRoles.size() && dayStart == false) { return 1; } return (double) (mafiaScore / 2) / allScore; // for Anti-town Survivor it's the victory odds of Mafia / 2 }
if (team == 5) { if (assassinRoles.size() == 0) { return 0; } if (assassinRoles.size() == 1) { return 1; } return 1 / (double) assassinRoles.size(); // for Assassin it's simply 1 / the amount of Assassins
}
|
As a sidenote... There's been a typo and one of my games is under "Xalatos" (lol) in the game database...
|
kitaman27
United States9244 Posts
On December 04 2013 07:39 Xatalos wrote: Well, that's some detailed analysis!
I think you'd have to assume that SK is probably not a likely NK target (pro-town etc.) which would lessen the chances of him being NK'd. Even if Mafia thought that someone was SK, it would probably not be wise to shoot him...
1) Enemy of my enemy is my friend - town is the worse enemy for Mafia than SK (at least for the early game) 2) There's a considerable chance that SK might be bulletproof (at least in common TL setups where he can choose check-immunity or NK-immunity) - making it more lucrative to get the SK lynched instead of NK'd 3) Even if he does get NK'd, he could be bulletproof
All in all, I think the threat of being NK'd is considerably lower for SK than for town (on average).
Identifying the serial killer can be fairly difficult at times. If the mafia team does manage to develop correct suspicions that a player is the SK, the NK odds may go down, but then you have to account for the increased lynch odds since they would become the priority lynch target.
As mafia, I'd always consider the serial killer a greater threat than individual town members, even during the early game, though that's just my personal opinion.
On December 04 2013 07:39 Xatalos wrote: I took a look at your Mafia database and here's the win count per alignment (non-newbie games):
Mafia 108 (52%) Third Party 19 (9%) Town 79 (38%)
Doesn't seem exactly balanced :O
The very low chances of 3rd parties are probably also affected by the fact that not every game even has 3rd parties. Still, I think it's safe to say that if you're playing as a 3rd party, you're playing at a disadvantage (on average).
I'm quite surprised to see that Mafia dominates so hard, though. I wonder if the TL setups are generally Mafia-favored or if the players are generally better at playing Mafia than town. I guess it could be a combination of both.
I think the Win Percentage By Alignment statistic would be a bit closer to what you are looking for: Town 40.6% Mafia 52.1% Third Party 30.3%
I'm not sure how reliable it is however since I haven't had the chance to update the query or verify the results. Based on another set of polls, most people consider themselves better at mafia than town. I'm don't know how much setup plays a role in the gap.
On December 04 2013 07:39 Xatalos wrote: If you had to give a rough estimate, what kind of a victory percentage would you give for each of the neutral roles?
I'm not really sure to be honest. Your assassin calculation makes sense. For survivor, I'd be pretty confident that I'd be able to pull it off with a simple d1 role claim like I mentioned, so maybe something like 75%? This might not apply to everyone though?
Serial killer is much tougher, so it really would be a random guess not taking setup into account. Maybe aim for around 20%?
On December 04 2013 08:55 Xatalos wrote:As a sidenote... There's been a typo and one of my games is under "Xalatos" (lol) in the game database... 
You should be able to go in and fix it yourself, though it may be a while before it is reflected in the OP
|
Kita, I think a better stat for T/M/3rd winrates would be to exclude themed games from the count. Just a thought.
Also, 15-20% sounds about right for 3rd parties, its what I aim for.
|
United Kingdom36160 Posts
On December 05 2013 02:54 iGrok wrote: Kita, I think a better stat for T/M/3rd winrates would be to exclude themed games from the count. Just a thought.
Also, 15-20% sounds about right for 3rd parties, its what I aim for. Tbh town probably does best in themed games...
|
On December 05 2013 02:13 kitaman27 wrote:Show nested quote +On December 04 2013 07:39 Xatalos wrote: Well, that's some detailed analysis!
I think you'd have to assume that SK is probably not a likely NK target (pro-town etc.) which would lessen the chances of him being NK'd. Even if Mafia thought that someone was SK, it would probably not be wise to shoot him...
1) Enemy of my enemy is my friend - town is the worse enemy for Mafia than SK (at least for the early game) 2) There's a considerable chance that SK might be bulletproof (at least in common TL setups where he can choose check-immunity or NK-immunity) - making it more lucrative to get the SK lynched instead of NK'd 3) Even if he does get NK'd, he could be bulletproof
All in all, I think the threat of being NK'd is considerably lower for SK than for town (on average). Identifying the serial killer can be fairly difficult at times. If the mafia team does manage to develop correct suspicions that a player is the SK, the NK odds may go down, but then you have to account for the increased lynch odds since they would become the priority lynch target. As mafia, I'd always consider the serial killer a greater threat than individual town members, even during the early game, though that's just my personal opinion. Show nested quote +On December 04 2013 07:39 Xatalos wrote: I took a look at your Mafia database and here's the win count per alignment (non-newbie games):
Mafia 108 (52%) Third Party 19 (9%) Town 79 (38%)
Doesn't seem exactly balanced :O
The very low chances of 3rd parties are probably also affected by the fact that not every game even has 3rd parties. Still, I think it's safe to say that if you're playing as a 3rd party, you're playing at a disadvantage (on average).
I'm quite surprised to see that Mafia dominates so hard, though. I wonder if the TL setups are generally Mafia-favored or if the players are generally better at playing Mafia than town. I guess it could be a combination of both. I think the Win Percentage By Alignment statistic would be a bit closer to what you are looking for: Town 40.6% Mafia 52.1% Third Party 30.3% I'm not sure how reliable it is however since I haven't had the chance to update the query or verify the results. Based on another set of polls, most people consider themselves better at mafia than town. I'm don't know how much setup plays a role in the gap. Show nested quote +On December 04 2013 07:39 Xatalos wrote: If you had to give a rough estimate, what kind of a victory percentage would you give for each of the neutral roles? I'm not really sure to be honest. Your assassin calculation makes sense. For survivor, I'd be pretty confident that I'd be able to pull it off with a simple d1 role claim like I mentioned, so maybe something like 75%? This might not apply to everyone though? Serial killer is much tougher, so it really would be a random guess not taking setup into account. Maybe aim for around 20%? Show nested quote +On December 04 2013 08:55 Xatalos wrote:As a sidenote... There's been a typo and one of my games is under "Xalatos" (lol) in the game database...  You should be able to go in and fix it yourself, though it may be a while before it is reflected in the OP 
Hmm. Not sure what's it about. My name was correct in the web interface, but misplaced in the actual thread...
![[image loading]](http://i.imgur.com/bYpmcgA.png)
In any case, that's pretty off-topic 
Well, I guess that indeed SK is a bigger threat than an individual townie (at least a vanilla townie). Mostly I meant that a SK would be unlikely to be NK'd during the early nights (N1-N2 at least). Which in turn would improve SK's victory odds at least a bit.
On the other hand, a SK would probably be more likely lynched than the average townie. So maybe it just evens out.
Yeah, that's a more accurate statistic than the one I found. I think 30% is surprisingly high for neutral roles. Probably Survivors have the highest odds which makes all neutral roles look better as a group.
Or actually an Assassin always wins, so if there are 2 Assassins, a 50% victory chance is pretty good 
Actually Foolishness gave me the 25% victory odds for Survivor and I think it's probably closer to the truth than 75%? But I really have no idea about that one. Maybe something closer to 30-40%.
SK is currently somewhere around 15% in general. I agree that it should probably be a bit higher.
I'll remember these comments for the next patch.
|
Phew... I'm currently thinking of ways to implement iGrok's balancing method. It's definitely harder / more complicated than this +/- method. But we'll see how it works out.
It's possibly wasted time to tune the current system so I'll see how iGrok's system works next, I guess. Another very possible change is to make the roles show as "X x Rolename" instead of "Rolename Rolename Rolename (x X)" which would seem a bit cleaner. Otherwise the user interface is starting to feel pretty completed (for now).
Although I have an exam week & I start playing in Titanic Mafia soon so I probably won't have a ton of time to use.
|
On December 04 2013 07:39 Xatalos wrote:
Mafia 108 (52%) Third Party 19 (9%) Town 79 (38%)
Doesn't seem exactly balanced :O
The very low chances of 3rd parties are probably also affected by the fact that not every game even has 3rd parties. Still, I think it's safe to say that if you're playing as a 3rd party, you're playing at a disadvantage (on average).
Hmmm.
Apart from some problems (I am assuming they are there)
A really important question is to ask what balanced is.
Scum winning 50% and town winning 50% seems to be an accepted desirable outcome.
I am not sure that a team with one person in it having an even (33%) chance of winning to a team which most people play on and considering that there are lots of people that never get a chance to to be the solo win team, that Sk probably ought be hard to win with.
You might argue the same about scum as that teams smaller, the ratio is different.
even at 9% scum win more often that their size. but whats the metric and what are your goals in balancing game and why edit: nvm read the thread properly now.
|
After some theoretical experimentation, it seems like the method iGrok suggested earlier isn't that well suited for automated balancing.
I'll be at least fine-tuning the balance tester (victory odds, user interface etc.) in the somewhat near future. Additional suggestions are very welcome, though! It's easier to implement changes in a single update rather than one at a time...
|
Nice!
Now that the tool is here, it'd would indeed be nice for more analysis to be made on what actually makes a "balanced" game. That's the most important part. With the ease of tweeking this tool, it will certainly make that task easier!
Although, the +X -X things do seem a little too arbitrary, even if they are made with "common sense". Dunno you can actually state with precision that town or scum will win Y% of the time, just by adding +3 or -2 to the setup in an arbitrary way. If you add probabilities of winning, you need to model those win conditions, and the conditions in which they can happen (what actions town/scum can make, etc), and maybe do some statistical work. ...someone volunteer?
|
On December 11 2013 08:26 gonzaw wrote: Nice!
Now that the tool is here, it'd would indeed be nice for more analysis to be made on what actually makes a "balanced" game. That's the most important part. With the ease of tweeking this tool, it will certainly make that task easier!
Although, the +X -X things do seem a little too arbitrary, even if they are made with "common sense". Dunno you can actually state with precision that town or scum will win Y% of the time, just by adding +3 or -2 to the setup in an arbitrary way. If you add probabilities of winning, you need to model those win conditions, and the conditions in which they can happen (what actions town/scum can make, etc), and maybe do some statistical work. ...someone volunteer? That sounds like a hell of a lot of coding specific role interactions. Having seen how poorly game theory that was not built with computer scripting in mind works when you attempt to script it (MODO), I pass.
|
Coding can come naturally if you have a theoretical model of it. If you set the foundation, i.e, formally specify roles, win conditions, chance to win games, etc, then coding that is just translating that to a specific language and technology, which is much easier than doing that from the start.
The problem is that someone has to volunteer to do that!  Kind of a big problem if you ask me....but if you don't then these kind of algorithms and theories seem kind of arbitrary to me. E.g, you could use this tool for a very complex setup, and it says town/scum win 50% of the time each, yet when you put it in practice you see scum win 80% of the time. What guarantee is there in the "Mafia Game Balance" theory?
|
Heh, I originally had something like that in mind (calculating a lot of different scenarios - kind of like a chess AI). But that's a lot of work. Then I found the +/- system with Google. I think it would be possible to do a system like that for a very small/basic setup (with like 1/2 days) but it gets exponentially harder with size/length of the game......
|
The only thing I'd like to see is an accounting for inactivity mod-kills. I guess you can work around it if you just remove a certain number of townies from the game beforehand, but it would be nice if there is some kind of framework for working an a modkill rate.
Good to know that the upcoming game I am hosting should be pretty balanced, assuming 4 people get modkilled (randomly picked a number)
|
I'd think that modkills are somewhat evenly spread between factions?
Won't have time to update tester for a little while anyways..
|
Ideally there shouldn't be modkills.
Maybe more ideally, when someone is "modkilled" for inactivity, what actually happens is that the game is re-balanced (somehow) as if that player didn't join the game in the first place. Eg if there are 12 townies and 3 scum, and a townie is "modkilled" for inactivity, then you rebalance the game as if there were only 11 townies and 3 scum all along. The game doesn't "lose" balance (i.e if a townie got modkilled, town doens't lose advantage, if scum was modkilled, scum doesn't lose advantage). How? Beats me, that's why it's idealized
|
On December 14 2013 02:38 gonzaw wrote:Ideally there shouldn't be modkills. Maybe more ideally, when someone is "modkilled" for inactivity, what actually happens is that the game is re-balanced (somehow) as if that player didn't join the game in the first place. Eg if there are 12 townies and 3 scum, and a townie is "modkilled" for inactivity, then you rebalance the game as if there were only 11 townies and 3 scum all along. The game doesn't "lose" balance (i.e if a townie got modkilled, town doens't lose advantage, if scum was modkilled, scum doesn't lose advantage). How? Beats me, that's why it's idealized 
Haha Well, I guess it could always be attempted to create such a setup! It's pretty difficult to prepare for all the different modkill scenarios though.
I still think modkills are somewhat equally harmful for all factions (though maybe hosts are a bit more lenient for scum before modkilling).
|
I'll be a bit busy for the next few days, but probably I'll be making version #4 during this week. The changes aren't yet finalized, but this feedback thread is the main source.
|
I made a (smaller) update to the balance tester today. Here are the changes:
- All balance values have been changed to decimal values - The base balance value for Mafia is now -4.25 (previously -4) - The balance value for Veteran is now +1.5 (previously +2) - The balance value for Serial Killer is now -3.5 (previously -3)
- Mafia Mason is now valued at the base balance value for Mafia (-4.25) unless at least one town Mason exists
- Victory odds calculations have been adjusted - Specifically both Serial Killer and Survivor have had their victory odds increased moderately
I had also planned to include scroll panes and a new style to view the role list (amount X rolename instead of all rolenames in a row), but ran into some technical difficulties, and then decided to delay those changes. They aren't *that* crucial in the big picture, after all. I'll probably include them later on to improve the UI a bit.
Here's a link to download the version #4 of the program:
https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar
All feedback is appreciated!
|
Cool, I was looking toward making something like this myself. I just got time this break so I'm going to try to make something independently (partly cause I hate java) and I'll see what I get.
If you wanna collab on something let me know. I'm thinking of including past games and other types of data as well.
|
On December 30 2013 14:06 wherebugsgo wrote: Cool, I was looking toward making something like this myself. I just got time this break so I'm going to try to make something independently (partly cause I hate java) and I'll see what I get.
If you wanna collab on something let me know. I'm thinking of including past games and other types of data as well.
That sounds interesting. The approved setups here on TL Mafia have already gone through a manual balancing process, so they should be a good starting point for automatic balancing. Are you thinking of basing the whole balancing process on past games data or just showing them as some kind of a reference for the user? kitaman's TL Mafia Database would probably be helpful for both purposes.
Which language are you planning to use? How similar is it to my current balance tester? I could share the code I have currently on this one if you want. Actually the logic of this program is pretty simple, and the hardest part has been to get the GUI working properly (it still isn't working completely properly ), but it might still be helpful for you to glance at the logic portion. It might also be helpful for me if you find something to improve.
Depending on how similar our aims are, it might make sense to maintain two separate programs. If they're very similar, though, it might not make much sense. Currently my main goal is just to make the program easy to use and fairly reliable. I thought of using iGrok's balancing method for a bit, but ultimately I didn't know how to automate it. The +/- method is very simple, but its accuracy suffers in larger / more complicated setups. The best option would probably be to calculate every possible scenario each day/night for the whole game, but that gets very complicated very fast. How were you thinking of calculating the balance?
|
On December 30 2013 23:29 Xatalos wrote: ... Actually the logic of this program is pretty simple, and the hardest part has been to get the GUI working properly... That always seems to be the way it works out.
|
On December 30 2013 23:29 Xatalos wrote:Show nested quote +On December 30 2013 14:06 wherebugsgo wrote: Cool, I was looking toward making something like this myself. I just got time this break so I'm going to try to make something independently (partly cause I hate java) and I'll see what I get.
If you wanna collab on something let me know. I'm thinking of including past games and other types of data as well. That sounds interesting. The approved setups here on TL Mafia have already gone through a manual balancing process, so they should be a good starting point for automatic balancing. Are you thinking of basing the whole balancing process on past games data or just showing them as some kind of a reference for the user? kitaman's TL Mafia Database would probably be helpful for both purposes. Which language are you planning to use? How similar is it to my current balance tester? I could share the code I have currently on this one if you want. Actually the logic of this program is pretty simple, and the hardest part has been to get the GUI working properly (it still isn't working completely properly  ), but it might still be helpful for you to glance at the logic portion. It might also be helpful for me if you find something to improve. Depending on how similar our aims are, it might make sense to maintain two separate programs. If they're very similar, though, it might not make much sense. Currently my main goal is just to make the program easy to use and fairly reliable. I thought of using iGrok's balancing method for a bit, but ultimately I didn't know how to automate it. The +/- method is very simple, but its accuracy suffers in larger / more complicated setups. The best option would probably be to calculate every possible scenario each day/night for the whole game, but that gets very complicated very fast. How were you thinking of calculating the balance?
Probably at least partially based on past setups, though the sample size is incredibly small.
More likely what I'll be doing is encouraging the people on the balance team to run the setup randomizer I create lots of times. I'll probably put in some sort of rudimentary learning algorithm that will assign a balance rating, i.e. + for town, - for mafia similar to what you have. Based on what the tester inputs as his opinion the program will change its future predictions for the setups it creates/sees.
It'd hopefully become more effective as more games are added. I'll likely also include multiple options for balance calculation. I'm thinking the main ones would be:
1. Testers' inputted scores 2. Role balance based on game winrate when included 3. Balance based upon +/- scores given to different roles (manually, not through past games)
So there'd probably be a bunch of checkboxes or input boxes for each of the calculations, and the program would just keep track of a variety of different values to calculate scores to maintain versatility.
In other words, if I wanted to see what the program thought without including past games, there'd be an option to turn off #2. If I wanted to manually tune the score based on what I thought certain roles are worth, I could change scores on the fly for #3.
e: unfortunately I don't have a proper coding platform atm, I fucking hate Windows. So this'll probably be on the backburner for a bit.
also I'll probably write it in either Python or C++.
|
On January 01 2014 07:37 wherebugsgo wrote:Show nested quote +On December 30 2013 23:29 Xatalos wrote:On December 30 2013 14:06 wherebugsgo wrote: Cool, I was looking toward making something like this myself. I just got time this break so I'm going to try to make something independently (partly cause I hate java) and I'll see what I get.
If you wanna collab on something let me know. I'm thinking of including past games and other types of data as well. That sounds interesting. The approved setups here on TL Mafia have already gone through a manual balancing process, so they should be a good starting point for automatic balancing. Are you thinking of basing the whole balancing process on past games data or just showing them as some kind of a reference for the user? kitaman's TL Mafia Database would probably be helpful for both purposes. Which language are you planning to use? How similar is it to my current balance tester? I could share the code I have currently on this one if you want. Actually the logic of this program is pretty simple, and the hardest part has been to get the GUI working properly (it still isn't working completely properly  ), but it might still be helpful for you to glance at the logic portion. It might also be helpful for me if you find something to improve. Depending on how similar our aims are, it might make sense to maintain two separate programs. If they're very similar, though, it might not make much sense. Currently my main goal is just to make the program easy to use and fairly reliable. I thought of using iGrok's balancing method for a bit, but ultimately I didn't know how to automate it. The +/- method is very simple, but its accuracy suffers in larger / more complicated setups. The best option would probably be to calculate every possible scenario each day/night for the whole game, but that gets very complicated very fast. How were you thinking of calculating the balance? Probably at least partially based on past setups, though the sample size is incredibly small. More likely what I'll be doing is encouraging the people on the balance team to run the setup randomizer I create lots of times. I'll probably put in some sort of rudimentary learning algorithm that will assign a balance rating, i.e. + for town, - for mafia similar to what you have. Based on what the tester inputs as his opinion the program will change its future predictions for the setups it creates/sees. It'd hopefully become more effective as more games are added. I'll likely also include multiple options for balance calculation. I'm thinking the main ones would be: 1. Testers' inputted scores 2. Role balance based on game winrate when included 3. Balance based upon +/- scores given to different roles (manually, not through past games) So there'd probably be a bunch of checkboxes or input boxes for each of the calculations, and the program would just keep track of a variety of different values to calculate scores to maintain versatility. In other words, if I wanted to see what the program thought without including past games, there'd be an option to turn off #2. If I wanted to manually tune the score based on what I thought certain roles are worth, I could change scores on the fly for #3. e: unfortunately I don't have a proper coding platform atm, I fucking hate Windows. So this'll probably be on the backburner for a bit. also I'll probably write it in either Python or C++.
Okay, that #3 option seems pretty similar to how my program works currently... But options #1 and #2 are quite different. Although I've naturally tried to have some level of "tester input" through this feedback thread And there have been several very good suggestions as well. I think it could be pretty useful for you to read through this thread from a developer perspective.
I'll PM you the source logic of my program so that you can see if there's something useful for your aims. You said that you dislike Java, but even so, it shouldn't be that hard to understand how it works (it's pretty simple overall).
Be sure to also check out the actual program here: https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar I'd definitely value feedback from a developer (as well as Mafia player) perspective.
|
I think this would probably work better as web app. You could use a free cloud hosting system perhaps?
Also, how about making this open source? Msybe open a github proyect so people can cooperate
|
On January 01 2014 10:29 gonzaw wrote: I think this would probably work better as web app. You could use a free cloud hosting system perhaps?
Also, how about making this open source? Msybe open a github proyect so people can cooperate
Yeah, I think a web app would be more convenient. It's just that I have basically no experience with web apps so far... It's definitely a possibility for the future, though.
I've also been thinking of making the program open source. It's not like I'm planning to make money off of it or to maintain it forever. However, I think there's still some work to be done before I'm ready to actually "launch" the program
|
I made another (relatively small) update to the balance tester:
- Added scroll bars to the main balance tester window (now it’s possible to use the program with a very small computer screen or with a very large 40+ player setup on a relatively small computer screen)
- Changed the balance value of Veteran back to +2 (from +1.5) (on second thoughts, it felt like Veteran was undervalued at +1.5)
- Increased the victory odds of SK and Survivor a bit more (I think the previous victory odds were still a bit too weak for both roles)
Here's the download link:
https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar
It seems like the balance values are in a decent spot right now, but it would be helpful to have new perspectives on the matter (it's hard to both determine the values and to test them objectively).
Otherwise there's some small user interface stuff that could use improving, but the program is mostly "ready" at this point. Maybe I'll implement some bigger changes if I get good ideas, though. WBG talked about some interesting stuff, but I'm not quite sure if I want to make this program much larger / more complicated... The original goal was to make it easy to use and to have static values, after all. We'll see.
|
Any feedback on the latest version?
Active development of the program is kind of paused at the moment, but I've implemented almost all of the suggestions so far, so it's a good time to add your own ideas now for the next version
|
On January 01 2014 17:10 Xatalos wrote:Show nested quote +On January 01 2014 10:29 gonzaw wrote: I think this would probably work better as web app. You could use a free cloud hosting system perhaps?
Also, how about making this open source? Msybe open a github proyect so people can cooperate Yeah, I think a web app would be more convenient. It's just that I have basically no experience with web apps so far... It's definitely a possibility for the future, though.
Well....ok 
With a web app, you'd have less "control" over the GUI (like you'd do with a desktop app), but you have more powerful frameworks to choose from to help you. E.g databases, hosting services, bla bla bla. Well, if you choose specific frameworks (which you have to research), and you know lots of javascript, or html5, etc, you can have a pretty bitching GUI. However that's harder than just creating an app with Swing. Although I think JavaFX may be better perhaps; I never really liked Swing.
Also you already have it hosted, nobody needs to install JRE or download the app or anything. Because it's hosted in a single place, you can have users, and statistics, and shit like that
I've also been thinking of making the program open source. It's not like I'm planning to make money off of it or to maintain it forever. However, I think there's still some work to be done before I'm ready to actually "launch" the program 
Yeah, it's kind of a "tough" thing to do. If you are the project leader, you'll have to do lots of stuff, and basically learn a whole new industry setting and procedures, etc. For instance here's a guide: http://producingoss.com/en/index.html It does take a while to learn, and then get enough experience and practice and collaboration and shit (not that I ever did any open source project though lol).
If you do go open source though, you can gather the power from anybody ever that's relatively interested in tools to play mafia, instead of just doing it yourself. That has the potential of creating a super awesome tool, and hell maybe even advancing the "game theory" behind mafia (regarding balancing in this specific case for instance).
I'd volunteer and stuff.....but I'm lazy (you can notice I haven't done anything on that other project I wanted to do and made a thread about like one year ago lol).
Also, as for suggestions, I would suggest: -Include a database of the games it's being used on. Whenever the user chooses to balance a game, you can ask for the name of the game and that kind of stuff, and save it for later (for example, to later check how that previous game was balanced once it's over).
-Migrate kita's database of games into this new database of yours. That way we can see how every single game from TL is balanced....and well that's nice. It's not hard work as long as you create a compatible infrastructure and create a script to migrate kita's database
|
On January 10 2014 10:54 gonzaw wrote:Show nested quote +On January 01 2014 17:10 Xatalos wrote:On January 01 2014 10:29 gonzaw wrote: I think this would probably work better as web app. You could use a free cloud hosting system perhaps?
Also, how about making this open source? Msybe open a github proyect so people can cooperate Yeah, I think a web app would be more convenient. It's just that I have basically no experience with web apps so far... It's definitely a possibility for the future, though. Well....ok  With a web app, you'd have less "control" over the GUI (like you'd do with a desktop app), but you have more powerful frameworks to choose from to help you. E.g databases, hosting services, bla bla bla. Well, if you choose specific frameworks (which you have to research), and you know lots of javascript, or html5, etc, you can have a pretty bitching GUI. However that's harder than just creating an app with Swing. Although I think JavaFX may be better perhaps; I never really liked Swing. Also you already have it hosted, nobody needs to install JRE or download the app or anything. Because it's hosted in a single place, you can have users, and statistics, and shit like that Show nested quote +I've also been thinking of making the program open source. It's not like I'm planning to make money off of it or to maintain it forever. However, I think there's still some work to be done before I'm ready to actually "launch" the program  Yeah, it's kind of a "tough" thing to do. If you are the project leader, you'll have to do lots of stuff, and basically learn a whole new industry setting and procedures, etc. For instance here's a guide: http://producingoss.com/en/index.htmlIt does take a while to learn, and then get enough experience and practice and collaboration and shit (not that I ever did any open source project though lol). If you do go open source though, you can gather the power from anybody ever that's relatively interested in tools to play mafia, instead of just doing it yourself. That has the potential of creating a super awesome tool, and hell maybe even advancing the "game theory" behind mafia (regarding balancing in this specific case for instance). I'd volunteer and stuff.....but I'm lazy  (you can notice I haven't done anything on that other project I wanted to do and made a thread about like one year ago lol). Also, as for suggestions, I would suggest: -Include a database of the games it's being used on. Whenever the user chooses to balance a game, you can ask for the name of the game and that kind of stuff, and save it for later (for example, to later check how that previous game was balanced once it's over). -Migrate kita's database of games into this new database of yours. That way we can see how every single game from TL is balanced....and well that's nice. It's not hard work as long as you create a compatible infrastructure and create a script to migrate kita's database
That sounds kind of like WBG's plan for a balance tester (using past games for comparison and balancing). You can check earlier in this thread. I'm not sure when he'll begin working on that system, but I think it might be better if he focused on that and I focused on this simpler, static approach. (Also I don't know anything about databases yet, but I'll be studying mostly database stuff in the following months, so maybe I'll include some of that stuff too We'll see!)
I haven't yet given any real thought to open source, but thanks for the link. I'll save it for future reference. It also depends on if there are actually other people willing to work on the program... The logic in it is relatively simple, and most of the work so far has resulted from creating the GUI. I'll have to consider the option more.
Regarding the web option: yeah, what you say is true. If I had had experience with web development, I would have almost certainly started the project as a web site. I'll see what I can do once I improve my skills 
A lot of uncertain answers in this post, sorry, but what you talked about was very large-scale stuff. It's certainly useful to consider such matters, but mostly I'm looking for more concrete and smaller suggestions at the moment. Thanks in any case!
|
kitaman27
United States9244 Posts
I know this is kinda outside the realm of what you have currently, but something that I find really helpful is knowing the cycle the game would end in worst case scenario for each faction.
For example, 2 Goons/7 VT would end D3 at the earliest for a mafia win or D2 at the earliest for a town win. 2 Goons/6 VT 1 Vig would end D2 at the earliest for a mafia win or N1 at the earliest for a town win.
If you're looking for a feature to add at any point, it would probably be fairly simple to come up with a formula for this for mini games.
|
On January 11 2014 04:38 kitaman27 wrote: I know this is kinda outside the realm of what you have currently, but something that I find really helpful is knowing the cycle the game would end in worst case scenario for each faction.
For example, 2 Goons/7 VT would end D3 at the earliest for a mafia win or D2 at the earliest for a town win. 2 Goons/6 VT 1 Vig would end D2 at the earliest for a mafia win or N1 at the earliest for a town win.
If you're looking for a feature to add at any point, it would probably be fairly simple to come up with a formula for this for mini games.
Actually yeah, that's a good idea, and not that hard to calculate either. Basically the worst case for town is if every Mafia NK kills a townie and every lynch is a mislynch. The worst case for Mafia is if every lynch hits Mafia and no NK kills a townie (Doctor/Veteran etc.). On the other hand, roles like Serial Killer complicate matters a bit. I'm not sure if there's even much use in calculating an ideal scenario for neutral roles? Maybe just town/Mafia?
|
kitaman27
United States9244 Posts
Ya I probably wouldn't bother with third party scenarios.
|
I think....we could just use good ol' probabilities and statistics, based on all possible scenarios.
For example, you can balance a game, knowing that in the worst case scenario for town, town loses on D3 after 2 misslynches and 2 NK going through. Then you have the worst case scenario for scum, where town lynches scum 3 days in a row, the medic saves shots 2 nights in a row, cop gets checks 2 nights in a row, etc. But what about the stuff in between? You can't balance JUST using worst case scenarios, because those will NEVER happen, they are just a rough guide on what "could" happen. I think it's more important to balance according to what WILL indeed happen.
Maybe the best way to model that, is just count all possible scenarios, assign a probability to them, or maybe some other factor (like a Balance Number perhaps?), and then determine the overall balance of the game, knowing the probability of each of these scenarios. Most likely there would be heuristics to determine these probabilities/factors, or some other theory that can help.
For instance, yes, the worst case scenario for scum is if the Town Vig shoots scum on N1, the medic saves 2 townies on N1 and N2, and town lynches scum on D1, D2 and D3. Good, but that will surely NOT happen at all. What will most likely happen, is town misslynches on D1, town vig shoots a townie on N1, town lynches scum on D2, medic saves townie on N2, bla bla bla. THAT is the "normal" flow of the game you should be balancing. If town has it so easy, that in that scenario they win almost all the time, then the game is balanced wrong, even if there exists a "worst case scenario" for town that seems it can fuck them up pretty badly. The point is that it's more probable that the "normal" flow of the game happens than that worst case scenario.
Different roles have different balancing factors as well, that's not just a +1 or -1. A town vig can shoot a townie or a scum, he has the power to greatly favor scum or town. That has a lot of variance, so when a vig is inserted in a game, it should introduce variance on the chances each faction can win, and thus balance. Idem when you have a cop and a framer or GF for instance. It introduces variance, since the cop may check the GF. That greatly changes the game, since the GF could be considered almost confirmed town. Or maybe town is good and catch him nevertheless. That's even more variance (how town can react to it).
I think something like that might work better: introduce the average chance each faction has to win the game, and the variance of it, and balance (somehow) according to that).
Seems to me there can be better ways to handle balance, to be as accurate as possible.
|
On January 11 2014 06:05 gonzaw wrote: I think....we could just use good ol' probabilities and statistics, based on all possible scenarios.
For example, you can balance a game, knowing that in the worst case scenario for town, town loses on D3 after 2 misslynches and 2 NK going through. Then you have the worst case scenario for scum, where town lynches scum 3 days in a row, the medic saves shots 2 nights in a row, cop gets checks 2 nights in a row, etc. But what about the stuff in between? You can't balance JUST using worst case scenarios, because those will NEVER happen, they are just a rough guide on what "could" happen. I think it's more important to balance according to what WILL indeed happen.
Maybe the best way to model that, is just count all possible scenarios, assign a probability to them, or maybe some other factor (like a Balance Number perhaps?), and then determine the overall balance of the game, knowing the probability of each of these scenarios. Most likely there would be heuristics to determine these probabilities/factors, or some other theory that can help.
For instance, yes, the worst case scenario for scum is if the Town Vig shoots scum on N1, the medic saves 2 townies on N1 and N2, and town lynches scum on D1, D2 and D3. Good, but that will surely NOT happen at all. What will most likely happen, is town misslynches on D1, town vig shoots a townie on N1, town lynches scum on D2, medic saves townie on N2, bla bla bla. THAT is the "normal" flow of the game you should be balancing. If town has it so easy, that in that scenario they win almost all the time, then the game is balanced wrong, even if there exists a "worst case scenario" for town that seems it can fuck them up pretty badly. The point is that it's more probable that the "normal" flow of the game happens than that worst case scenario.
Different roles have different balancing factors as well, that's not just a +1 or -1. A town vig can shoot a townie or a scum, he has the power to greatly favor scum or town. That has a lot of variance, so when a vig is inserted in a game, it should introduce variance on the chances each faction can win, and thus balance. Idem when you have a cop and a framer or GF for instance. It introduces variance, since the cop may check the GF. That greatly changes the game, since the GF could be considered almost confirmed town. Or maybe town is good and catch him nevertheless. That's even more variance (how town can react to it).
I think something like that might work better: introduce the average chance each faction has to win the game, and the variance of it, and balance (somehow) according to that).
Seems to me there can be better ways to handle balance, to be as accurate as possible.
Yeah, I thought about that at the very beginning. The problem is that if you have like 20+ players and/or 6+ power roles, it becomes more and more difficult to keep track of all the possible scenarios. Hmm... On the other hand, maybe it's not impossible. There would need to be some kind of a very effective algorithm for keeping track of each possible scenario, which sounds pretty difficult, but I think it might be doable. Maybe I should try testing something like that - at least with a small all vanilla setup. It only gets harder from there though
|
kitaman27
United States9244 Posts
On January 11 2014 06:05 gonzaw wrote: I think....we could just use good ol' probabilities and statistics, based on all possible scenarios.
For example, you can balance a game, knowing that in the worst case scenario for town, town loses on D3 after 2 misslynches and 2 NK going through. Then you have the worst case scenario for scum, where town lynches scum 3 days in a row, the medic saves shots 2 nights in a row, cop gets checks 2 nights in a row, etc. But what about the stuff in between? You can't balance JUST using worst case scenarios, because those will NEVER happen, they are just a rough guide on what "could" happen. I think it's more important to balance according to what WILL indeed happen.
I think considering worst case scenarios is helpful because it allows you to eliminate undesirable scenarios. In mini games, the worst case (or close to worst case) scenarios aren't so uncommon that you never see them play out that way since you're usually only dealing with 1-2 roles.
Suppose you come up with a setup that is 55/45 in balance and each faction must pull off three correct lynches before they have a chance of winning.
You have a have another setup that is 50/50 in balance, but once out of every ten times, a game snowballs with a night one loss for a faction.
I'd probably want to run the first setup where you can ensure you aren't going to end up with the occasional dud, even if it is slightly less balanced.
On January 11 2014 06:05 gonzaw wrote: Different roles have different balancing factors as well, that's not just a +1 or -1. A town vig can shoot a townie or a scum, he has the power to greatly favor scum or town. That has a lot of variance, so when a vig is inserted in a game, it should introduce variance on the chances each faction can win, and thus balance.
In theory, introducing a vig or cop should never impact the town's chances of winning in a negative way. Since the vig has a choice of shooting, it should never be worse than a vanilla townie. However, the positive value of the vig or cop can vary from setup to setup like you're saying.
On January 11 2014 06:05 gonzaw wrote: I think something like that might work better: introduce the average chance each faction has to win the game, and the variance of it, and balance (somehow) according to that).
Seems to me there can be better ways to handle balance, to be as accurate as possible.
It's difficult to calculate the average chance each faction has to win. You could try to calculate out every single scenario and take an average of all outcomes, but that's assuming lynches and night actions are randomized, which isn't the case. You could try to come up with odds of each lynch going a certain way based on past games, but I don't think the sample size is large enough for it to give us an accurate weighting.
|
Well yeah, it's hard to do this stuff. That's what theories are for!  (like I said....if someone is a mathematician here it'd greatly help ).
In the most crude way possible, yes, you'd count EVERY single possible scenario, and for each one of those, individually calculate the probability it has, or how that scenario can happen and how it affects balance. After all of that is done you get the overall average win rate and balance. That is basically impossible, yes. There should be "shortcuts" to group together scenarios, get conclusions from them, etc. Any possible theorem or conclusion, etc you can come up with, can be used here.
For example, you could say something like: Town has a better chance to lynch scum if 20%-25% of players are scum. If more than 25% or less than 20% of players are scum, it's more likely town will misslynch. That would be a pretty good observation wouldn't it? If scum are more than 25% of players, they have more leverage on town, thus can control the lynch and put it on a townie. If less than 20% of players are scum, there are more townies than scum, and scum is hidden better, so town is more likely to lynch a townie trying to blindly find the scum. With this conclusion, you can come up with related conclusions as well, like maybe that town is more likely to lynch scum on D2 after they misslynched on D1, or that if town lynches 90% of scum in a row, then they are more likely to lose than if they lynched said 90% with misslynches in between (basically, when there is 1 scum between 10 townies and the scum ends up winning. Happens at times).
I pulled all of those numbers from my ass, but you get the meaning. We can study the game, and use the conclusions to balance the game better. For example, the above observations give you a comparison between scenarios and what chances the factions have of winning the game in those scenarios. Might not be much but it may be a start, and with more work we could end up with a balancing system that works as intended.
I think a starting point is figuring out the "perfect" balance in a pure vanilla game. I.e determine the amount of scum and scum KP there should be depending on the amount of players, etc. If we have something optimal for that, then we can introduce roles into the equation and see how it goes, and formulate new theories based on that...
...or maybe this is impossible or something and the +1/-1 thing is enough
|
On January 11 2014 06:48 kitaman27 wrote:Show nested quote +On January 11 2014 06:05 gonzaw wrote: I think....we could just use good ol' probabilities and statistics, based on all possible scenarios.
For example, you can balance a game, knowing that in the worst case scenario for town, town loses on D3 after 2 misslynches and 2 NK going through. Then you have the worst case scenario for scum, where town lynches scum 3 days in a row, the medic saves shots 2 nights in a row, cop gets checks 2 nights in a row, etc. But what about the stuff in between? You can't balance JUST using worst case scenarios, because those will NEVER happen, they are just a rough guide on what "could" happen. I think it's more important to balance according to what WILL indeed happen. I think considering worst case scenarios is helpful because it allows you to eliminate undesirable scenarios. In mini games, the worst case (or close to worst case) scenarios aren't so uncommon that you never see them play out that way since you're usually only dealing with 1-2 roles. Suppose you come up with a setup that is 55/45 in balance and each faction must pull off three correct lynches before they have a chance of winning. You have a have another setup that is 50/50 in balance, but once out of every ten times, a game snowballs with a night one loss for a faction. I'd probably want to run the first setup where you can ensure you aren't going to end up with the occasional dud, even if it is slightly less balanced.
That's a case of the variance I mentioned. In the 1st case you mentioned, there is +-0% variance. In the 2nd, let's say there is +-20% variance. In these cases, you don't only care about the average chance of win from each faction, but also the variance, and both affect the balance of the game.
Well, technically it's the average rate of winning (not chance) but whatever.
Show nested quote +On January 11 2014 06:05 gonzaw wrote: I think something like that might work better: introduce the average chance each faction has to win the game, and the variance of it, and balance (somehow) according to that).
Seems to me there can be better ways to handle balance, to be as accurate as possible. It's difficult to calculate the average chance each faction has to win. You could try to calculate out every single scenario and take an average of all outcomes, but that's assuming lynches and night actions are randomized, which isn't the case. You could try to come up with odds of each lynch going a certain way based on past games, but I don't think the sample size is large enough for it to give us an accurate weighting.
Yes, the lynches and night actions aren't randomized, but you can analyse how the game works to get conclusions from it that you base your analysis in. For example, that previous bolded "conclusion" is based entirely on how the game works, nothing else. Yet with that conclusion you can do probabilistic and mathematical work to find out the chances each faction has to win, etc.
|
United Kingdom36160 Posts
Worst case scenarios are pretty fundamental for balancing imo. Especially for the townside, where day 1 mislynches and vigis misfiring are common things.
|
But it's only one part of the equation. Making sure town doesn't lose in D2 if they have bad luck/aim, is not enough to make sure the game is balanced. What if town, on average, loses 80% of the time in D4 instead? You can't account for that just by looking at the worst case scenario where they lose on D2 and making sure it doesn't happen.
There is also the fact about how you actually analyze these worst case scenarios. Yes, if it's a "normal" game, with just a vig, it's easy to figure out how it can happen. I.e town misslynches 1 time and a vig shoots a townie and town is in MYLO or something. But what if you have Cops and Framers and GFs? Is there a "worst case" scenario with those? Surely there is (cop gets red check on a framed townie every single night). Is it as likely, or does it have as much of an impact in the game? Perhaps, or perhaps not. What if there is 1 scum bus driver and 1 town bus driver, a jailer, 2 watchers, 2 trackers, and 3 nosy neighbors? How do you analyze that? What is the worst case scenario? Is it likely it will happen? Does it have an impact in the game (in contrast to other non-worse scenarios)? Is it worth analyzing? Is it fundamental for balancing in that game?
|
Ouch... Scum twice in a row and catched too easily both times :D I'll need a strategic break or something for a while.
I'd like to experiment with at least the best/worst scenarios when I have time, maybe this weekend. Potentially I could also try the "average scenario" stuff although that's a lot more complicated.
|
Yeah.
Like I said, maybe it's better to go step by step, in terms of roles and setups. First, just have VTs and Goons, and determine the "Balance Factor" depending on the number of players and number of scum. Then introduce, say, a medic, and take into account the worst/best case scenarios with that one, how it works in a mafia game and how you'd balance it in a general sense. Then maybe introduce the scum RBer, and do the exact same, but also relate it to the medic role (when both are in the same game). Then introduce the cop, then the GF, then the vig, then framer, then maybe SK, etc etc.
I think that is the best way to go. If not, you get overwhelmed by roles and setups, and the theory behind the balancing may suffer and not make it accurate.
|
Finally I found some free time to continue with the balance tester!
There are a lot of small, mostly invisible changes in the program - and then there's one big addition. You can now view the fastest possible victory for town/Mafia(1-3 KP) in your chosen setup. Currently the fastest victory calculations only take into account 1) one lynch per day 2) 1-3 Mafia KP per night 3) 1 KP per Vigilante (per game).
Neutral roles and Veterans currently have no effect on the results. Neutral roles turned out to be quite annoying in these calculations, so I just decided to ignore them completely. I've come to realize that especially roles like SK can completely ruin the game... So if you want to ensure a fair game with normal length, it's probably better not to include any SKs. Veterans would very rarely have any effect on the results (keep in mind that these are just the extreme scenarios), so I decided to ignore them as well. I doubt anyone would run more than 2 Veterans at the same time anyway...
So far the results of the fastest victory scenarios seem accurate, but there's probably something wrong somewhere - feedback is appreciated!
Here's the download link:
https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar
I've also experimented a bit with the idea of comparing past game results with how balanced those setups should be - according to the balance tester. Before coming to any conclusions, here are some results (these games are all the Mini games - with "normal" roles - from the TL Mafia Central Library):
Mini Mafia 1 Town Victory Odds: 45.28% Mafia Victory Odds: 54.72% -> Solid Mafia Victory
Mini Mafia 2 Town Victory Odds: 50.85% Mafia Victory Odds: 49.15% -> Close Town Victory
Mini Mafia 3 Town Victory Odds: 43.14% Mafia Victory Odds: 56.86% -> Overwhelming Mafia Victory
Micro Mafia (The First) Town Victory Odds: 53.93% Mafia Victory Odds: 46.07% -> Close Town Victory
Micro Mafia (The Second) Town Victory Odds: 54.05% Mafia Victory Odds: 45.95% -> Overwhelming Mafia Victory
The Life Aquatic Mini Mafia Town Victory Odds: 54.05% Mafia Victory Odds: 45.95% -> Close Mafia Victory
Micro Mafia IV: Redemption Town Victory Odds: 54.05% Mafia Victory Odds: 45.95% -> Solid Mafia Victory
Merc Micro Mafia Town Victory Odds: 37.04% Mafia Victory Odds: 62.96% -> Overwhelming Mafia Victory
Mini Mafia V: Clues and Puzzles Town Victory Odds: 48.48% Mafia Victory Odds: 51.52% -> Solid Mafia Victory
Although this is a pretty small sample size, I think there are some interesting details about the results.
1) Town NEVER won if the odds were against them. Mafia occasionally won despite being at a small disadvantage (I assume anti-town/lurker townies can make up for the difference).
2) The most unbalanced setup was Merc Micro Mafia by far (5x VT vs 2x Mafia). That means a convincing 62.96% chance of Mafia victory. Add in the probable anti-town/lurker townies and this setup is heavily Mafia-favored. Unsurprisingly, the game resulted in a dominating Mafia victory.
3) The most balanced setup was Mini Mafia 2 (6x VT, Cop, Doctor, 1-Shot Vigilante, 2x Mafia Goon, Godfather) which resulted in a close town victory. I think the result of the game is a good indicator that it was, indeed, fairly balanced.
4) There might be some need for balance tuning yet. Apparently Mafia can take convincing victories even if the odds are supposed to be against them, so it could be necessary to take this into account and increase the balance values of Mafia roles. Alternatively town roles could have their values reduced slightly to take into account the probable anti-town players amongst them. Currently it seems like town has a hard time winning even if the setup is town-favored - and it's impossible to win for town if the setup is Mafia-favored. But more experimentation with past games would be needed to draw better conclusions.
|
Merc Micro isn't a normal setup. The players start out with items (so they aren't actually VTs) and money to buy other items.
|
On January 24 2014 05:53 HiroPro wrote: Merc Micro isn't a normal setup. The players start out with items (so they aren't actually VTs) and money to buy other items.
Oh OK. Looks like I mistakenly included it then : /
|
On second thoughts, it's probably better not to balance for suboptimal play. Although Mafia might be slightly favored in an environment where everyone is playing poorly, it'd be problematic for actually high level games if the setup wasn't balanced for that situation. And it's hard to tell in advance (also since the roles are only decided just before the game begins).
Opinions?
|
I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand.
|
On January 27 2014 00:43 raynpelikoneet wrote: I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand.
That's an interesting example.
I agree that it gets harder for Mafia if everyone is playing "perfectly". On the other hand, if everyone *is* playing perfectly, then Mafia should be favored, since it would be just random chance to hit Mafia (which is more unlikely). But it's a lot harder for Mafia than for town to really appear town in an environment where every townie appears townish.
Setup balance does still play a role and should be focused on - since it's the only truly predictable part of game balance. Another way might be to somehow balance the players (an equal share of "good" players for both teams?), but then that would create a new area of setup speculation Maybe some hosts already do balancing like this and I'm just not familiar with it. It doesn't actually seem like that bad of an idea considering the fairness/balance of games.
|
/bump 
Any new ideas / feedback about the latest version?
|
On January 27 2014 04:56 Xatalos wrote:Show nested quote +On January 27 2014 00:43 raynpelikoneet wrote: I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand. That's an interesting example. I agree that it gets harder for Mafia if everyone is playing "perfectly". On the other hand, if everyone *is* playing perfectly, then Mafia should be favored, since it would be just random chance to hit Mafia (which is more unlikely). But it's a lot harder for Mafia than for town to really appear town in an environment where every townie appears townish. Setup balance does still play a role and should be focused on - since it's the only truly predictable part of game balance. Another way might be to somehow balance the players (an equal share of "good" players for both teams?), but then that would create a new area of setup speculation  Maybe some hosts already do balancing like this and I'm just not familiar with it. It doesn't actually seem like that bad of an idea considering the fairness/balance of games.
Some hosts do balance that way, more often with vets rather than good players but the idea remains the same, I don't condone it but some do.
|
On February 14 2014 11:32 Promethelax wrote:Show nested quote +On January 27 2014 04:56 Xatalos wrote:On January 27 2014 00:43 raynpelikoneet wrote: I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand. That's an interesting example. I agree that it gets harder for Mafia if everyone is playing "perfectly". On the other hand, if everyone *is* playing perfectly, then Mafia should be favored, since it would be just random chance to hit Mafia (which is more unlikely). But it's a lot harder for Mafia than for town to really appear town in an environment where every townie appears townish. Setup balance does still play a role and should be focused on - since it's the only truly predictable part of game balance. Another way might be to somehow balance the players (an equal share of "good" players for both teams?), but then that would create a new area of setup speculation  Maybe some hosts already do balancing like this and I'm just not familiar with it. It doesn't actually seem like that bad of an idea considering the fairness/balance of games. Some hosts do balance that way, more often with vets rather than good players but the idea remains the same, I don't condone it but some do.
Hm. Isn't it better if not all the veteran players are on the same team? Pure randomness could produce games where one of the teams never stood a chance, I'd think?
|
On February 16 2014 20:03 Xatalos wrote:Show nested quote +On February 14 2014 11:32 Promethelax wrote:On January 27 2014 04:56 Xatalos wrote:On January 27 2014 00:43 raynpelikoneet wrote: I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand. That's an interesting example. I agree that it gets harder for Mafia if everyone is playing "perfectly". On the other hand, if everyone *is* playing perfectly, then Mafia should be favored, since it would be just random chance to hit Mafia (which is more unlikely). But it's a lot harder for Mafia than for town to really appear town in an environment where every townie appears townish. Setup balance does still play a role and should be focused on - since it's the only truly predictable part of game balance. Another way might be to somehow balance the players (an equal share of "good" players for both teams?), but then that would create a new area of setup speculation  Maybe some hosts already do balancing like this and I'm just not familiar with it. It doesn't actually seem like that bad of an idea considering the fairness/balance of games. Some hosts do balance that way, more often with vets rather than good players but the idea remains the same, I don't condone it but some do. Hm. Isn't it better if not all the veteran players are on the same team? Pure randomness could produce games where one of the teams never stood a chance, I'd think?
You would think that but individual play is what wins and loses games, sometimes vets rotfl stomp newbies (fruity) and sometimes newbies destroy vets (les mafia). I prefer these random draws because it gives town one less thing to game, there is already setup speculation and I personally find vet balance speculation totally worthless because it is not mafia.
|
Blazinghand
United States25550 Posts
On February 17 2014 11:58 Promethelax wrote:Show nested quote +On February 16 2014 20:03 Xatalos wrote:On February 14 2014 11:32 Promethelax wrote:On January 27 2014 04:56 Xatalos wrote:On January 27 2014 00:43 raynpelikoneet wrote: I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand. That's an interesting example. I agree that it gets harder for Mafia if everyone is playing "perfectly". On the other hand, if everyone *is* playing perfectly, then Mafia should be favored, since it would be just random chance to hit Mafia (which is more unlikely). But it's a lot harder for Mafia than for town to really appear town in an environment where every townie appears townish. Setup balance does still play a role and should be focused on - since it's the only truly predictable part of game balance. Another way might be to somehow balance the players (an equal share of "good" players for both teams?), but then that would create a new area of setup speculation  Maybe some hosts already do balancing like this and I'm just not familiar with it. It doesn't actually seem like that bad of an idea considering the fairness/balance of games. Some hosts do balance that way, more often with vets rather than good players but the idea remains the same, I don't condone it but some do. Hm. Isn't it better if not all the veteran players are on the same team? Pure randomness could produce games where one of the teams never stood a chance, I'd think? You would think that but individual play is what wins and loses games, sometimes vets rotfl stomp newbies (fruity) and sometimes newbies destroy vets (les mafia). I prefer these random draws because it gives town one less thing to game, there is already setup speculation and I personally find vet balance speculation totally worthless because it is not mafia.
Also because RNG is king and we must bow down to it
|
On February 17 2014 11:58 Promethelax wrote:Show nested quote +On February 16 2014 20:03 Xatalos wrote:On February 14 2014 11:32 Promethelax wrote:On January 27 2014 04:56 Xatalos wrote:On January 27 2014 00:43 raynpelikoneet wrote: I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand. That's an interesting example. I agree that it gets harder for Mafia if everyone is playing "perfectly". On the other hand, if everyone *is* playing perfectly, then Mafia should be favored, since it would be just random chance to hit Mafia (which is more unlikely). But it's a lot harder for Mafia than for town to really appear town in an environment where every townie appears townish. Setup balance does still play a role and should be focused on - since it's the only truly predictable part of game balance. Another way might be to somehow balance the players (an equal share of "good" players for both teams?), but then that would create a new area of setup speculation  Maybe some hosts already do balancing like this and I'm just not familiar with it. It doesn't actually seem like that bad of an idea considering the fairness/balance of games. Some hosts do balance that way, more often with vets rather than good players but the idea remains the same, I don't condone it but some do. Hm. Isn't it better if not all the veteran players are on the same team? Pure randomness could produce games where one of the teams never stood a chance, I'd think? You would think that but individual play is what wins and loses games, sometimes vets rotfl stomp newbies (fruity) and sometimes newbies destroy vets (les mafia). I prefer these random draws because it gives town one less thing to game, there is already setup speculation and I personally find vet balance speculation totally worthless because it is not mafia.
I can see your point. It's pretty arbitrary to start choosing the roles based on apparent "skill"... Since performance is based on many unpredictable factors (such as IRL issues, available time, player relationships etc.) and it's also weird for the Mafia team to suffer from host preferences. It's just slightly bugging me that some games can have pure veteran/skilled Mafia teams vs pure newbie towns 
In the end, I guess the point is that the better team wins. As long as the role distribution is fair, the game should probably be somewhat fair otherwise as well. Some games are landslide victories, but I don't know what could be done about that. At least it's good that there are Newbie games, invite-only games and other special game types to create more balanced games overall.
|
On February 18 2014 03:04 Blazinghand wrote:Show nested quote +On February 17 2014 11:58 Promethelax wrote:On February 16 2014 20:03 Xatalos wrote:On February 14 2014 11:32 Promethelax wrote:On January 27 2014 04:56 Xatalos wrote:On January 27 2014 00:43 raynpelikoneet wrote: I think the optimal/suboptimal play is the most decideing factor in a game. Agreed, probably impossible to balance since you can't know or predict where the suboptimal play happens (is it going to be mafia, town??) and it's impossible to calculate.
If you look at Really Small mini mafia for example: 1 doctor, 4 VT vs 2 goon (+ instant majority lynch which usually favors mafia). Your program gives the following chances: Town 45.16 % Mafia 54.84 % -> Overwhelming town victory
After the game i talked with Mocsta about the game. He asked me "how is mafia supposed to win that game?". I don't know, if we assume all the players played as optimally they did in that game, regardless who was mafia i think mafia wouldn't have stood a chance. When townies look town there are no mislynces. So what do you do? You most likely lose because you need to make up things as there is no bad play to punish and good players will see through your bullshit.
So all in all i think the play of players is the biggest factor in games, regardless of the roles, but it is impossible to balance as you can't predict the "level of play" beforehand. That's an interesting example. I agree that it gets harder for Mafia if everyone is playing "perfectly". On the other hand, if everyone *is* playing perfectly, then Mafia should be favored, since it would be just random chance to hit Mafia (which is more unlikely). But it's a lot harder for Mafia than for town to really appear town in an environment where every townie appears townish. Setup balance does still play a role and should be focused on - since it's the only truly predictable part of game balance. Another way might be to somehow balance the players (an equal share of "good" players for both teams?), but then that would create a new area of setup speculation  Maybe some hosts already do balancing like this and I'm just not familiar with it. It doesn't actually seem like that bad of an idea considering the fairness/balance of games. Some hosts do balance that way, more often with vets rather than good players but the idea remains the same, I don't condone it but some do. Hm. Isn't it better if not all the veteran players are on the same team? Pure randomness could produce games where one of the teams never stood a chance, I'd think? You would think that but individual play is what wins and loses games, sometimes vets rotfl stomp newbies (fruity) and sometimes newbies destroy vets (les mafia). I prefer these random draws because it gives town one less thing to game, there is already setup speculation and I personally find vet balance speculation totally worthless because it is not mafia. Also because RNG is king and we must bow down to it
RNG
|
|
I made a small update to the program based on a problem we encountered during the pre-game of I'm a cop you idiot mafia 2.
Basically the method for calculating Mafia's fastest possible victory was flawed. Now it should be fixed - or at least the setup for I'm a cop you idiot mafia 2 produces the right result for Mafia's fastest possible victory (as well as a couple of larger setups I tested). Enjoy!
https://www.dropbox.com/s/zb7oxzsz177h4f7/Mafia_Balance_Tester.jar
|
Also, I've been thinking of possibly creating a utility website for Mafia. It could possibly have features such as these:
1) A simple balance tester (similar to this one that I have currently as a Java program - but naturally usable without installing anything and even usable on mobile devices) 2) A C9++ setup speculation calculator (which setups are possible with the currently revealed roles?) 3) A place for storing notes about players (kind of like Google Spreadsheet but focused on this kind of note-making) 4) A player relationship analyser (the user would input his/her opinion about various relationships between the players - like two players being against each other and thus less likely to be of the same alignment, or two players agreeing about something meaningful and thus more likely to be of the same alignment - and then the algorithm would present the most likely Mafia teams and other things such as "town circles" etc.)
I've never used much of JavaScript/PHP before though, only some basic HTML. That's why this might not be a project for the immediate future. In any case, it might be an interesting project (maybe for summer?) to learn new stuff as well. So here are some questions:
1) What do you think about the general idea of such a website? 2) Which features would be most useful? The current possible ideas or something else? 3) How important is the appearance of the website? Should it be pretty basic or should I focus on making it look good/modern?
|
/bump
Maybe somebody will have an opinion
|
Blazinghand
United States25550 Posts
I think that would be cool! Unfortunately I haven't gotten a chance to check out the Automatic Balance Tester but I'll run my next normal mini through it and let you know what I think
|
OK. It's probably better to introduce yourself to the Java program first before commenting on an expanded website project.
|
I like the general idea. The c9++ speculation calculator won't be that useful for TL mafia since none of us use the vanilla c9 setup. If it is easy to code it can't hurt but it will not be beneficial to the players in this site.
|
1) Cool! But yeah, it seems like a big project. If you manage to do it alone then awesome! You already have the automatic balance tester written in java. You could use a Java backend, and just integrate the code you already have, and put the same balance tester into the web app.
2)
a)The simple balance tester would be better off in a web app yes I believe. Hell, you can even include links and stuff so hosts and players can easily refer to it in the middle of the game, or in pregame, or stuff like that!
b)Yeah, like Prome said, I dunno how much useful it will be in TL mafia. However, if you talk with other hosts, Foo and shit, it might be the starting point into seeing more vanilla C9++ setups in here, and then it might be more powerful
c)This would be awesome. However, it would need some innovative features and the like if you want to override spreadsheets for the same purpose (or notepads like I use).
d)This might be nice, but I'm not sure exactly how it would work...? This kind of stuff seems too subjective to me. You'd have to come up with a way to configure this "algorithm" to use all the personal subjective tells you use. If not, the algorithm may tell you stuff about certain pairs, that you disagree with. In that case it'd be useless, and maybe annoying ("Damn, this thing keeps telling me these 2 are scumbuddies because they have a town read on each other when it's obviously bullshit, get the fuck off here!")
3) I'd say it's important to have a minimal "visual pleasure". At least in a way that it makes it easier to use. You can use frameworks and stuff that already exist, like Twitter Bootstrap, Foundation 4, HTML Boilerplate, JQuery UI, etc.
|
On March 05 2014 07:05 gonzaw wrote: 1) Cool! But yeah, it seems like a big project. If you manage to do it alone then awesome! You already have the automatic balance tester written in java. You could use a Java backend, and just integrate the code you already have, and put the same balance tester into the web app.
2)
a)The simple balance tester would be better off in a web app yes I believe. Hell, you can even include links and stuff so hosts and players can easily refer to it in the middle of the game, or in pregame, or stuff like that!
b)Yeah, like Prome said, I dunno how much useful it will be in TL mafia. However, if you talk with other hosts, Foo and shit, it might be the starting point into seeing more vanilla C9++ setups in here, and then it might be more powerful
c)This would be awesome. However, it would need some innovative features and the like if you want to override spreadsheets for the same purpose (or notepads like I use).
d)This might be nice, but I'm not sure exactly how it would work...? This kind of stuff seems too subjective to me. You'd have to come up with a way to configure this "algorithm" to use all the personal subjective tells you use. If not, the algorithm may tell you stuff about certain pairs, that you disagree with. In that case it'd be useless, and maybe annoying ("Damn, this thing keeps telling me these 2 are scumbuddies because they have a town read on each other when it's obviously bullshit, get the fuck off here!")
3) I'd say it's important to have a minimal "visual pleasure". At least in a way that it makes it easier to use. You can use frameworks and stuff that already exist, like Twitter Bootstrap, Foundation 4, HTML Boilerplate, JQuery UI, etc.
1) Yeah, it's a big project (and I'm not certain if it will come true). It'll especially take more work since I've barely touched web technologies and I already had some experience with Java when I started making the Java program... But I'll have a course about web technologies (among other things) soon and that should help a bit too.
I'm not really familiar with using Java in that way. Would the user still need to install JRE? Or would the Java code be only on the background? Naturally it would be easier to use anyways without needing to install the Java program itself.
2) a) Yeah, it's definitely better as a web app It's also pretty much the starting point of this idea.
b) It seems pretty rare, yeah. I think I've seen it in a couple of games though (like this one: http://www.teamliquid.net/forum/mafia/434723-newbie-mini-mafia-li). It doesn't seem very complicated to implement, but I can't be sure until I try. Probably I'll at least test out the idea.
c) Yeah, it's not that easy to make it the "ultimate" solution - and if it's not, then what's the point? I guess the advantage would be to be the only "specialized" tool, but still, it would have to be made from scratch compared to the long histories of the existing tools.
d) This is surely the hardest idea to implement It would require a very intelligent algorithm to work (and preferably one that would develop based on the user as well) so it might just be a theoretical idea.
By the way, I'd appreciate completely new ideas as well. I'm not sure what all could be possibly needed in a multi-purpose Mafia tool 
3) Probably it's the easiest solution to use some kind of an interface package, yeah. I'll probably use something like that.
|
kitaman27
United States9244 Posts
Ultimately, I'd focus on things that you're interested in learning and if you happen to produce something useful, then that's a nice bonus. I think the time you spend on 2) or 3) would likely exceed the amount of time you would save others in the long run, but that's not necessarily a bad thing if you get the experience out of it. In my opinion, number 1) would probably get the most use.
Number 4) seems a bit too ambitious, although it does remind me of a tool that someone posted a few years back. Someone apparently attempted to write an program that would identify mafia based on the size, frequency, and format of their posts and the vocabulary that they used.
|
On March 06 2014 06:26 Xatalos wrote:Show nested quote +On March 05 2014 07:05 gonzaw wrote: 1) Cool! But yeah, it seems like a big project. If you manage to do it alone then awesome! You already have the automatic balance tester written in java. You could use a Java backend, and just integrate the code you already have, and put the same balance tester into the web app.
2)
a)The simple balance tester would be better off in a web app yes I believe. Hell, you can even include links and stuff so hosts and players can easily refer to it in the middle of the game, or in pregame, or stuff like that!
b)Yeah, like Prome said, I dunno how much useful it will be in TL mafia. However, if you talk with other hosts, Foo and shit, it might be the starting point into seeing more vanilla C9++ setups in here, and then it might be more powerful
c)This would be awesome. However, it would need some innovative features and the like if you want to override spreadsheets for the same purpose (or notepads like I use).
d)This might be nice, but I'm not sure exactly how it would work...? This kind of stuff seems too subjective to me. You'd have to come up with a way to configure this "algorithm" to use all the personal subjective tells you use. If not, the algorithm may tell you stuff about certain pairs, that you disagree with. In that case it'd be useless, and maybe annoying ("Damn, this thing keeps telling me these 2 are scumbuddies because they have a town read on each other when it's obviously bullshit, get the fuck off here!")
3) I'd say it's important to have a minimal "visual pleasure". At least in a way that it makes it easier to use. You can use frameworks and stuff that already exist, like Twitter Bootstrap, Foundation 4, HTML Boilerplate, JQuery UI, etc. 1) Yeah, it's a big project (and I'm not certain if it will come true). It'll especially take more work since I've barely touched web technologies and I already had some experience with Java when I started making the Java program... But I'll have a course about web technologies (among other things) soon and that should help a bit too. I'm not really familiar with using Java in that way. Would the user still need to install JRE? Or would the Java code be only on the background? Naturally it would be easier to use anyways without needing to install the Java program itself.
1)The user only interacts with the web app via the browser. He doesn't need anything else. The Java stuff is in your own server (YOU would need JRE in there, as well as maybe some web server and stuff like Tomcat/Jetty/JBoss/Glassfish/etc) That is if you made your code so the logic is independent of the UI. In that case you just copy+paste the code to your server. If you made it intertwined with the UI (if you make calls like "button.AddCallback(..)" and stuff in the middle of the code), then either you refactor it...or yeah start over in another language or whatever.
I tried doing a super ambitious project like a year ago, and knew little of web development like you did (although I did know about Java web technologies). I didn't even start it because it was just so fucking big, and I could not possibly do it alone. Be careful with this kind of stuff, don't make it super ambitious if you are not confident you can pull through. Starting with "baby steps" like you are doing is fine, and I think might be the best option, specially as you get more comfortable with the technologies and the like.
If you are gonna make it, I can help you with advice, telling you how to start, how to set up shit, and the like. Dunno if I can help programming and the like though, I have to see how much free time I have after I get into all my uni courses in the next few weeks. I had planned on investigating some technologies, requirements, etc, to kind of "kickstart" my previous "enormous" project (here: http://www.teamliquid.net/forum/mafia/383168-mafia-system-updates-and-suggestions ). I kind of got "hooked" reading some documentation, examples, guides and the like of some stuff, so I haven't really started anything yet lolol (I have like 15 tabs of different documentation for stuff, which I kind of made my inner goal to read ALL of it before starting ). Dunno, maybe some of that stuff may interest you. Although most of it is heavy read, and heavy "get your hands dirty" kind of stuff if you really want to "get" it.
If you want to make a web application, think about how you want the user to interact with it. You have basically 4 possibilities:
1)It's just static stuff, like a blog (i.e you make the web page beforehand, and nothing changes, there is no interaction with the user, barring some links) 2)It has basic interaction. The user goes to a page, fills a form, then goes to another page and sees the info. 3)Heavy interaction with the user. The user clicks stuff, and other stuff instantly appears in the page. He sees live changes he makes in the page, like having lists and tables and grids and slideshows and insta-loading content, etc 4)You basically have a desktop application running on the web. You have everything you'd ever want as an application: menu, tooltips, context menu (right clicking and getting the popup menu), lots of popup windows, etc. Basically, something like Gmail, Outlook, Google Drive, or "online applications" (online editors, etc)
I think it's kind of important which one you choose, because it basically determines what framework, or models you can choose. If you just want static stuff [1], just go with PHP and some static pages (if you want easy), or ANY other framework If you want the basic stuff [2], you can go with Ruby on Rails, or other frameworks like JEE (the Java one, you could use JSP or JSF), ASP.NET, Play, any MVC framework, etc If you want the more "rich application" stuff [3], you can go with client-side frameworks, like AngularJS, KnockoutJS, Backbone, Ember, etc. You can integrate these ones with the frameworks from [1] or [2]. You could also just use the frameworks from [2], but include lots of AJAX, maybe REST web services, and lots of client-side libraries (like jQuery), to deal with that "dynamism". There are also frameworks that rely on the server more than the client (GWT, Wicket, Lift, JSF works a little bit like it too) that work similarly (i.e, it's more "user interaction" oriented). If you want the "full desktop application look", you can go with ExtJS, and others (basically a huge fucking framework where everything is done for you, and you basically develop it like a desktop application and everything else is done "behind your back").
As you can see, depending on what you want, there are a lot of stuff you may use, and stuff you can and CANT use (at least without some headaches, and lots of time and effort in figuring out how to do so).
Anyways, in terms of where you'd want to start, I'd say [2] fits the bill perhaps. For example, I see the balance tester, the "notes" thing, etc, as a user just filling forms and the like. Not much interaction needed. Plus, these frameworks are the "friendliest" ones, for example Rails. They have bigger communities, more examples, more guides, more walkthroughs, more intuitive designs, are easier to figure out, etc. Stuff from [3] and [4] I believe might be too much out of your comfort zone (they basically are new paradigms and ways to look at web development, and you may need to learn OTHER technologies on top of those to make any use of them, and learn how to integrate them, and that's harder than the [2] frameworks). Also stuff from [4] (like ExtJS)....basically costs a lot. Although if you have 1000 dollars to spare, then be my guest and try it! :D
...anyways meh now you notice why I read so much of this stuff and do so little 
c) Yeah, it's not that easy to make it the "ultimate" solution - and if it's not, then what's the point? I guess the advantage would be to be the only "specialized" tool, but still, it would have to be made from scratch compared to the long histories of the existing tools.
If you are interested in the "spreadsheet for players to use notes, and maybe other stuff", you might be interested in my Mafia Spreadsheet project: http://www.teamliquid.net/forum/mafia/445046-the-mafia-spreadsheet
I plan on having that kind of "ability for players to take notes" stuff into it in the future (when in the future....I don't know). Wouldn't mind new people to help me with it 
But other than that, yes, I think you'd need a specific idea you want to implement to make use of that "stuff for players to take notes". Notice that you have to keep track of all games, all players from each game, what happens in each cycle (if a player dies, you should not allow another player to make notes on him for instance). Also you need to make sure your users (guys that log in to the system) are the players of the game perhaps. Or alternatively just leave everything as vague as possible, like just a plain text sheet for them to write. But then again the more vague and "feature-less" you go, the less power your solution has over other "plain" solutions (like any normal spreadsheet or notepad file).
d) This is surely the hardest idea to implement  It would require a very intelligent algorithm to work (and preferably one that would develop based on the user as well) so it might just be a theoretical idea.
Seems to me it's quite heavy on the theoretical side yes. Hmm, my best bet would be to leave it be for now. I mean, you are treading onto AI territory here. Not only that, but on Mafia AI territory and theoretical analysis. That's like.....a sector that there is ZERO info, development, etc about in the whole universe. If you do something like that you'd be the first one in history to do so and would be a fucking pioneer lol. But you'd need to post like 10 research papers to MIT and Harvard before proceeding I believe 
I mean, if you want to make a simple one then it's okay, go ahead. I mean stuff like kita's "Combinatronics" or whatever, where you just pair up players, and let the player himself determine what he thinks of those pairs ("is it a likely scum pair or not?"). That works. Hell, kita will love you if you make a formal hosted Combinatronics thing.
But if you start getting into automated analysis on that kind of stuff (I guess based on posts it automatically reads from the thread? Or from specific input from the user you have to define), then it gets a LOT harder, and yes, maybe too ambitious.
By the way, I'd appreciate completely new ideas as well. I'm not sure what all could be possibly needed in a multi-purpose Mafia tool 
You can check my "Mafia System" thread for ideas if you want ( http://www.teamliquid.net/forum/mafia/383168-mafia-system-updates-and-suggestions ). I posted lots of crazy shit in there lol (like having a self-regulating "TL admin circle" that included the game queue and I dunno what other crazy ambitious obviously-never-going-to-work-unless-I-bring-1000-developers ideas lol).
|
EBWOP:
Also, please don't use PHP
I hate PHP.
Well...you can use it.....but I won't touch it with a 10 foot pole (I seriously hate it. Hell I never even touched PHP code and hate it just by reading about it).
|
On March 06 2014 07:26 gonzaw wrote:Show nested quote +On March 06 2014 06:26 Xatalos wrote:On March 05 2014 07:05 gonzaw wrote: 1) Cool! But yeah, it seems like a big project. If you manage to do it alone then awesome! You already have the automatic balance tester written in java. You could use a Java backend, and just integrate the code you already have, and put the same balance tester into the web app.
2)
a)The simple balance tester would be better off in a web app yes I believe. Hell, you can even include links and stuff so hosts and players can easily refer to it in the middle of the game, or in pregame, or stuff like that!
b)Yeah, like Prome said, I dunno how much useful it will be in TL mafia. However, if you talk with other hosts, Foo and shit, it might be the starting point into seeing more vanilla C9++ setups in here, and then it might be more powerful
c)This would be awesome. However, it would need some innovative features and the like if you want to override spreadsheets for the same purpose (or notepads like I use).
d)This might be nice, but I'm not sure exactly how it would work...? This kind of stuff seems too subjective to me. You'd have to come up with a way to configure this "algorithm" to use all the personal subjective tells you use. If not, the algorithm may tell you stuff about certain pairs, that you disagree with. In that case it'd be useless, and maybe annoying ("Damn, this thing keeps telling me these 2 are scumbuddies because they have a town read on each other when it's obviously bullshit, get the fuck off here!")
3) I'd say it's important to have a minimal "visual pleasure". At least in a way that it makes it easier to use. You can use frameworks and stuff that already exist, like Twitter Bootstrap, Foundation 4, HTML Boilerplate, JQuery UI, etc. 1) Yeah, it's a big project (and I'm not certain if it will come true). It'll especially take more work since I've barely touched web technologies and I already had some experience with Java when I started making the Java program... But I'll have a course about web technologies (among other things) soon and that should help a bit too. I'm not really familiar with using Java in that way. Would the user still need to install JRE? Or would the Java code be only on the background? Naturally it would be easier to use anyways without needing to install the Java program itself. 1)The user only interacts with the web app via the browser. He doesn't need anything else. The Java stuff is in your own server (YOU would need JRE in there, as well as maybe some web server and stuff like Tomcat/Jetty/JBoss/Glassfish/etc) That is if you made your code so the logic is independent of the UI. In that case you just copy+paste the code to your server. If you made it intertwined with the UI (if you make calls like "button.AddCallback(..)" and stuff in the middle of the code), then either you refactor it...or yeah start over in another language or whatever. I tried doing a super ambitious project like a year ago, and knew little of web development like you did (although I did know about Java web technologies). I didn't even start it because it was just so fucking big, and I could not possibly do it alone. Be careful with this kind of stuff, don't make it super ambitious if you are not confident you can pull through. Starting with "baby steps" like you are doing is fine, and I think might be the best option, specially as you get more comfortable with the technologies and the like. If you are gonna make it, I can help you with advice, telling you how to start, how to set up shit, and the like. Dunno if I can help programming and the like though, I have to see how much free time I have after I get into all my uni courses in the next few weeks. I had planned on investigating some technologies, requirements, etc, to kind of "kickstart" my previous "enormous" project (here: http://www.teamliquid.net/forum/mafia/383168-mafia-system-updates-and-suggestions ). I kind of got "hooked" reading some documentation, examples, guides and the like of some stuff, so I haven't really started anything yet lolol (I have like 15 tabs of different documentation for stuff, which I kind of made my inner goal to read ALL of it before starting  ). Dunno, maybe some of that stuff may interest you. Although most of it is heavy read, and heavy "get your hands dirty" kind of stuff if you really want to "get" it. If you want to make a web application, think about how you want the user to interact with it. You have basically 4 possibilities: 1)It's just static stuff, like a blog (i.e you make the web page beforehand, and nothing changes, there is no interaction with the user, barring some links) 2)It has basic interaction. The user goes to a page, fills a form, then goes to another page and sees the info. 3)Heavy interaction with the user. The user clicks stuff, and other stuff instantly appears in the page. He sees live changes he makes in the page, like having lists and tables and grids and slideshows and insta-loading content, etc 4)You basically have a desktop application running on the web. You have everything you'd ever want as an application: menu, tooltips, context menu (right clicking and getting the popup menu), lots of popup windows, etc. Basically, something like Gmail, Outlook, Google Drive, or "online applications" (online editors, etc) I think it's kind of important which one you choose, because it basically determines what framework, or models you can choose. If you just want static stuff [1], just go with PHP and some static pages (if you want easy), or ANY other framework If you want the basic stuff [2], you can go with Ruby on Rails, or other frameworks like JEE (the Java one, you could use JSP or JSF), ASP.NET, Play, any MVC framework, etc If you want the more "rich application" stuff [3], you can go with client-side frameworks, like AngularJS, KnockoutJS, Backbone, Ember, etc. You can integrate these ones with the frameworks from [1] or [2]. You could also just use the frameworks from [2], but include lots of AJAX, maybe REST web services, and lots of client-side libraries (like jQuery), to deal with that "dynamism". There are also frameworks that rely on the server more than the client (GWT, Wicket, Lift, JSF works a little bit like it too) that work similarly (i.e, it's more "user interaction" oriented). If you want the "full desktop application look", you can go with ExtJS, and others (basically a huge fucking framework where everything is done for you, and you basically develop it like a desktop application and everything else is done "behind your back"). As you can see, depending on what you want, there are a lot of stuff you may use, and stuff you can and CANT use (at least without some headaches, and lots of time and effort in figuring out how to do so). Anyways, in terms of where you'd want to start, I'd say [2] fits the bill perhaps. For example, I see the balance tester, the "notes" thing, etc, as a user just filling forms and the like. Not much interaction needed. Plus, these frameworks are the "friendliest" ones, for example Rails. They have bigger communities, more examples, more guides, more walkthroughs, more intuitive designs, are easier to figure out, etc. Stuff from [3] and [4] I believe might be too much out of your comfort zone (they basically are new paradigms and ways to look at web development, and you may need to learn OTHER technologies on top of those to make any use of them, and learn how to integrate them, and that's harder than the [2] frameworks). Also stuff from [4] (like ExtJS)....basically costs a lot. Although if you have 1000 dollars to spare, then be my guest and try it! :D ...anyways meh now you notice why I read so much of this stuff and do so little  Show nested quote + c) Yeah, it's not that easy to make it the "ultimate" solution - and if it's not, then what's the point? I guess the advantage would be to be the only "specialized" tool, but still, it would have to be made from scratch compared to the long histories of the existing tools.
If you are interested in the "spreadsheet for players to use notes, and maybe other stuff", you might be interested in my Mafia Spreadsheet project: http://www.teamliquid.net/forum/mafia/445046-the-mafia-spreadsheetI plan on having that kind of "ability for players to take notes" stuff into it in the future (when in the future....I don't know). Wouldn't mind new people to help me with it  But other than that, yes, I think you'd need a specific idea you want to implement to make use of that "stuff for players to take notes". Notice that you have to keep track of all games, all players from each game, what happens in each cycle (if a player dies, you should not allow another player to make notes on him for instance). Also you need to make sure your users (guys that log in to the system) are the players of the game perhaps. Or alternatively just leave everything as vague as possible, like just a plain text sheet for them to write. But then again the more vague and "feature-less" you go, the less power your solution has over other "plain" solutions (like any normal spreadsheet or notepad file). Show nested quote +d) This is surely the hardest idea to implement  It would require a very intelligent algorithm to work (and preferably one that would develop based on the user as well) so it might just be a theoretical idea. Seems to me it's quite heavy on the theoretical side yes. Hmm, my best bet would be to leave it be for now. I mean, you are treading onto AI territory here. Not only that, but on Mafia AI territory and theoretical analysis. That's like.....a sector that there is ZERO info, development, etc about in the whole universe. If you do something like that you'd be the first one in history to do so and would be a fucking pioneer lol. But you'd need to post like 10 research papers to MIT and Harvard before proceeding I believe  I mean, if you want to make a simple one then it's okay, go ahead. I mean stuff like kita's "Combinatronics" or whatever, where you just pair up players, and let the player himself determine what he thinks of those pairs ("is it a likely scum pair or not?"). That works. Hell, kita will love you if you make a formal hosted Combinatronics thing. But if you start getting into automated analysis on that kind of stuff (I guess based on posts it automatically reads from the thread? Or from specific input from the user you have to define), then it gets a LOT harder, and yes, maybe too ambitious. Show nested quote +By the way, I'd appreciate completely new ideas as well. I'm not sure what all could be possibly needed in a multi-purpose Mafia tool  You can check my "Mafia System" thread for ideas if you want ( http://www.teamliquid.net/forum/mafia/383168-mafia-system-updates-and-suggestions ). I posted lots of crazy shit in there lol (like having a self-regulating "TL admin circle" that included the game queue and I dunno what other crazy ambitious obviously-never-going-to-work-unless-I-bring-1000-developers ideas lol).
That's a really detailed post, thanks! 
The logic classes and the UI classes are separate from each other, yeah. Good to hear that JRE isn't required by the user in that situation. I'll have to take a closer look at how it all works later.
That's indeed a big project you had there :D Did something "usable" come out of it?
I'm not sure if [2] is the way to go. It seems easier, yeah, so it might be a good way to start... But the balance tester basically requires constant changes by the user and it would be harder to use if you had to make a new page for every change. So [3] seems the most fitting choice. Although we'll see, maybe I could try a simpler approach as well (like choosing the roles on the first page and then showing the balance stats on the next page) But then that would be inferior to the desktop application... :/ I guess using the existing program as a Java backend qualifies under [3]?
That spreadsheet project seems interesting. You've clearly put a lot of effort into it already. Actually it might be a better way to approach taking notes than creating a whole new system... Since Google Spreadsheets are already proven to be effective for that purpose and making customized templates / automating the process more within that existing system could be a better solution. Google Spreadsheets also have powerful tools to personalize your notes more to your own liking (and not just strictly follow any set model for taking notes). So the player can basically make use of your tools but not be limited by them in any way compared to just using a plain Google Spreadsheet. Good idea! 
Haha, I didn't really mean to go too far into AI research with that idea... It was just a vague thought about possibly helping in scumhunting (new connections between players, new perspectives etc. based on your own input). What's that kita combinatronics thing? Sounds interesting haha
But yeah, for now this is just more of a possible project and not a concrete plan like I had with the Java program. So that means that its chances of coming true are much, much lower, but you never know, maybe I'll really get into it and learn all that new stuff at the same time 
Btw you talked earlier about making an algorithm to find out the "average" result of a chosen setup. Currently I have an algorithm to find out the "best" results for both sides, which wasn't too hard, but it's quite complicated to find out the average result. Like... 100x more complicated than the best results. At least with more complicated setups. It might be possible for an all vanilla setup, but power roles really make it difficult :D I'm not sure if I'll even be attempting that after all, but maybe some day.
I'll send you the source code of the Java program too. It might be easier for you if you see completely how the program works currently. At least the method names should be well named, but it's probably a bit hard to immediately grasp how everything works, so feel free to ask And suggestions are of course welcome.
|
On March 06 2014 07:27 gonzaw wrote:EBWOP: Also, please don't use PHP I hate PHP. Well...you can use it.....but I won't touch it with a 10 foot pole  (I seriously hate it. Hell I never even touched PHP code and hate it just by reading about it).
LOL Actually the course I'm about to take soon is mostly about PHP and stuff... Well, it's not certain that I will be using it even so
|
On March 07 2014 03:31 Xatalos wrote:. The logic classes and the UI classes are separate from each other, yeah. Good to hear that JRE isn't required by the user in that situation. I'll have to take a closer look at how it all works later.
Oh, that's great. It would also be better if you separated the persistence (store the info in the database). Did you use persistence at all?
That's indeed a big project you had there :D Did something "usable" come out of it?
Ehmm.....no >_> <_< Well, at least all the possible ideas about any possible mafia automated tool is there 
I'm not sure if [2] is the way to go. It seems easier, yeah, so it might be a good way to start... But the balance tester basically requires constant changes by the user and it would be harder to use if you had to make a new page for every change. So [3] seems the most fitting choice. Although we'll see, maybe I could try a simpler approach as well (like choosing the roles on the first page and then showing the balance stats on the next page) But then that would be inferior to the desktop application... :/ I guess using the existing program as a Java backend qualifies under [3]?
Well, yeah, of course. Naturally you want your web app to be as close to [4] as possible, so the user has a better experience using it. But it comes down to complexity, integration with systems and technologies, availability, support, price, etc, etc, that would make you go more towards [1] in the scale.
So you want [3]...hmmm.
Okay, so let's get stuff clear: -You already have your logic for the automatic tester written in java -You want a somewhat reactive and responsive web app (also because your own code is written in a similar way)
Seems to me using JEE, with JSF/Primefaces/Richfaces, and a java web/application server, might be your best bet. However, these technologies are somewhat "verbose", with lots and lots of documentation, and you can get lost. Anyways, here is a good site with tutorials about Java stuff (if any stuff about certain Java technologies popup, go there and see if there are tutorials about it): http://www.coreservlets.com/JSF-Tutorial/
Here is the JSF and Primefaces tutorials: http://www.coreservlets.com/JSF-Tutorial/jsf2/ http://www.coreservlets.com/JSF-Tutorial/primefaces/
Here is the showcase with all the stuff you can use in primefaces: http://www.primefaces.org/showcase/ui/home.jsf
This guy has some nice tutorials on JSF and other java stuff: http://www.mkyong.com/
But first, you need to know about application servers and JEE. This is a good way to start I suppose: http://docs.oracle.com/javaee/7/firstcup/doc/home.htm Full documentation: http://docs.oracle.com/javaee/7/tutorial/doc/home.htm
For that documentation, you can do like I did and just read it for your own amusement (i.e the joy to learn something new). If not you could just jumpstart to some more "get started" tutorials.
Hmm, actually, nevermind. Just skim over the Primefaces and JSF 2.2 stuff. See the examples, see the showcase. See if you like it. After that, if you decide to use it (remember, it has Java on the server, so you can copy+paste your balance tester code, and call its functions from the servlets/beans/etc), we can figure out how exactly you can use it. You could use normal Tomcat, and configure some stuff to be able to use it. Or you could use lightweight JEE servers, like Jetty. Or you could use the full heavyweight JEE stuff like JBoss/Glassfish/others. It's very verbose, and at times gives you headaches, so just start from what you would want to do, and then continue with the lightest stuff possible in a KISS fashion (Tomcat -> Jetty -> JBoss in my opinion).
You have to start investigating on your own though. The Java universe is....well...chaotic in a sense. There is no single guide you can just use and POP you have your perfect web application with everything you want (unlike other frameworks perhaps).
If you don't like JSF nor Primefaces, no worries, we can do other stuff. For example, you can use other JVM programming languages and frameworks. You can use JRuby, Clojure, Scala, Jython, etc, and all the web frameworks they have. Granted, you'll have to learn those as well, but well, learning doesn't hurt. Because they are JVM languages, you can call Java code from them, so you can use your own balance tester code with those.
Haha, I didn't really mean to go too far into AI research with that idea... It was just a vague thought about possibly helping in scumhunting (new connections between players, new perspectives etc. based on your own input). What's that kita combinatronics thing? Sounds interesting haha
It's a thing where you put all possible pairs of players. Imagine there are 2 scum left, and 5 players: A, B, C, D, E. So you put these pairs: A-B, A-C, A-D, A-E, B-C, B-D, B-E, C-D, C-E, D-E.
Then you go "Okay, the pair B-D can't be the remaining scumteam because of reason X, so we take it out". Then you go "Scum pair A-C would make sense as a scumteam yes, we leave it in". In the end, with this process, you are left with some potential mafia scumteams and pairs. You then use those (somehow) to further your reads.
Or just ask kita for more info 
But yeah, for now this is just more of a possible project and not a concrete plan like I had with the Java program. So that means that its chances of coming true are much, much lower, but you never know, maybe I'll really get into it and learn all that new stuff at the same time
If you don't know much about web development and want to make an ambitious project, then yes. But if you start small and slow, then nah.
For instance, why don't you make your 1st step, to just host your balance tester in the web? Forget about the algorithms for scumhunting, the notes, etc. Just take your own code you already made, and figure out how to make it work as a web application.
That is not such a big project, you can do it. Also, when you are done, the rest (specially developing your balance tester) will fall into place much much easier! Like, having your stuff hosted in a web site would mean 99% of hosts would use it. Right now, people have to download a zip file, download JRE or update Java, then run that app. It's too cumbersome. If someone can just fire up a link in a new tab, and start using your tester, it'll be much much more awesome
Also, some other people could give you advice as well on how to do it. Don't blindly follow everything I say...just in case 
Btw you talked earlier about making an algorithm to find out the "average" result of a chosen setup. Currently I have an algorithm to find out the "best" results for both sides, which wasn't too hard, but it's quite complicated to find out the average result. Like... 100x more complicated than the best results. At least with more complicated setups. It might be possible for an all vanilla setup, but power roles really make it difficult :D I'm not sure if I'll even be attempting that after all, but maybe some day.
Yeah, this also seems to go into the "Theoretical Mafia" territory.
Basically, you have a pool of scenarios, which is each exact scenario of how a mafia game turns out (for instance "D1 scum lynch -> N1 town kill -> D2 scum lynch GG" is one scenario, "D1 town lynch -> N1 town kill and another town vig shot -> D2 scum lynch -> N2 town kill -> D3 town lynch GG" is another scenario, etc). This is your "random variable". I.e it's what you want to find the probabilities of. "What is the probability that 1st scenario happens?" Then you group together scenarios into "Town Win", "Mafia Win", "Serial Killer Win", etc. These are new variables, and now you want to find the probabilities of THOSE. In statistics, each random variable has a median, mean/average (could or could not have), variance, etc. So basically you have a complex mechanism to create your first random variable X (those "game scenarios"), based on lynches, night kills, roles, cycles, etc. Then, you have more complex mechanisms to create your other random variables Y,Z,K, etc ("Town Win", etc), based on that first variable X. Then, AFTER figuring all this stuff out, you have to figure out all the properties and shit of them. Either do it mathematically, or statistically with the law of large numbers perhaps, dunno.
....yeah also I most likely fucked up there too. So kind of difficult.
I'll send you the source code of the Java program too. It might be easier for you if you see completely how the program works currently. At least the method names should be well named, but it's probably a bit hard to immediately grasp how everything works, so feel free to ask And suggestions are of course welcome.
Koo'. I'll check it when I have time
|
On March 07 2014 03:33 Xatalos wrote:Show nested quote +On March 06 2014 07:27 gonzaw wrote:EBWOP: Also, please don't use PHP I hate PHP. Well...you can use it.....but I won't touch it with a 10 foot pole  (I seriously hate it. Hell I never even touched PHP code and hate it just by reading about it). LOL  Actually the course I'm about to take soon is mostly about PHP and stuff... Well, it's not certain that I will be using it even so 
Yeah lol like I said don't listen to me 
If you like PHP and already know about it and have courses and shit, use it, no problemo. But I won't be able to help much though (not just because I don't like it, but because I don't know much about it in technical terms, technologies, etc).
|
There's no persistence in the program currently. It's always a clean start every time you launch the program.
Yeah, it's never bad to try something out Maybe someone else can make use of that material (even me possibly).
That's a lot of material :D Thanks for the links! Also it's a good point to start with just getting the Java program working on a website rather than starting with a larger project immediately. That's probably the best way to go about it.
Yeah, that kind of connection elimination is kind of fun You can sometimes nail the Mafia team by eliminating impossible Mafia pairs and being left with at best only one pair.
Your posts have really been a lot more than I hoped for and I'll return to them more closely probably in May. The Java program itself is in pretty good condition right now. Of course it's not perfect (and the execution is far from optimal) but it works, somehow The biggest improvement for it would probably be to make it function on a website rather than as an independent program.
|
kitaman27
United States9244 Posts
On March 07 2014 05:36 gonzaw wrote:It's a thing where you put all possible pairs of players. Imagine there are 2 scum left, and 5 players: A, B, C, D, E. So you put these pairs: A-B, A-C, A-D, A-E, B-C, B-D, B-E, C-D, C-E, D-E. Then you go "Okay, the pair B-D can't be the remaining scumteam because of reason X, so we take it out". Then you go "Scum pair A-C would make sense as a scumteam yes, we leave it in". In the end, with this process, you are left with some potential mafia scumteams and pairs. You then use those (somehow) to further your reads. Or just ask kita for more info 
I think we can all agree that this forum needs more pre-flip association analysis. Don't listen to the haters.
|
On March 07 2014 07:07 kitaman27 wrote:Show nested quote +On March 07 2014 05:36 gonzaw wrote:It's a thing where you put all possible pairs of players. Imagine there are 2 scum left, and 5 players: A, B, C, D, E. So you put these pairs: A-B, A-C, A-D, A-E, B-C, B-D, B-E, C-D, C-E, D-E. Then you go "Okay, the pair B-D can't be the remaining scumteam because of reason X, so we take it out". Then you go "Scum pair A-C would make sense as a scumteam yes, we leave it in". In the end, with this process, you are left with some potential mafia scumteams and pairs. You then use those (somehow) to further your reads. Or just ask kita for more info  I think we can all agree that this forum needs more pre-flip association analysis. Don't listen to the haters.
Yeah, I think this was my greatest moment on TL Mafia http://www.teamliquid.net/forum/mafia/418049-nuclear-winter-mafia?page=115#2289 Go pre-flip association speculation!!!
|
By the way, MajuGarzett was the only scum among those three.
|
Blazinghand
United States25550 Posts
I recommend not-php also.
|
|
Blazinghand
United States25550 Posts
It's actually imo similarly fast to use Python (link) and it's better in several ways. I'd say if your goal is to get something working and you don't care about errors or vulnerabilities, php can definitely do it faster. Php is a little easier to use though so there's that, but then you have to deal with apache (ew ew ew)
|
Python can work.
The problem is that (I assume) he doesn't know Python and needs to learn it, but he does know Java. He also already has the logic written in Java. I checked his code, and the only thing he needs to do is basically keep a "Balance" object in session while the user works on it, and that's it (or if he goes with JEE keep a Balance object in some scope). The only thing he would need to do is create the HTML, set up the server, create a servlet/controller, and add actions that correspond to the actions from the UI he already made. That's it, he only does that and he has everything else done. I think getting to know a little bit of the Java backend ecosystem is worth it just for that "the web app is already made" feeling.
Also, checked your code... .....ahh, the "implement everything from 'equals' to 'hashcode' to 'toString' just to have a minimal class" problems of Java. And to think that in Scala you could use just 3 lines:
case class Role(name: String, balanceValue: Double, team: Int) extends Ordered[Role] { def compare(that: Role) = if (this.team == that.team) (this.balanceValue - that.balanceValue) else (this.team - that.team) }
|
Sometimes, when I think I know things, I read one on gonzaw's walls of text about programming. Just to remind myself I don't know anything.
|
You can have a similar effect by just reading my posts in any mafia game 
EDIT: If that effect was "have an aneurism" of course
|
But I don't read those so I'm okay.
|
On March 07 2014 11:56 gonzaw wrote:Python can work. The problem is that (I assume) he doesn't know Python and needs to learn it, but he does know Java. He also already has the logic written in Java. I checked his code, and the only thing he needs to do is basically keep a "Balance" object in session while the user works on it, and that's it (or if he goes with JEE keep a Balance object in some scope). The only thing he would need to do is create the HTML, set up the server, create a servlet/controller, and add actions that correspond to the actions from the UI he already made. That's it, he only does that and he has everything else done. I think getting to know a little bit of the Java backend ecosystem is worth it just for that "the web app is already made" feeling. Also, checked your code... .....ahh, the "implement everything from 'equals' to 'hashcode' to 'toString' just to have a minimal class" problems of Java. And to think that in Scala you could use just 3 lines: Show nested quote +case class Role(name: String, balanceValue: Double, team: Int) extends Ordered[Role] { def compare(that: Role) = if (this.team == that.team) (this.balanceValue - that.balanceValue) else (this.team - that.team) }
Heh. To be fair I used Eclipse's "Insert Code" for many of the more mundane methods such as getters, setters, constructors etc. so it wasn't that annoying.
Yeah, I don't really know Python. I guess it wouldn't be that hard to learn it, but naturally I would prefer to use the current logic if possible 
Thanks for all the advice! I'll probably start with the project sometime relatively soon, probably before summer. Not sure how large it'll become but at least getting the current balance tester to work as a web app seems feasible.
|
|
|
|