Skip to content
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

Generalize rating initialization based on another rating #724

Closed
Askaholic opened this issue Feb 20, 2021 · 0 comments · Fixed by #740
Closed

Generalize rating initialization based on another rating #724

Askaholic opened this issue Feb 20, 2021 · 0 comments · Fixed by #740

Comments

@Askaholic
Copy link
Collaborator

For 2v2 we wanted players ratings to be initialized based on their global rating, but with a sigma increase. This was hardcoded into the player rating dictionary here:

server/server/rating.py

Lines 39 to 47 in d2265dc

if key == "tmm_2v2" and key not in self:
mean, dev = self[RatingType.GLOBAL]
if dev > 250:
tmm_2v2_rating = (mean, dev)
else:
tmm_2v2_rating = (mean, min(dev + 150, 250))
self[key] = tmm_2v2_rating
return tmm_2v2_rating

For future 3v3+ queues we will want to do a similar thing, so it would be best to fully generalize this process. We should add a field in the database to the leaderboard table that will reference another leaderboard id to initialize from. I think we can leave the sigma increase as it is, hardcoded to +150 sigma with a 250 sigma cap. I don't see a reason why those values would need to be configured in the database; they would only complicate the tables.

@Askaholic Askaholic added this to To do in Team Matchmaker via automation Feb 20, 2021
@Askaholic Askaholic moved this from To do to In progress in Team Matchmaker Mar 14, 2021
Team Matchmaker automation moved this from In progress to Done Aug 28, 2021
Askaholic added a commit that referenced this issue Aug 28, 2021
* Make server shutdown cleaner

* Load leaderboard data from database

* Generalize rating creation based on existing ratings

* Make test complete faster

* Reimplement rating init to detect cycles, and stop checking legacy tables

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.

* Mark explicit initialization of global and ladder as deprecated

* Fix deviation propagation for initialization chains

Deviation will now only be increased once when initializing a long chain of
ratings

Co-authored-by: BlackYps <jonas-fb@gmx.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

1 participant