Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
About the PR
Replaces the alphabetical tiebreak with a weighted random pick, should add some more variety to what maps get played.
More or less a re-do of #34340, though I'm not actually sure if I want it to use a weighted picker instead of picking randomly from the highest priority maps; Despite calling that variable "weight" the old method never used it as a weight & seemingly never intended to.
Why / Balance
The players on the fork I play on were annoyed by a few maps rolling constantly, so we looked into it & changed it, figured it could be another useful fix / change for upstream.
Technical details
Renames Content.Server.Maps.GameMapManager.GetFirstInRotationQueue() to PickFromWeightedRotationQueue() for clarity.
Makes some changes to above method to make it use a weighted random picker instead of resolving ties alphabetically.
Renames Content.Server.Maps.GameMapManager.GetMapRotationQueuePriority() to GetMapRotationQueueWeight() for clarity.
Adds an overload for Content.Shared.Random.Helpers.SharedRandomExtensions.Pick() that takes a <T, int> dict instead of a <T, float> dict.
Media
n/a
Requirements
Breaking changes
Changelog
n/a (should this have a cl entry? seems small and technical but does affect players)