-
Notifications
You must be signed in to change notification settings - Fork 63
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
Adjust global rating with ranked matchmaker games #845
Comments
Why do you want to use normalized mean changes in Proposal 1? Let's say you have I would just do the following: |
Well in proposal 2 you can also add the same rule for only making the rating change if the displayed rating increases. I'm a little hesitant to do too much weird arbitrary stuff with the ratings, as that goes further and further outside of what trueskill is actually designed for, and I'm kindof worried that we're just going to break it entirely. That's why I actually like something like proposal 2 where we just continue to use the trueskill library to figure out the rating changes for us. |
Sounds good. If we properly limit the scenarios when the computation will be actually applied, I think we can do it that way. Don't know if that is an error, but Proposal 2 specifies to only use the global mean. For it to really make sense it should use the whole global rating for the adjustment calculations. |
So a problem with proposal 1 (admittedly rare now but this is absolutely going to be something people abuse once the system is figured out) is that normalization really starts messing with things when data is too divergent. Take a new player that is REALLY bad but REALLY stubborn and keeps playing ladder (or a person that is intentionally trying to manipulate the system). (1500, 500) or 0 shown rating = global he wins his next game (40,195) or -545 shown rating With normalization for mean (40-5/5) you get 7. |
The normalization isn't applied in that case because the shown rating is lower than the shown global rating. |
No, the normalization is thrown out if the adjustment caused a decrease in the shown global rating in the after period. My example does not: 9037 > 0. Ah I see, I skipped the final check. My bad. |
Ok no I'm confusing myself now, it would be (1,500 + 10,500, 500 - 12.5) or (12,000, 487.5) which is 10,537.5 which doesn't get discarded as it's greater than 0. |
There are two checks. The first check is if the after of the ladder is greater than the before of global.
So in your example since -545 is less than zero nothing is changed in global according to proposal 1. |
It seems like regardless of the algorithm used to determine the new global rating we want the same constraints for actually saving it: global lower than the matchmaker rating, positive displayed rating change, and only up to a certain rating limit. Edit: I played around with some trueskill calculations and it seems to work very nicely. |
* Refactor player rating queries to fetch all players in the game * Refactor connection acquisition to reuse connections more * Refactor persistence to use executemany * Update global ratings when playing matchmaker games * Refactor game rating adjustment to use trueskill * Refactor `Rating` to server.ratings * Refactor GameRater to rate a game multiple times with different ratings * Add tests for rating adjustment * Add type annotations to Search * Refactor initialization checking and rating_type checking * Refactor rating adjustment and initial rating creation * Add constraint that global must be lower than matchmaker to be adjusted * Refactor newbie ratings to constants
Now that we're adding a number of different matchmakers, we want to make it so that new players can use the matchmaker to establish a global rating for themselves. To do this, we want to apply rating changes from the matchmaker back to global, but only if the rating changes are positive (to prevent rating manipulation and other issues).
The way it would work is:
Proposal 1
Whenever a game is rated and the rating used is not global and not hidden, then compute the normalized adjustment made by trueskill to the rating i.e. `(after_mean - before_mean) / before_mean` and `(after_dev - before_dev) / before_dev)`. If the new displayed rating is higher than the displayed global rating, compute the adjusted global rating by applying the normalized changes to the global rating, scaled by the global rating i.e. `global_mean += global_mean * normalized_mean_change` and `global_dev += global_dev * normalized_dev_change`. If the displayed adjusted global rating is higher than the displayed old global rating, save the rating adjustments, otherwise leave the global rating unchanged.Example 1
Suppose a player's global rating and matchmaker ratings are both
(1500, 500)
and they LOSE a matchmaker game where their new rating returned by trueskill is(1400, 400)
. Since the new displayed rating(1400 - 3 * 400) = 200
is higher than the displayed global rating(1500 - 3 * 500) = 0
, we perform the adjustment as follows:(1400 - 1500) / 1500 = -0.067
(400 - 500) / 500 = -0.200
.1500 * -0.067 = -100
500 * -0.200 = -100
The adjusted global mean is then computed to be
(1500 - 100, 500 - 100) = (1400, 400)
which is displayed as200
. Since this is higher than the original displayed global rating0
, the global rating adjustments are saved.Example 2
Suppose a player's global rating is
(1000, 150)
and their matchmaker rating is(1200, 100)
and they WIN a matchmaker game where their new rating returned by trueskill is(1205, 95)
. Since the new displayed rating(1205- 3 * 95) = 920
is higher than the displayed global rating(1000 - 3 * 150) = 550
, we perform the adjustment as follows:(1205 - 1200) / 1200 = 0.0042
(95 - 100) / 100 = -0.0500
.1000 * 0.0042 = 4.2
150 * -0.0500 = -7.500
The adjusted global mean is then computed to be
(1000 + 4.2, 150 - 7.500) = (1004.2, 142.500)
which is displayed as567.2
. Since this is higher than the original displayed global rating550
, the global rating adjustments are saved.Example 3
Suppose a player's global rating is
(1000, 150)
and their matchmaker rating is(1200, 100)
and they LOSE a matchmaker game where their new rating returned by trueskill is(1195, 105)
. Since the new displayed rating(1195 - 3 * 105) = 880
is higher than the displayed global rating(1000 - 3 * 150) = 550
, we perform the adjustment as follows:(1195 - 1200) / 1200 = -0.0042
(105 - 100) / 100 = 0.0500
.1000 *- 0.0042 = -4.2
150 * 0.0500 = 7.500
The adjusted global mean is then computed to be
(1000 - 4.2, 150 + 7.500) = (995.8, 157.500)
which is displayed as523.3
. Since this is lower than the original displayed global rating550
, the global rating adjustments are discarded.Proposal 2
Whenever a game is rated and the rating used is not global and not hidden, then compute the adjusted global mean by replacing the player's non-global rating with the global mean in the call to the trueskill rating adjustments.Scenario 1
Suppose a player's global rating and matchmaker ratings are the same, then the new global rating will exactly equal the matchmaker rating, as the call to trueskill is unchanged.
Scenario 2 (1vs1)
(800, 150)
displayed350
(1000, 150)
displayed550
(800, 150)
displayed350
Player WINS:
(848.918, 143.182)
displayed419
(1031.924, 144.475)
displayed598
Player LOSES:
(751.082, 143.182)
displayed322
(931.189, 142.189)
displayed505
The text was updated successfully, but these errors were encountered: