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

Match newbies randomly #492

Merged
merged 40 commits into from Sep 12, 2019
Merged

Conversation

@cleborys
Copy link
Contributor

cleborys commented Sep 1, 2019

As suggested: match newbie players randomly if the stable marriage didn't match them.

Prefers to match two unmatched newbies with each other before matching with a "normal" player.

cleborys and others added 16 commits Aug 29, 2019
cleborys
#1)

* Matchmaking graph only to include preferred match edges where the match is actually possible as determined by matches_with. _rank_partners still runs in O(n + SM_NUM_TO_RANK log n) but now requires O(n) space, with n the number of total searches.

* typo

* adjusting deviation and rating in test_rank_all unit test such that all matches become possible

* add test for rank_all not including unmatchable games

* Dostya test user in test_server_ban integration test now expected to be banned for 980 years, not 981

* tests on reasonable matchmaking thresholds

* determine base minimum threshold for acceptable matches as 80% of quality of a game against yourself

* increase new player threshold boundary

* test that matchmaker gives high quality games to plawers with low deviation and games of any quality to new players with uncertain rating

* adjust values for base rank_all test so that players are matchable

* unit test typos

* fixed preference order of test_rank_all
…yers and low-dev with low-dev if all share the same mean
Typos
@JaggedAppliance

This comment has been minimized.

Copy link

JaggedAppliance commented Sep 2, 2019

I'm delighted you're working on this

Copy link
Collaborator

Askaholic left a comment

Yea, this will be great. We should try to get this out soon since FTX is reinstating some sort of ladder league system.

As I mentioned in one of the comments, I think there should be a heuristic for matching new players against non-new players to prevent them from getting matched against top pros. See issue #427 which was opened a while ago in regard to poor match quality for new players.

tests/unit_tests/test_matchmaker_queue.py Outdated Show resolved Hide resolved
tests/unit_tests/test_matchmaker_queue_algorithm.py Outdated Show resolved Hide resolved
tests/unit_tests/test_matchmaker_queue_algorithm.py Outdated Show resolved Hide resolved
tests/unit_tests/test_matchmaker_queue_algorithm.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
cleborys and others added 8 commits Sep 3, 2019
Co-Authored-By: Askaholic <askaholic907@gmail.com>
…nto match-newbies-randomly
cleborys added 3 commits Sep 5, 2019
* rename 2500 rated player to top_player

* refactor matchmaker

* adapt tests to new interface for matchmaking policies

* add test that Random Matching produces symmetric outputs

* correct type annotations for MatchmakingPolicies .find methods

* test for matchmaker class

* remove __repr__ method of search
Copy link
Collaborator

Askaholic left a comment

YAPF may be able to clean up some of the formatting automatically. Just be aware that sometimes it does weird things, so it's always good to double check what it did and make sure it actually looks ok.

server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
tests/unit_tests/test_matchmaker_queue.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
server/matchmaker/algorithm.py Outdated Show resolved Hide resolved
@cleborys

This comment has been minimized.

Copy link
Contributor Author

cleborys commented Sep 5, 2019

I'll give YAPF a try! Normally I use black and flake8, but I didn't want to impose their doctrine on all of the codebase... The YAPF approach of optimizing instead of only making it PEP compliant looks nice, too!

cleborys and others added 2 commits Sep 5, 2019
Co-Authored-By: Askaholic <askaholic907@gmail.com>
server/config.py Outdated Show resolved Hide resolved
@Askaholic

This comment has been minimized.

Copy link
Collaborator

Askaholic commented Sep 5, 2019

I haven't heard of black before. The only reason I started using YAPF was because it has a lot of configuration options and I hoped I would be able to configure it to do what I wanted, but that doesn't seem to be the case. What I was really looking for was a formatter that would actually be able to rewrite some of the code by for example converting this:

d = dict(item1=value1, item2=value2)

into this

d = {
    "item1": value1,
    "item2": value2
}

But unfortunately yapf doesn't mess with the token stream. Looks like black does a few things like replacing string literals that use quotes with double quote versions (which I think would be super nice because I always find myself being indecisive over which type of quote to use) so I'll give it a shot.

@Askaholic Askaholic merged commit b04818f into FAForever:develop Sep 12, 2019
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.1%) to 94.041%
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.