Skip to content

Commit ae10f8e

Browse files
committed
Make target_rating_diff an absolute value
1 parent ce68e36 commit ae10f8e

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

config.yml.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ matchmaking:
220220
# multiplier: 15 # Multiplier for calculating timeouts in matchmaking. Default: smart multiplier calculation.
221221
# min_rating_diff: 0 # Minimum rating distance to opponent. Default: 0
222222
# max_rating_diff: 300 # Maximum rating distance to opponent.
223-
# target_rating_diff: -50 # Rating distance to opponent that is challenged first. Default: 0
223+
# target_rating_diff: 50 # Rating distance to opponent that is challenged first. Default: 0
224224

225225
messages:
226226
# Optional substitution keywords (include curly braces):

opponents.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def bot_filter(bot: Bot) -> bool:
9797
return True
9898

9999
def sort_key(bot: Bot) -> int:
100-
return abs(bot.ratings[perf_type] - (user_ratings[perf_type] + matchmaking_type.target_rating_diff))
100+
return abs(abs(bot.ratings[perf_type] - user_ratings[perf_type]) - matchmaking_type.target_rating_diff)
101101

102102
bots = sorted(filter(bot_filter, bots), key=sort_key)
103103
if not bots:

0 commit comments

Comments
 (0)