A Bit of Better Balancing  (Read 106957 times)

Flenser

  • Full Member 
  • *
  • Posts: 77
  • Country: us
A Bit of Better Balancing
« on: May 13, 2021, 21:46 »
The current team balancer seems to do this, from observation:
When the number of players differs by more than one, move the most recently-joined player from the team that has more players, to the team that has fewer.

That doesn't do a heck of a lot when it's 4-0, and Arbok, DcNR, etc. are all on the winning team, 3 people rage (or otherwise) quit the losing team, and some poor soul who just joined 30 seconds ago gets moved to the losing team.

Here's my proposal, and I have no idea whether it's technically possible, but perhaps it is, or perhaps someone else will have an even better idea.

What if, if the score hits 3-0, the top player on the winning team gets moved to the losing team? If it hits 4-0, then the (new) top player also gets moved.

Or maybe the 2nd-to-top player gets moved? Or maybe the teams get completely randomized.

We seem to have a lot of 5-0 games lately, and they are the least interesting or fun games possible. Either you're on the winning team and it's like you're playing against a bunch of bots set on "visually impaired" or you're on the losing team and you can't even get out of the spawn point before dying or the other team scoring again. I'd love for there to be more 4-3 games or 3-1 games.

Piglet

  • 1337
  • *
  • Posts: 3257
  • Country: gb
Re: A Bit of Better Balancing
« Reply #1 on: May 13, 2021, 22:09 »
What we really need is something like the balancer in Freon, or the code Shambler wrote for ONS in his TitanTeamFix balancer.

Both those things rate every player, then aim to build teams with similar ratings.

The problems for vCTF are:

1. How to assess players for rating
2. How to get enough time, skills, and enthusiasm to write in-game and back-end code to store away and use ratings

1 is very hard
2 is even harder. Free time is short and it's a lot of work.

The_Cowboy

  • 1337
  • *
  • Posts: 259
  • Country: in
  • CodeZilla
Re: A Bit of Better Balancing
« Reply #2 on: May 14, 2021, 06:52 »
There is already something similar existing for UT99 https://unrealadmin.org/forums/showthread.php?t=23777 (source: https://github.com/joeytwiddle/code/blob/master/code/unrealscript/AutoTeamBalance/Classes/AutoTeamBalance.uc)

Pros:
1. It has a seemingly decent algorithm for assessing players for ratings.
2. It has been refined over several years based on the feedback from multiple UT99 CTF servers. Assuming the
    CTF playerbase has the same magnitude of frustrations (or envies) for unbalanced teams, I don't see why the
    algorithm can't/won't work for VCTF crowd.

Cons:
1. What Piglet said (point 2, mostly the time and enthusiasm part).
2. For UT2004 VCTF it might need some patching up. Like identification based on GUID or something similarly robust (instead of just names).

At some point down the line I would love to look into cooking something like this, but no commitments  :-\
« Last Edit: May 14, 2021, 09:27 by The_Cowboy »
Quote from: Wormbo
You learn UnrealScript mainly by reading other people's code. Removing code without an important reason (download size reduction and lack of helpfulness are not important in that sense) is extremely antisocial IMHO.

Gil-galad

  • Full Member 
  • *
  • Posts: 72
  • Country: pt
  • Hail the Holy Flying Spaguetti Monster!
Re: A Bit of Better Balancing
« Reply #3 on: May 14, 2021, 14:50 »
Hello,

If i can help, being a noob at every thing but of ingame equilibrium sense...

 things that come to my mind when i think of a team balancer :

 - the closer the guy is from scoring before being killed by an enemy, more the points that should be awarded for the kill, IF the flag is indeed returned. Think of it like an assist on a manta run.
 - the closer your flag is from the enemy's flag post base, the more points you should receive for returning it.
 - for flag runs : in an ideal manner, if you capture the flag running all the way or just the last centimeter should NOT be rewarded equally, IMO.
 - shooting at an enemy that is shooting your team flag carrier should be rewarded more that regular shots, because it's support.

In general, I think the right perspective is to acknowledge and measure what denotes overall match awareness, reactivity and commitment towards VCTF goals (the Things That Need to Be Done, like IMO touching, capturing, killing the flag carrier, returning, and, to an extent, support your team's runner).
I probably forget a lot of ideas i got about this old, old subject. If i remember something that i think that could be of use, I'll post again.
« Last Edit: May 14, 2021, 15:46 by Gil-galad[The REAL one] »
His sword was long, his lance was keen.
His shining helm afar was seen;
the countless stars of heaven's field
were mirrored in his silver shield.

The Fall of Gil-galad - J. R. R. Tolkien

The_Cowboy

  • 1337
  • *
  • Posts: 259
  • Country: in
  • CodeZilla
Re: A Bit of Better Balancing
« Reply #4 on: May 15, 2021, 06:38 »
Some time ago I was working on SmartCTF(https://miasma.rocks/index.php?topic=1357.0) which tracks almost all the features that Gil-galad mentions. A snap shot of the features https://imgur.com/BnBo7gk.

- the closer the guy is from scoring before being killed by an enemy, more the points that should be awarded for the kill, IF the flag is indeed returned. Think of it like an assist on a manta run.
Can be implemented in that framework with just a couple of lines of code.

- the closer your flag is from the enemy's flag post base, the more points you should receive for returning it.
Implemented.

- shooting at an enemy that is shooting your team flag carrier should be rewarded more that regular shots, because it's support.
Implemented. They also get extra adrenaline!

  - for flag runs : in an ideal manner, if you capture the flag running all the way or just the last centimeter should NOT be rewarded equally, IMO.
Implemented.

In general, I think the right perspective is to acknowledge and measure what denotes overall match awareness, reactivity and commitment towards VCTF goals (the Things That Need to Be Done, like IMO touching, capturing, killing the flag carrier, returning, and, to an extent, support your team's runner).
That is precisely the motivation for building something like SmartCTF.

Infact Piglet did suggest using these features to balance the teams
The readme is great.

What I'd really like to see is something that we can use to ensure the teams are reasonably well balanced at the start of each match (separate from the scoreboard logic so that they can be used separately or together.

What you have in there is a lot of information about the players and how they're playing. All that is interesting, but could be made useful by storing that away and using it to balance teams at map start - separating cappers from each other, separating defenders from each other and splitting the other players into roughly even groups to the teams.

That would require saving the information to a server and recalling the bits needed as players join.

All I will say is that it needs a "better mind" to connect the remaining dots and bring this issue to a just resolution (https://youtu.be/0f2jpwn6M-E?t=80).
« Last Edit: May 15, 2021, 09:04 by The_Cowboy »
Quote from: Wormbo
You learn UnrealScript mainly by reading other people's code. Removing code without an important reason (download size reduction and lack of helpfulness are not important in that sense) is extremely antisocial IMHO.

Gil-galad

  • Full Member 
  • *
  • Posts: 72
  • Country: pt
  • Hail the Holy Flying Spaguetti Monster!
Re: A Bit of Better Balancing
« Reply #5 on: May 15, 2021, 15:15 »
great to see that all i thought isn't off the mark, then. And indeed, we stand on shoulders of giants. it would be great to be able to use that. I wonder is someone has ever done something for assault. I used to hope for it years and years on. being a noob forever in coding.

Anyway, i was just giving my vision, and glad to see that is not alien.
His sword was long, his lance was keen.
His shining helm afar was seen;
the countless stars of heaven's field
were mirrored in his silver shield.

The Fall of Gil-galad - J. R. R. Tolkien

The_Cowboy

  • 1337
  • *
  • Posts: 259
  • Country: in
  • CodeZilla
Re: A Bit of Better Balancing
« Reply #6 on: May 15, 2021, 15:38 »
Now that you mention, here is the teambalancer (for assault) https://github.com/TheRealWormbo/EvenMatch by one of the giants  :D
« Last Edit: May 15, 2021, 15:45 by The_Cowboy »
Quote from: Wormbo
You learn UnrealScript mainly by reading other people's code. Removing code without an important reason (download size reduction and lack of helpfulness are not important in that sense) is extremely antisocial IMHO.

Gil-galad

  • Full Member 
  • *
  • Posts: 72
  • Country: pt
  • Hail the Holy Flying Spaguetti Monster!
Re: A Bit of Better Balancing
« Reply #7 on: May 15, 2021, 17:02 »
it is, apparently, 
Quote
A UT2004 mutator that provides special team balancing rules for public Onslaught matches.

Onslaught, then, which is pertinent for Warfare.
His sword was long, his lance was keen.
His shining helm afar was seen;
the countless stars of heaven's field
were mirrored in his silver shield.

The Fall of Gil-galad - J. R. R. Tolkien

The_Cowboy

  • 1337
  • *
  • Posts: 259
  • Country: in
  • CodeZilla
Re: A Bit of Better Balancing
« Reply #8 on: May 16, 2021, 03:18 »
Ah yes, you are correct! I got confused between the two gametypes.

I am more than willing to give a few pointers regarding the unreal scripting for setting the build environment and writing a well behaved balancer, if you are interested in taking a shot. All it needs is basic familiarity with the programming (java or c/c++/c# or python) and mental coherence.
« Last Edit: May 16, 2021, 04:01 by The_Cowboy »
Quote from: Wormbo
You learn UnrealScript mainly by reading other people's code. Removing code without an important reason (download size reduction and lack of helpfulness are not important in that sense) is extremely antisocial IMHO.

Piglet

  • 1337
  • *
  • Posts: 3257
  • Country: gb
Re: A Bit of Better Balancing
« Reply #9 on: May 16, 2021, 11:18 »
...and time. A lot of time...and a remote back-end to talk to in a sensible protocol that can take stats information as game ends or as the player leaves the server, and provide you with the stats of the players as they join.

As we've seen over 30,000 different players over the years there'd be far too much information to store in ini files on the server.

The_Cowboy

  • 1337
  • *
  • Posts: 259
  • Country: in
  • CodeZilla
Re: A Bit of Better Balancing
« Reply #10 on: May 16, 2021, 11:33 »
Wow, 30,000 is a lot. I have no experience in preparing the backend stuff (could you give a working example of that). Guess there would be some learning for me too.

Anyways I went ahead and setup a repository with initial code https://github.com/ravimohan1991/Equalizer (let me know how you feel about that).
« Last Edit: May 16, 2021, 11:49 by The_Cowboy »
Quote from: Wormbo
You learn UnrealScript mainly by reading other people's code. Removing code without an important reason (download size reduction and lack of helpfulness are not important in that sense) is extremely antisocial IMHO.

Piglet

  • 1337
  • *
  • Posts: 3257
  • Country: gb
Re: A Bit of Better Balancing
« Reply #11 on: May 16, 2021, 18:55 »
The best examples for the UT side of things I have are are in:

"TitanAdminSM1" - using httplib for simple web-server communication

* Freon - grab from your cache directory after visiting the Freon server here. - using UDP connection

The_Cowboy

  • 1337
  • *
  • Posts: 259
  • Country: in
  • CodeZilla
Re: A Bit of Better Balancing
« Reply #12 on: May 17, 2021, 03:38 »
Sounds good. I did some research and found http://www.utstatsdb.com/demo/. It is based on PHP and I think I can tailor it specifically for CTF/VCTF (only matter of removing other gametypes and adding some more statistics).

Pros:
1. It has a decent ranking system already built in (http://www.utstatsdb.com/demo/rankings.php).
    It would be just to equalize teams based on the points metric.
   
Quote
Ranking is based on ELO Chess ranking.

Everyone starts with a rank score of 0. Points are based on how often you trigger positive personal score events, e.g. kills, captures, assists, etc. Against your score are deaths, suicides, teamkills, opposing team scores, etc.

The lower the rank of the other player or team is, against whom you score, the less points you will get, so the ripping of weak opponents will get you less rank points, than beating a stronger (in rank) opponent.
   

2. Nice way to display publicly what is going on under the hoods.

Con(s):
1. Relevant modifications will take long time (6-8 months, not counting the time to be spent on the mutator).

I was wondering if we have enough resources (webhosting wise) to support it.
« Last Edit: May 17, 2021, 03:40 by The_Cowboy »
Quote from: Wormbo
You learn UnrealScript mainly by reading other people's code. Removing code without an important reason (download size reduction and lack of helpfulness are not important in that sense) is extremely antisocial IMHO.

Piglet

  • 1337
  • *
  • Posts: 3257
  • Country: gb
Re: A Bit of Better Balancing
« Reply #13 on: May 17, 2021, 11:24 »
I really dislike utstats - we had it running for a while and the backend database was huge. It was so huge I didn't want to keep it running.

Something much lighter would be better - tracking just enough information to be useful.

e.g. pph, win/lose, caps, kill/death ratio...or whatever you need to determine which team the player should be in

The_Cowboy

  • 1337
  • *
  • Posts: 259
  • Country: in
  • CodeZilla
Re: A Bit of Better Balancing
« Reply #14 on: May 17, 2021, 11:41 »
Yeah, I think I can understand the frustration. It is overkill to basically track the servers, maps played and player career not to mention the different gametypes and each and every shot fired from the weapons  :o. For our purposes we just need to track few statistics (like covers, seals, flagkills, captures) along with the total score (it can be discussed further). These statistics will be submitted to the backend (PHP) at the game end or when player leaves the server.

Then, for the backend, we can come up with an algorithm to assign player rating based on those statistics (here UTStatsDB may be useful). At the match start (and when players type "teams") Equalizer will query the backend for rating and, well, equalize the teams.
Quote from: Wormbo
You learn UnrealScript mainly by reading other people's code. Removing code without an important reason (download size reduction and lack of helpfulness are not important in that sense) is extremely antisocial IMHO.