-
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
Issue/#724 generalize rating initialization #740
Issue/#724 generalize rating initialization #740
Conversation
I'm going to change how I'm handling dependency cycles. Instead of disallowing cycles, I'm going to rewrite the code so it only ever looks back 1 step, instead of trying to look back recursively. That way if e.g. global is initialized based on 2v2, and 2v2 based on global, then essentially whichever one gets played first will be used as an initializer for the other. Also need to do this in the rating service as well, since unfortunately this code is duplicated. |
5b5bd65
to
7157b86
Compare
I decided that the desired behavior is actually to initialize ratings recursively, and use the default rating when a cycle is detected. This would both allow dependency chains like:
Given one of the recent client bugs we saw with trying to display map pools when no rating existed, I think it is actually still a good idea to eagerly initialize ratings. However, this can cause a weird scenario where for example the following happens:
In this case the first 2v2 game will be balanced based on outdated info. So I think it would be ideal for the |
7157b86
to
6066548
Compare
Codecov Report
|
6066548
to
916beab
Compare
I think I've implemented everything that I mentioned above.
I also eliminated the duplication by making the rating service use |
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 thought about how we want the dependency chains to be in practice.
I think ideally we would want global <--> 4v4 <--> 2v2 <--> 1v1
. However this requires two references and a way to determine which preference should be preferred, if both exist.
With one reference we can build the chain 1v1 -> 2v2 -> 4v4 -> global -> 2v2
. I think this one will work good enough, so we can save the trouble of implementing the double reference version.
fcf76fe
to
6deb161
Compare
2b894b0
to
19dadf9
Compare
434799c
to
35205a4
Compare
6fca3f5
to
0cc81e7
Compare
0cc81e7
to
b779653
Compare
…bles Leaderboards can now have arbitrary initializers and initialization should happen as expected. Ratings are initialized recursively until either the current rating has no initializer, or a cycle is detected. Any ratings that are implicitly created during this process are marked as transient and will be recomputed whenever they are queried. This ensures we are always using the latest version of the initializer rating when the first rating for a new leaderboard is saved. For instance if tmm_2v2 is initialized from global, and a player new to the matchmaker queues for 2v2, their 2v2 rating will be initialized based on their global rating, and marked as transient. If the player then cancels the queue and plays a bunch of global games (changing their global rating), when they go to queue for 2v2 again, their 2v2 rating will be reinitialized based on the updated global rating (instead of using the cached version). Legacy rating tables were migrated into the new leaderboard_rating table in database migration v98. Therefore we can delete the code that checks those legacy tables.
Deviation will now only be increased once when initializing a long chain of ratings
b779653
to
7ae75a8
Compare
Implement reading the initializer from the database.
One question is whether the
global
andladder_1v1
ratings need to continue to be eagerly created. Right now even completely new players will have a global and ladder rating in theirratings
dictionary, however is this really necessary?Closes #724