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

map rotation fix take 2 #34362

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ruddygreat
Copy link

@ruddygreat ruddygreat commented Jan 10, 2025

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)

@github-actions github-actions bot added S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/S Denotes a PR that changes 10-99 lines. labels Jan 10, 2025
@ruddygreat
Copy link
Author

unrelated test fail?

@southbridge-fur
Copy link
Contributor

It seems to be a github issue, but it could also be related to syntax? Try wrapping the lambda in parentheses?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. size/S Denotes a PR that changes 10-99 lines.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants