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

Unequal Role Distribution...? #481

Closed Creyox closed 4 years ago

Creyox commented 4 years ago

Hey,

I noticed that some people (especially me) and another player are very often certain roles. As example, sometimes I get 5 times detective in a row and with 8 to 10 players on a server, the chance is very low for that. Today one other player got traitor in like 60-80 % of the time.

So my point is: Do you have something to do with the role distribution? May the random generator is seeded with nearly always the same value or player names...? I mean, of course, it's possible for this to happen, but it feels like sometimes this "problem" happens very often and at another time it's non-existing. If you're sure it has nothing to do with an unequal distribution of the roles I apologize for wasting your time, but I just had to ask you.

TTT2 Version: v0.6.2b Workshop: https://steamcommunity.com/sharedfiles/filedetails/?id=849222406

Role settings: 20200303225958_1 20200303230007_1 20200303230009_1 20200303230014_1 20200303230016_1 20200303230018_1 20200303230021_1

TimGoll commented 4 years ago

Lua Random is not that random and it can seem as if someone is favorited. However, this is the true nature of random numbers. Random means that it can happen 5 times in a row. There are other randomization algorithms that make sure that there are no same values. However, these are no true random values.

Creyox commented 4 years ago

Yeah of course, but if the random generator is shit and not equally distributed this happens more often. That's all I wanted to know, if it's not a real problem or was just very unlikely

Alf21 commented 4 years ago

Compared to the normal ttt, TTT2 uses a way more often the random function. One way to trouble fix the randomness „bug“ in lua was a randomness warmup we make before each role distribution, calling 3 times the random function. Then we are choosing a random player of all available players and giving him a random role of any available role. If the condition matches or the randomness of 33%, he ist going to receive this new role. Otherwise, the process is repeated. Ref.: https://github.com/TTT-2/TTT2/blob/57781a394f348d7c9e9854295451bc705fc605d6/gamemodes/terrortown/gamemode/server/sv_main.lua#L1591

Alf21 commented 4 years ago

We could think about a similar addition like the ttt traitor weight addon is doing (decreasing the chance of getting a certain role if being it the last round(s))

TimGoll commented 4 years ago

We might as well include this in TTT2 base as well (with the option to disable it) I'd like it at least. For most players it feels more random if you receive a different role each time

Reispfannenfresser commented 4 years ago

This PR might have fixed this issue.

Histalek commented 4 years ago

Good Catch!

I will close this issue as there were PR(s) addressing this issue.

Thank you @Creyox for reporting and please feel free to reopen this if it happens to you again :)