python-discord / sir-robin

Our event bot, for managing community events.
MIT License
18 stars 14 forks source link

Weigh team chosen for team game towards those with fewer points. #120

Closed swfarnsworth closed 3 months ago

swfarnsworth commented 3 months ago

@hedyhli thought people would stay engaged if the game makes it easier for teams to catch up, so this PR introduces inverse weighting for which team has the opportunity to score points, based on the current scoreboard.

This log output indicates that the algorithm is correct:

 scores = {'list': 0, 'dict': 0, 'tuple': 5}, weights = [0.1923076923076923, 0.1923076923076923, 0.0384615384615
38464]

That is, list and dict are both weighted as more likely to be selected, since they have fewer points than tuple.

thurisatic commented 3 months ago

At roughly this time, with scores of 1700/1586/1201, it should switch probabilities to approximately 28.7%, 30.7%, and 40.6%, respectively, from equal ~33%