TTT-2 / TTT2

Trouble in Terrorist Town 2 for Garry's Mod (gmod)
https://steamcommunity.com/sharedfiles/filedetails/?id=1357204556
178 stars 74 forks source link

Feature Request: Reintroduce role avoidance locked behind server-side configuration #1455

Closed Lixquid closed 7 months ago

Lixquid commented 7 months ago

Is your feature request related to a problem? Please describe.

In #1296, Player-specified Role Avoidance was unilaterally removed with basically no alternative, which was a nasty surprise when we updated our version and all of a sudden players were rolling roles they did not want.

Describe the solution you'd like

The rationale aside, I can understand not wanting to allow clients to "force" certain roles, but I believe it's a mistake to remove the feature entirely. I think the best solution would be to reintroduce Role Avoidance, but behind a server-side convar (defaulting to off), so that server owners can decide whether or not to allow it.

Describe alternatives you've considered

No alternatives are known at this time.

Additional context

Our fork fixes some role priority issues and also harshly reduces the "give it to them anyway" chance that was previously set at 33%, making it significantly less likely for players to get roles they don't want (but still allowing it when necessary).

Histalek commented 7 months ago

To be frank with you, i don't see a future in which we add role avoidance back.

It is just a hassle to get right, it adds quite a lot of complexity to the already complex roleselection process and has various gameplay issues as well.

Regarding alternatives there is still the option to completely redo the selected roles via the TTT2ModifyFinalRoles hook so this could be done through an addon. (or through a fork as you are already doing)

We can maybe accommodate such an addon by adding additional hooks if needed, but that is as far as i would go.

To manage your and everyones expectations i will close this issue as wontfix, but you are welcome to make an argument on how the issues i mentioned above and the issues mentioned in #1296 can be addressed.

Lixquid commented 7 months ago

Thanks for the response. I just thought I'd leave my thoughts on the matter, and what I thought the abstract model was for role selection; if I'm off the mark, I apologize.

I believe the issues with gameplay can be pretty much ignored by making it a server-side convar; base TTT itself allows players to opt-out of the Detective role, and as long as it defaults to off, it shouldn't affect the majority of servers. Only the ones opting in would have to deal with the consequences.

For the technical complexity angle, the way I believed it worked was:

  1. Start of round, number of roles is determined.
  2. Server generates a list of specificroles completely independent of players.
  3. Roles are then matched to players, taking into account karma requirements and role preferences.
    • Deadlocks are resolved by 33% of the time ignoring requirements and preferences anyway.

In which case, adding role preferences would hopefully be a simple matter of reintroducing the role assignment algorithm, rather than just randomly assigning roles. I'm not sure if that's the case, but that's what I believed the model was.

ZenBre4ker commented 7 months ago

@Lixquid You are definitely right with your assumptions about the technical aspect. Its not that difficult to reduce the chance of people getting a specific role or making it an option serverside.

We first implemented it, because TTT allowed it for the detective and so we ported it to TTT2. Then came the question to allow it for more roles, so we did that as well. In the end some wanted to enable it for all roles, which is quite weird avoiding to become traitor or innocent for example. Another problem occured that people claimed that role avoidance is not working. Well to resolve deadlocks we randomly assigned them the roles sometimes anyways. Reducing that chance would only lead to a server taking longer to assign roles. So it was annoying to explain why it's "not working" even if it is. It could be possible to change the role selection so that roles are assigned in 2 rounds. So first assign only non avoided roles, then resolve deadlock and disable role avoidance in a second round. But that leads to an unnecessary complexity for a feature we dont want to support anymore.

In general we had and probably still have unnoticed bugs inside that code. By simplifying it we make sure its always working as intended. Supporting a huge amount of different roles is one of the main features of TTT2 and that should be prioritized IMHO. In my opinion this is not a feature that should be available in a deduction game, but everyone wants something else, so we have no problem to support someone else making an addon for this by adding the necessary hooks or entry points.

Lixquid commented 7 months ago

@ZenBre4ker

Thanks for explaining that.

I shared your concerns when I originally implemented changes, so I'd just like to go through what exactly I did:

I believe this answers most of the technical issues you've highlighted. If the role selection was split into role generation and role assignment, with role assignment being:

This should hopefully keep the complexities localized.

I should mention this isn't pie-in-the-sky theorizing; we implemented these changes and have run them for months, and they completely solved issues with role selection, and still allowed all the same deduction fun as before.