fix: balance with premade groups#165
Merged
Merged
Conversation
|
After testing, it doesn't affect normal use. I haven't noticed the author's situation, though. |
Author
|
thanks for your feedback @PkllonG ! |
Nyeriah
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Rework team selection so premade groups don't break balance
Team selection used to go through two separate code paths: a greedy newest-first loop when
CFBG.EvenTeams.Enabledwas off, and the pair-matching InviteSameCountGroups when it was on. Both had problems with premades:without fixing the player count, leaving phantom players behind.
On top of that, the reinforcement path counted groups invited to other BG instances as if they were joining this one, and relied on
GetFreeSlotsForTeam, which withBattleground.InvitationType = 0imposes no relative cap at all.So instead of patching each path separately, both match formation and the join-in-progress fill now go through a single routine (
SelectBalancedGroups) that works in three steps:EvenTeamson, max diff of1otherwise)Groups always stay whole, i.e. a premade never gets split across teams.
That made
InviteSameCountGroups,InviteGroupToBG,CrossFactionQueueInfoand bothGetLowerTeamIdInBGoverloads dead code, hence removed.No config changes; all existing options keep their meaning. The one deliberate behaviour change: above
CFBG.EvenTeams.MaxPlayersThreshold, reinforcement now still keeps teams within 1 player instead of going fully uncapped.Engineered using Claude Fable.