Skip to content

Conversation

@MaximumADHD
Copy link

@MaximumADHD MaximumADHD commented Nov 13, 2025

This pull request attempts to implement a solution for keeping party members on the same team in casual matchmaking.

As of now, the auto-balancing system actively disregards parties and will often yank members of your party over to the opposite team. This was especially frustrating during the halloween event when we were trying to complete quests as a group and suddenly our contract points were not being counted as a group.

What was changed

I added a bool argument bKeepPartiesOnSameTeam to CTFAutobalance::FindNextCandidate, which disqualifies players in a party of two or more from being selected as a candidate for auto-balancing when CTFParty::GetKeepPartyOnSameTeam() is true. I also added a new bool to the protodef message CTFGroupMatchCriteriaProto called keep_party_on_same_team, which is controlled by the corresponding checkbox in the matchmaking settings. It is also hooked up to the existing ConVar tf_party_keep_on_same_team, which now functions with a default value of 1.

The logic in CTFAutobalance::FindCandidates now runs FindNextCandidate up to two time each pass:

  • Once to find someone who is either not in a party, or a member in a party that is okay with being put on the other team.
  • If the criteria above fails, auto-balance will have no choice but to force a party to be split.

Potential Issues

This change may conflict with the skill-based design intent of auto-balance, but I think it would provide a better user experience for groups of friends playing TF2. Ultimately it's up to the discretion of the TF team, but I hope the concern I've brought up to necessitate this change is considered.

I also don't have a good testing suite to see if this change is effective, but it does compile and I believe it should work as intended.

@MaximumADHD MaximumADHD changed the title When auto-balancing, prioritize players who aren't in a party as candidates first. [TF2] When auto-balancing, prioritize players who aren't in a party as candidates first. Nov 13, 2025
@Platina6978
Copy link

Exactly this right here!

Even outside of halloween it is very frustrating to party up with your friends, queue for a game and then have your party broken up as soon as there is team inbalance. There's no ad-hoc connection possible so either requeueing (spending more time in the menu rather than playing together) or waiting for the map to end are your only options.

Even if it is against the skill-based design of autobalance, I think it is fair to say that system has long stopped working properly anyway, as most people will run into completely one-sided stomps 95% of the time they play the game regardless.

@JoriKos
Copy link
Contributor

JoriKos commented Nov 13, 2025

Would this be fully implemented with the checkbox in the matchmaking settings? It seems weird to have this as a setting labeled 'coming soon' (and also it's preferable as a setting you can toggle) while also implementing it as a base thing already.

@MaximumADHD
Copy link
Author

Would this be fully implemented with the checkbox in the matchmaking settings? It seems weird to have this as a setting labeled 'coming soon' (and also it's preferable as a setting you can toggle) while also implementing it as a base thing already.

Which checkbox are you referring to? I haven’t seen that before.

@JoriKos
Copy link
Contributor

JoriKos commented Nov 13, 2025

Press on a party member slot > Matchmaking Settings > this menu
afbeelding

@MaximumADHD
Copy link
Author

I see. I think this change falls outside the scope of that unimplemented feature, unless you are suggesting that parties should have the option to specify whether they are okay with being split up by auto-balance? The scope of the pull request is just targeting the auto-balance behavior during live matches.

@JoriKos
Copy link
Contributor

JoriKos commented Nov 13, 2025

Yeah IIRC this feature is generally interpreted as autobalance not splitting up parties. To me that means this PR is close to implementing this behaviour, but without the checkbox. Alternatively the checkbox could simply be removed, but I think it is preferred if it stays as an option to toggle that's on by default.

@MaximumADHD
Copy link
Author

MaximumADHD commented Nov 13, 2025

Ah okay hang on, I was focusing too much on the bottom checkbox because I thought that’s what you were hovering over, I see what you’re referring to now. I’m blind.

I wonder if there’s a reason they didn’t implement it? Clearly it was considered, and it doesn’t seem to be too difficult to support. I think I just need to integrate the boolean flag into the CTFParty class somehow.

@MaximumADHD MaximumADHD marked this pull request as draft November 13, 2025 13:15
@JoriKos
Copy link
Contributor

JoriKos commented Nov 13, 2025

I wonder if there’s a reason they didn’t implement it?

I imagine it has something to do with the major lack (pun not intended) of major updates, so they likely don't see it as a priority.

@MaximumADHD MaximumADHD marked this pull request as ready for review November 13, 2025 21:14
@MaximumADHD MaximumADHD changed the title [TF2] When auto-balancing, prioritize players who aren't in a party as candidates first. [TF2] Implement "Keep party members on the same team" in matchmaking settings. Nov 13, 2025
@MaximumADHD
Copy link
Author

Alright, I added a bool flag to CTFGroupMatchCriteriaProto called keep_party_on_same_team which is synchronized with the server through the existing party settings logic. I've updated the original title and description to reflect what this pull request is now.

@gaelcoral
Copy link
Contributor

To be honest, I see the "Keep party members on the same team" option more as something that applies when queueing as a party. For example, if your party has six members and the option is disabled, the matchmaker can place some of your party members on the opposite team. This PR isn't related to that behavior at all. Still, I think having "Keep party members on the same team" implemented (the way I described) could help reduce queue times though who knows if people would find a way to abuse it.

My hot take: I'm against disabling autobalance for party members. I've noticed that matches become extremely unbalanced when there are parties involved, and in theory autobalance is supposed to help with that. (Autobalance looks for a player with a compatible MMR; it's not random, I've verified this.) But then there's the exploit where players use the "retry" command to avoid being switched, which leads to parties steamrolling matches. In my opinion, Valve should fix the retry exploit to prevent this.

I also understand that players don't want to be switched because they won't earn contract points on the opposite team. The only real solution would be for the Friendly-Fire system to still work even when a party member gets switched to the other team. Obviously without duplicating contract points (if your friend kills you to "help" it just wouldn't count).

@gaelcoral
Copy link
Contributor

Even if it is against the skill-based design of autobalance, I think it is fair to say that system has long stopped working properly anyway, as most people will run into completely one-sided stomps 95% of the time they play the game regardless.

To be honest, the game modes that use VScript and do team scrambling (ZI & VSH) end up messing up a lot of players MMR. There's basically a 50/50 chance of gaining or losing MMR for no real reason, just because a band-aid fix was added so those modes would work.

This became really noticeable during Scream Fortress 2024 and 2025, where ZI is very popular (btw, it's a good game mode) and players don't even notice that their MMR is being affected + with MMR decay, because many players return to play, it makes the problem worse.

@Generalisk
Copy link

it's... beautiful 🥲

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants