[Mutator] Even Match (Onslaught team balancer)

Anything about UT2004 mapping, Uscripting & more
User avatar
Cat1981England
Posts: 2326
Joined: Mon 23. Aug 2010, 15:35

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Cat1981England » Tue 18. Aug 2015, 21:36

We don't seem to have the same issue as Omni with the top PPH players being swapped, at least from what I've seen so far. BTW, do the players receive a message after being soft swapped? Someone was shooting their own team without realising that they had been swapped and I haven't been able to see for myself.
Wormbo wrote:Hmm, any other errors? I found a place that may be responsible for it (looks like a copy/paste error), but that one should have been generating more errors, then.
It occurs multiple times in clusters on every map. The only thing that changes is the numbers at the end. Debug doesn't show any additional information.

Code: Select all

[...]
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (17/0)
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (17/0)
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (17/0)
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (17/0)
Log: Opening user log ../UserLogs/AntiTCC_2015-08-18_21-20_ONSOnslaughtGame_ONS-ArcticStronghold-T32.log
EvenMatchDebug: DEBUG: Vlad disconnected
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (16/0)
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (16/0)
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (16/0)
Error: mutTeamBalance ONS-ArcticStronghold-T32.mutTeamBalance (Function EvenMatchV2a7.mutTeamBalance.CheckBalance:0466) Accessed array 'Candidates' out of bounds (16/0)
[...]
---

So far,

Image.

It's a little trigger happy. On maps such as Maelstrom several nodes can fall very quickly, but we'll keep playing around with the setttings and see if it can stay out of the way for a little bit.

Today we've been using the following settings.

[EvenMatchV2a7.mutTeamBalance]
ActivationDelay=10
MinDesiredRoundDuration=5
bShuffleTeamsFromPreviousMatch=True
bRandomlyStartWithSidesSwapped=False
bConnectingPlayersBalanceTeams=True
bAlwaysIgnoreTeamPreference=True
bAnnounceTeamChange=True
bIgnoreBotsForTeamSize=True
SmallTeamProgressThreshold=0.500000
SoftRebalanceDelay=60
ForcedRebalanceDelay=120
SwitchToWinnerProgressLimit=0.700000
ValuablePlayerRankingPct=75
MinPlayerCount=2
bDebug=True
The Universal Declaration of Human Rights, Article 1:

All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Wormbo » Wed 19. Aug 2015, 07:49

Yes, player's recieve a reminder of their current team membership at respawn. There's both a HUD message and an announcement, both in English, though.

I think I found the code causing those index-out-of-bounds errors. Should be fixed next release.

About the trigger-happiness, try decreasing the SmallTeamProgressThreshold a bit, e.g. to 0.4. That way there must be a larger lead if the team size difference is just 1.
(Mathy talk ahead, you've been warned!)
Deciding whether to rebalance compares the smaller team's progress with (SmallTeamProgressThreshold ** Sqrt(1/SizeDifference)) [see table below], which is the same as SmallTeamProgressThreshold if the difference is just 1 player. A progress of 0.5 corresponds to both teams having identical node count, node/core health and power link hops from the enemy core.
By reducing SmallTeamProgressThreshold, you allow the bigger team to be longer in the lead before triggering a rebalance. A value of 0.4 allows the smaller team to fall behind a bit when they are only 1 player down, but triggers rebalancing with 2 or more players difference shortly before the smaller team loses the lead.

How SmallTeamProgressThreshold is affected by team size difference:

Code: Select all

Size diff.:  1      2      3      4      5  
Applied    0,300  0,427  0,499  0,548  0,584
Small      0,350  0,476  0,545  0,592  0,625
Team       0,400  0,523  0,589  0,632  0,664
Progress   0,450  0,569  0,631  0,671  0,700
Threshold  0,500  0,613  0,670  0,707  0,733
           0,550  0,655  0,708  0,742  0,765
           0,600  0,697  0,745  0,775  0,796
           0,650  0,737  0,780  0,806  0,825
           0,700  0,777  0,814  0,837  0,853
The value for one player is what you configure. As you can see, if the size difference increases, the actual progress threshold gets biased towards 1.0, i.e. if the smaller team must be in a comfortable lead to no longer receive additional players via in-round balancing.

User avatar
Cat1981England
Posts: 2326
Joined: Mon 23. Aug 2010, 15:35

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Cat1981England » Wed 19. Aug 2015, 23:11

Thank you. We lowered it to 0.4 this afternoon and it was much better. BTW, if there's anything you need us to test please just say.

Another request: Would it be possible for the players joining the match from spectator to be assigned a team?
The Universal Declaration of Human Rights, Article 1:

All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Wormbo » Thu 20. Aug 2015, 05:20

Yes, ideally they should be treated like connecting players, but that's not quite as easy. I'll look into how to do that.

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Wormbo » Fri 21. Aug 2015, 16:16

Nerd news from the coding front:
I managed to reduce the team shuffling algorithm's upper bound from about O(n³ * m) to about O(n³ * log m) [n = number of players; m = number of remembered PPH entries, which can be huge], which should significantly reduce the chance of a runaway loop crash. (The n³ term could also be something like (n² * sqrt(n)) or (n² * log n), but it didn't change. Thus isn't the interesting part of that improvement and I didn't bother checking the exact upper bound.)

Unrelated, but probably more significant:
How's everybody's perception of what the progress indicator seems to suggest on the game state in relation to what core health and radar map (i.e. node ownership) seem to suggest? Do they match reasonably well?

User avatar
Antman
Posts: 9
Joined: Thu 13. Aug 2015, 23:47
Description: Male, Arsenal fan. UT-geek

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Antman » Fri 21. Aug 2015, 17:30

Hi, Impressed to see all this work going into balancing. Do you have any online documentation Wormbo? Would like to read up a bit on the variables involved.

Appreciate all the time and effort you put in!
:muahaha: :cheers:

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Wormbo » Fri 21. Aug 2015, 18:03

There's currently no explicit documentation. For implicit documentation refer to this thread, the Omni thread linked in the first post, and this old CEONSS thread. Currently there's heavy construction work going on, so it would be a bit difficult to keep an explicit documentation synchronized to the mutator's current options and behavior. (I might write one for the next release after uploading the mutator, though.)

In fact, I might create a Github repository for the sources this weekend, like I did for JB2004 a while ago. (except that I'll keep this one uptodate)

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Wormbo » Fri 21. Aug 2015, 20:34

Alpha 8 available, see first post.

User avatar
Cat1981England
Posts: 2326
Joined: Mon 23. Aug 2010, 15:35

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Cat1981England » Sat 22. Aug 2015, 09:37

Wormbo wrote:Unrelated, but probably more significant:
How's everybody's perception of what the progress indicator seems to suggest on the game state in relation to what core health and radar map (i.e. node ownership) seem to suggest? Do they match reasonably well?
Yes they seem to line up very well.

Could we still have this feature in the final release with the option to turn it off as it now? I understand Peg's concern, but at the same time people will call for "teams" even if the team with fewer players is dominating, as has happened over the last few nights. We could always disable it in future once the players get use to not having TitanTeamFix.

-------

Thank you for the separate .ini file :thumbup: V2a8 now on the server with the following settings.

[EvenMatchV2a8.mutTeamBalance]
ActivationDelay=10
MinDesiredFirstRoundDuration=5
bShuffleTeamsAtMatchStart=True
bRandomlyStartWithSidesSwapped=False
bAssignConnectingPlayerTeam=True
bIgnoreConnectingPlayerTeamPreference=True
bAnnounceTeamChange=True
bIgnoreBotsForTeamSize=True
bBalanceTeamsBetweenRounds=True
bBalanceTeamsWhilePlaying=True
bBalanceTeamsDuringOvertime=False
bDisplayRoundProgressIndicator=True
SmallTeamProgressThreshold=0.400000
SoftRebalanceDelay=60
ForcedRebalanceDelay=999
SwitchToWinnerProgressLimit=0.700000
ValuablePlayerRankingPct=75
MinPlayerCount=2
TeamsCallString=
bDebug=True
The Universal Declaration of Human Rights, Article 1:

All human beings are born free and equal in dignity and rights. They are endowed with reason and conscience and should act towards one another in a spirit of brotherhood.

User avatar
Wormbo
Posts: 384
Joined: Sun 28. Aug 2011, 11:52
Description: Coding Dude

Re: [Mutator] Even Match (Onslaught team balancer)

Post by Wormbo » Sat 22. Aug 2015, 10:46

Setting ForcedRebalanceDelay to something that high may have unwanted side effects, like the message popping up every 10 seconds. If you want, I can add an option to entirely turn it off.

Somewhat related, I'd appreciate if anyone has an idea on this problem: XCOPY can't read /EXCLUDE file
As I mentioned earlier, I want to make the Even Match sources available on Github. I could release just the plain sources, but I also want to provide a build script so it can be compiled without UMake. The idea is to detect the UT2004 folder (works), create a build folder with the approrpiate package name (works) and copy sources there to compile them. The copying should exclude a few files, and that's what doesn't work.
I wrote a similar script for UT3 Jailbreak where I successfully applied exclusion in the same way I'm trying now.

[edit]
Nevermind, XCOPY is being stupid and not accepting quoted exclude file names.

[edit2]
Even Match is now on GitHub. I'll make sure to record all known open issues in the project's issue tracker.

[edit3]
I'm looking into potential replacement algorithms for the team shuffling, in case it still stays crashy with larger player counts. To test replacement candidates, I need some test data for the PPH values, though. Can a server admin please send me the list? Starting with alpha 8 it's stored in EvenMatchPPH.ini, earlier versions stored it in UT2004.ini. In either case you are looking for the "EvenMatchRules" section.