-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Role Distribution: Add options for "derandomization" for perceptually fairer distributions #1561
Conversation
This looks really nice. I will look at it depth as soon as I've got time! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very very much for the work!
And for diving deep into the role selection that is some good amount of work!
Love how this is kept simple and how you added comments, followed stylua etc to match the codebase!
Good Job!
I only have some comments we need to discuss but otherwise this is looking very good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the very late reply. I was very busy with life and work. Thank you so much for your contribution. Besides some small nitpickings and the naming issue saibotk mentioned, this looks really good to me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is fine now. After reading your in-game texts I also think that your name is fitting. It doesn't really matter
@nike4613 From my POV it is finished. Let me know if you agree with the changes before I merge it |
Looks fine to me. |
Randomness is bursty. Given a fair random roll, it is possible (fairly likely even) that consecutive rolls will be close to each other in value. However, we humans, with our pattern-seeking brains, see that as a pattern, and think "that must be wrong".
Rather famously, a good music shuffle is not truly random. We can see a similar problem in TTT rounds; over some sessions, some players can consistently get traitor-aligned roles, and others consistently get innocent-aligned roles. Even though it is "fair" in that it is truly random, it does not feel good to be that guy who hasn't played traitor for the past two and a half hours, while another player has gotten it multiple times on every map.
This pull request aims to give server admins options to be able to fix this problem.
The problem of shuffling a playlist is different enough from the problem of selecting roles, so we take a different approach than is laid out in that post. The broad algorithm is this:
ttt_role_derandomize_min_weight
.ttt_role_derandomize_min_weight
.The end result of this system is that players who have not gotten a role in several rounds are more likely to be selected for that role. How much each round affects that weighting can effectively be controlled by adjusting the minimum weight, with a higher minimum weight causing each round to have less effect.
The one downside of this system is that it can enable players to metagame, and guess "player A hasn't been traitor for 4 rounds, they're quite likely to be it now", which is why this mode is off by default. A note to this effect is also included in the help text in the UI for server owners. I do not believe that this should be a blocker, however: an appropriate choice of minimum weight can minimize the ability of a player to do that, and for private servers, the players can simply agree to not do that. In those cases (particularly the latter), this change could be a significant improvement over the current role distribution.
As implemented right now, the weights ALWAYS reset on map-change. I'd like to provide options to enable it to persist across map changes, possibly even with an option preventing it from persisting across sessions. I don't know what a good way to do this would be though. Any suggestions?