-
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
Implement Algorithm for party matching #727
Comments
A few things: It seems to me like this algorithm is broken into 2 separate stages, create teams and then evaluate quality. Since our existing code is already structured like this, all you'd have to do is figure out the "create teams" step for 4v4 (or in general), and our existing algorithm will handle the "evaluate quality" step. Right now we have a special case for creating teams of 2 from parties of 1: server/server/matchmaker/algorithm.py Lines 289 to 308 in 31168aa
As well as a general way to handle any party size but without taking rating into account: server/server/matchmaker/algorithm.py Lines 408 to 418 in 31168aa
As for the algorithm you described, steps 2 and 3 won't work exactly as written. For instance in step 2 you could get a list of parties with sizes like The existing matchmaker code can be found here: server/server/matchmaker/algorithm.py Lines 142 to 160 in 31168aa
It's based on the stable marriage algorithm but modified for simple (undirected) graphs (since game quality is symmetric). |
As I see it we have basically two options. First we could use the general structure of the existing code and generify the "team building" process. So it would look like this: This would be rather fast to implement, but I see the potential issue that we could get games that are not really optimal. This is incompatible with the stable marriage approach. Does it make sense to implement the first algorithm first, to get a working 4v4 queue out fast and then maybe "upgrade" to the second one later? Or should we aim for the second one right away? |
I talked to @BlackYps about how to proceed and we think that the current matchmaker code with the two stages of 1. constructing full-sized teams from parties and then 2. doing 1v1 matching on the full-sized teams is quite complicated and trying to fit his algorithm in that model would be very hacky. I'll make a suggestion for how to refactor the code so that the "queue" logic is separated from the "matchmaker" logic (right now part of the "building teams from buckets" happens in I think it would also be helpful to experiment with different matchmaking algorithms and see how they score against each other, something that's probably better done offline. The only thing missing for that is good data for the input - ideally at every queue pop we would like to save a list of all searches present (their trueskill ratings should be enough) to then use as simulation input. Let me know if you have suggestions :) |
…-for-4v4-party-algorithm
…-for-4v4-party-algorithm
* Split matchmaker.algorithm into stable_marriage and bucket_teams * Make BucketTeamMatchmaker implement Matchmaker * Make Matchmaker reusable Move _register_unmatched_searches into matchmaker_queue, add searches as an argument to Matchmaker.find * Clean up formatting and imports * Clean up unit test imports, run isort again * Add some tests for BucketTeamMatchmaker * Let Matchmaker.find return list of unmatched searches * Add test for failed matching attempts registered when search is canceled and minor changes to satisfy static checkers * Remove unused imports, unused variables * Fix formatting * Issue/#801: Register failed matching attempt when queue is too small * Refactor abstract class with ABC * Use single extend instead of two appends * Use hypothesis.assume to filter out uninteresting test data Co-authored-by: Askaholic <askaholic907@gmail.com>
* Add algorithm for team matchmaking * Fix tests * Calculate deviation based on searches instead of players * Remove redundant code * Sort imports * Change logger string formatting * Use custom exception instead of AssertionError * Improve documentation * Refactor participant picking * Add small code improvements * Refactor _find_most_balanced_filler * Use sortedcontainers package * Fix imports * Refactoring * Improve code style * Reuse teammatchmaker object in tests * Use namedTuple instead of a class for game * Add more tests * Also return unmatched searches * Change bonus calculation * Code style improvements * Add test for game picking * Use boolean in pick_neighboring_players * Fix test for failed matching attempts * Refactor debug messages * Accomodate for changes by rebase * Improve readability without touching the logic * Implement refactor suggestions from reviews * actually use the new fucking code * Sort imports * Tune config values for better results * Add failed matching attempts and newbie status to debug messages * Add sortedcontainers to Pipfile.lock * Make log more readable * Adjust config values * Revert newbie time bonus * Fix outdated doc string * Make pick_neighboring_players static * Improve tests * Update pipfile.lock * Address code review * Reformat search logging code
The planned 4v4 TMM queue needs an algorithm that can match parties of different sizes to create complete teams.
here is an outline how that algorithm could work:
I would assign myself for this, but I am missing the rights in this repo
The text was updated successfully, but these errors were encountered: