Does this only work if the teams are unbalanced numerically (ie 7 v 5), it doesn't do anything if teams are even or +/-1 right?mutate teams - checks balance, if unbalanced swaps some players. This seems to do the right thing with killing players that have their team changed.
EvenMatchOmni
- pooty
- Posts: 4535
- Joined: Sat Apr 03, 2021 10:22 am
- Location: Michigan
- Server Sponsor: Yes
- Server Admin: Yes
Re: EvenMatchOmni
- captainsnarf
- Posts: 2713
- Joined: Tue Jul 06, 2021 1:51 pm
- Location: Washington
- Server Sponsor: Yes
- Server Admin: Yes
- Contact:
Re: EvenMatchOmni
Yes, that's how it was. Teams were considered balanced if they were numerically even, so I believe nothing happened if you did a teams command. It's a bit more complicated than that but that's the basics of it.pooty wrote: ↑Tue Jan 25, 2022 11:16 pmDoes this only work if the teams are unbalanced numerically (ie 7 v 5), it doesn't do anything if teams are even or +/-1 right?mutate teams - checks balance, if unbalanced swaps some players. This seems to do the right thing with killing players that have their team changed.
I changed it in the new version.
This code is called when you do a teams command
Code: Select all
function bool RebalanceNeeded(optional int SizeOffset, optional out float Progress, optional out byte BiggerTeam)
{
Progress = GetTeamProgress();
return RebalanceStillNeeded(SizeOffset, Progress, BiggerTeam) && IsBalancingActive();
}
I changed the RebalanceStillNeeded() method. If teams had even players it returned false. Before it returned true based on the number of players on the team and the game score. If e.g. red had 3 players and blue had 2 and red was winning than definitely rebalance needed. But if red had 2 and blue had 3 and red was winning, rebalance was based on score and a config 'smallteams' threshold.
Now it returns true if red or blue has more than 100 PPH over the other. It doesn't care if the player numbers are even or game score. This RebalanceNeeded() is just to determine if the teams command does the actual shuffle or not.
- pooty
- Posts: 4535
- Joined: Sat Apr 03, 2021 10:22 am
- Location: Michigan
- Server Sponsor: Yes
- Server Admin: Yes
Re: EvenMatchOmni
Ok, so I think I am confused.
And for everyone else just to be clear the chat 'teams' command right now just balances players based on number of players so none of the discussion here applies, its only to the admin commands:
mutate shuffle - forces immediate reshuffle by PPH/Map. All Players are potentially affected by shuffle_teams()
mutate teams - this is where I am confused, so it balances on num players, but then can also call shuffle_teams()? I am not sure we want that..I mean a that point we could just call mutate shuffle and it would rebalance and fix both number of players and PPH..this seems to do same thing? Meaning if its going to shuffle_teams() if the points are imbalanced, I might as well always be shufflin'
The other item is when new players join even teams, right now I think that's done via UAdminMod, and its more or less Random... rather it joined them based on either progress or PPH (anything better than random).
And for everyone else just to be clear the chat 'teams' command right now just balances players based on number of players so none of the discussion here applies, its only to the admin commands:
mutate shuffle - forces immediate reshuffle by PPH/Map. All Players are potentially affected by shuffle_teams()
mutate teams - this is where I am confused, so it balances on num players, but then can also call shuffle_teams()? I am not sure we want that..I mean a that point we could just call mutate shuffle and it would rebalance and fix both number of players and PPH..this seems to do same thing? Meaning if its going to shuffle_teams() if the points are imbalanced, I might as well always be shufflin'
The other item is when new players join even teams, right now I think that's done via UAdminMod, and its more or less Random... rather it joined them based on either progress or PPH (anything better than random).
- captainsnarf
- Posts: 2713
- Joined: Tue Jul 06, 2021 1:51 pm
- Location: Washington
- Server Sponsor: Yes
- Server Admin: Yes
- Contact:
Re: EvenMatchOmni
Meh, I was confused too. Sorry.
mutate teams doesn't call shuffle_teams(). It calls something else 'ActuallyCheckBalance'. That swaps player too, but has logic to not swap some players ('key' players), and more logic to swap others (people that team switched previously).
mutate teams doesn't call shuffle_teams(). It calls something else 'ActuallyCheckBalance'. That swaps player too, but has logic to not swap some players ('key' players), and more logic to swap others (people that team switched previously).
- pooty
- Posts: 4535
- Joined: Sat Apr 03, 2021 10:22 am
- Location: Michigan
- Server Sponsor: Yes
- Server Admin: Yes
Re: EvenMatchOmni
Okay got it.
I should be able to get 1.2 loaded later today.
I'll try to populate the KnownPlayers with a few well known high end players, give them a mulitple of say 1.2 to start?
I should be able to get 1.2 loaded later today.
I'll try to populate the KnownPlayers with a few well known high end players, give them a mulitple of say 1.2 to start?
- Super Sanka
- Posts: 265
- Joined: Mon Jan 10, 2022 7:12 pm
- Location: Orlando
- Contact:
Re: EvenMatchOmni
Give me low rating pls
- captainsnarf
- Posts: 2713
- Joined: Tue Jul 06, 2021 1:51 pm
- Location: Washington
- Server Sponsor: Yes
- Server Admin: Yes
- Contact:
Re: EvenMatchOmni
Well, the teams command certainly blew up. I'm not sure what happened there. It worked ok when I tried it out locally.
- pooty
- Posts: 4535
- Joined: Sat Apr 03, 2021 10:22 am
- Location: Michigan
- Server Sponsor: Yes
- Server Admin: Yes
Re: EvenMatchOmni
Someone did type the UAdminMod teams at nearly the same time, so might have been an interaction. I'll dig up the log later today.
- pooty
- Posts: 4535
- Joined: Sat Apr 03, 2021 10:22 am
- Location: Michigan
- Server Sponsor: Yes
- Server Admin: Yes
Re: EvenMatchOmni
Ignore IPs they've been redacted
We don't seem to log teams call or mutate teams calls, we should probably add that to the log.
Snarf I can send you the whole log if you'd like, but I don't want to post it because it has IPs in it.
And I should point out I forgot an ending quote in KnownPlayers.ini (that's fixed now) but I don't think that caused to weird balancer condition.
Code: Select all
Log: Garbage: objects: 102277->99022; refs: 1423382
ScriptLog: Using Official Link Setup: Default
ScriptLog: p)o(Oty logged in as p00ty.
NetComeGo: Close TcpipConnection 1.1.1.1:51300 01/28/22 22:32:56
EvenMatchDebug: 431.58 Not enough soft balancing candidates
EvenMatch: Teams are uneven, forced balance in 30s
EvenMatchDebug: 432.61 Not enough soft balancing candidates
...
EvenMatchDebug: 435.58 Initial balancing candidate: Player2
EvenMatchDebug: 435.58 Not enough soft balancing candidates
EvenMatchDebug: 435.58 Additional soft balancing candidate: C@nOnFOndl3r
EvenMatchDebug: 435.58 Additional soft balancing candidate: WebAdmin
Warning: mutTeamBalance ONS-Minus-McLovins-MEGA-ARENA-V7.mutTeamBalance (Function EvenMatchOmni.mutTeamBalance.RememberForcedSwitch:0042) Accessed None 'Team'
EvenMatch: Forced team change: WebAdmin soft-balance at respawn
EvenMatch: Not remembering WebAdmin
....
EvenMatchDebug: 437.60 Initial balancing candidate: Player2
EvenMatchDebug: 437.60 Not enough soft balancing candidates
EvenMatchDebug: 437.60 Additional soft balancing candidate: C@nOnFOndl3r
EvenMatchDebug: 437.60 Additional soft balancing candidate: WebAdmin
Warning: mutTeamBalance ONS-Minus-McLovins-MEGA-ARENA-V7.mutTeamBalance (Function EvenMatchOmni.mutTeamBalance.RememberForcedSwitch:0042) Accessed None 'Team'
EvenMatch: Forced team change: WebAdmin soft-balance at respawn
EvenMatch: Not remembering WebAdmin
And then this repeats many times...
Snarf I can send you the whole log if you'd like, but I don't want to post it because it has IPs in it.
And I should point out I forgot an ending quote in KnownPlayers.ini (that's fixed now) but I don't think that caused to weird balancer condition.