Forged Alliance Forever Forged Alliance Forever Forums 2019-11-15T14:38:27+02:00 /feed.php?f=42&t=18354 2019-11-15T14:38:27+02:00 2019-11-15T14:38:27+02:00 /viewtopic.php?t=18354&p=179707#p179707 <![CDATA[Re: add autobalance to ingame lobby]]>
Code:
function computeQuality(team)
    local skillsMatrix = getPlayerCovarianceMatrix(team)
    local meanVector = getPlayerMeansVector(team)
    local meanVectorTranspose = meanVector:transpose()
    local playerTeamAssignmentsMatrix = createPlayerTeamAssignmentMatrix(team, meanVector.rowCount)
    local  playerTeamAssignmentsMatrixTranspose = playerTeamAssignmentsMatrix:transpose()
    local betaSquared = 250 * 250
    local start = matrixmult(meanVectorTranspose, playerTeamAssignmentsMatrix)
    local aTa = matrixmult(scalarMultiply(playerTeamAssignmentsMatrixTranspose, betaSquared), playerTeamAssignmentsMatrix)
    local tmp = matrixmult(playerTeamAssignmentsMatrixTranspose, skillsMatrix)
    local aTSA =  matrixmult(tmp, playerTeamAssignmentsMatrix)
    local middle = matrixAdd(aTa, aTSA)
    if middle:getDeterminant() == 0 then return -1 end
    local middleInverse = matrixInvert(middle)
    local theend = matrixmult(playerTeamAssignmentsMatrixTranspose, meanVector)
    local part1 = matrixmult(start, middleInverse)
    local part2 = matrixmult(part1, theend)
    local expPartMatrix = scalarMultiply(part2, -0.5)
    local expPart = expPartMatrix:getDeterminant()
    local sqrtPartNumerator = aTa:getDeterminant()
    local sqrtPartDenominator = middle:getDeterminant()
    local sqrtPart = sqrtPartNumerator / sqrtPartDenominator
    local result = math.exp(expPart) * math.sqrt(sqrtPart)
    return round((result * 100), 2)
end

Statistics: Posted by thecore — 15 Nov 2019, 14:38


]]>
2019-11-15T14:23:43+02:00 2019-11-15T14:23:43+02:00 /viewtopic.php?t=18354&p=179706#p179706 <![CDATA[Re: add autobalance to ingame lobby]]> Statistics: Posted by nine2 — 15 Nov 2019, 14:23


]]>
2019-11-15T14:20:24+02:00 2019-11-15T14:20:24+02:00 /viewtopic.php?t=18354&p=179705#p179705 <![CDATA[Re: add autobalance to ingame lobby]]> Statistics: Posted by keyser — 15 Nov 2019, 14:20


]]>
2019-11-15T14:15:34+02:00 2019-11-15T14:15:34+02:00 /viewtopic.php?t=18354&p=179703#p179703 <![CDATA[Re: add autobalance to ingame lobby]]> Statistics: Posted by thecore — 15 Nov 2019, 14:15


]]>
2019-11-15T14:09:25+02:00 2019-11-15T14:09:25+02:00 /viewtopic.php?t=18354&p=179702#p179702 <![CDATA[Re: add autobalance to ingame lobby]]> Statistics: Posted by nine2 — 15 Nov 2019, 14:09


]]>
2019-11-15T14:03:46+02:00 2019-11-15T14:03:46+02:00 /viewtopic.php?t=18354&p=179700#p179700 <![CDATA[Re: add autobalance to ingame lobby]]>
The issue with brute force is it can only really be used for about 10 payers MAX or else it takes too long.

Brute force finds the perfect balance as it goes through all combination. However more than 10 players and it is too slow.

So what would be better is use the Brute force method for up to 8 players and this method for more than 8 players

Update:
you cannot calculate on just rating, e.g.
Player 1
ratting 700
Games player 1000

Player 2 800
Games player 5

Player 1 could be the better player

Statistics: Posted by thecore — 15 Nov 2019, 14:03


]]>
2019-11-15T13:50:28+02:00 2019-11-15T13:50:28+02:00 /viewtopic.php?t=18354&p=179698#p179698 <![CDATA[Re: add autobalance to ingame lobby]]>
Image

Image

Image

Statistics: Posted by nine2 — 15 Nov 2019, 13:50


]]>
2019-11-15T13:40:08+02:00 2019-11-15T13:40:08+02:00 /viewtopic.php?t=18354&p=179697#p179697 <![CDATA[Re: add autobalance to ingame lobby]]>
How it works:
Code:
Foreach player ordered by rating descending
Put them in the team with the lowest total rating (that is not full)


You can see what it does for these 12 players when put into 2, 3, 4, 6 teams...
Code:
Players: 1200, 1100, 900, 900, 800, 800, 700, 700, 500, 500, 500, 300

          Team 1  Team 2
   Total    4400    4500
-----------------------------------------------------------------------------
  Slot 1    1200    1100
  Slot 2     900     900
  Slot 3     800     800
  Slot 4     700     700
  Slot 5     500     500
  Slot 6     300     500

          Team 1  Team 2  Team 3
   Total    3000    2900    3000
-----------------------------------------------------------------------------
  Slot 1    1200    1100     900
  Slot 2     800     800     900
  Slot 3     500     700     700
  Slot 4     500     300     500

          Team 1  Team 2  Team 3  Team 4
   Total    2200    2300    2200    2200
-----------------------------------------------------------------------------
  Slot 1    1200    1100     900     900
  Slot 2     700     700     800     800
  Slot 3     300     500     500     500

          Team 1  Team 2  Team 3  Team 4  Team 5  Team 6
   Total    1500    1600    1400    1400    1500    1500
-----------------------------------------------------------------------------
  Slot 1    1200    1100     900     900     800     800
  Slot 2     300     500     500     500     700     700


Here's how it handles 4 imbalanced players
Code:
Players: 2000, 900, 900, 50

          Team 1  Team 2
   Total    2050    1800
-----------------------------------------------------------------------------
  Slot 1    2000     900
  Slot 2      50     900



This is 4 balanceable players

Code:
Players: 2000, 1800, 1200, 1150

          Team 1  Team 2
   Total    3150    3000
-----------------------------------------------------------------------------
  Slot 1    2000    1800
  Slot 2    1150    1200



Lets do an experiment. I am about to change the rating of the 1700 player in this example.
Code:
Players: 2000, 1800, 1800, 1700, 1200, 10

          Team 1  Team 2
   Total    3710    4800
-----------------------------------------------------------------------------
  Slot 1    2000    1800
  Slot 2    1700    1800
  Slot 3      10    1200



When he is 1600 it forces the 1200 and 10 to swap teams
Code:
Players: 2000, 1800, 1800, 1600, 1200, 10

          Team 1  Team 2
   Total    4800    3610
-----------------------------------------------------------------------------
  Slot 1    2000    1800
  Slot 2    1600    1800
  Slot 3    1200      10



When he is 100 there is no further rffect
Code:
Players: 2000, 1800, 1800, 1200, 100, 10

          Team 1  Team 2
   Total    3300    3610
-----------------------------------------------------------------------------
  Slot 1    2000    1800
  Slot 2    1200    1800
  Slot 3     100      10



So the player is considered "balanced with 2000 and 1200 against 1800 1800 10" until the player is 1700. Once he hits that threshold the teams are all rejigged so the player is no longer with the 1200. At that point it is more balanced for him to be with 2000 and 10

Here is my C# script which should be renamed to "auto faf teams.linq" then opened in linqpad

Statistics: Posted by nine2 — 15 Nov 2019, 13:40


]]>
2019-11-15T12:53:22+02:00 2019-11-15T12:53:22+02:00 /viewtopic.php?t=18354&p=179695#p179695 <![CDATA[Re: add autobalance to ingame lobby]]>
you just need to change when it runs, to be before you launch the game

Statistics: Posted by nine2 — 15 Nov 2019, 12:53


]]>
2019-11-15T09:39:03+02:00 2019-11-15T09:39:03+02:00 /viewtopic.php?t=18354&p=179693#p179693 <![CDATA[Re: add autobalance to ingame lobby]]>

It could just brute force all permutations

https://github.com/FAForever/fa/pull/2887

It is a work in progress, though need more skilled coders to help with it.

Statistics: Posted by thecore — 15 Nov 2019, 09:39


]]>
2019-11-02T05:58:22+02:00 2019-11-02T05:58:22+02:00 /viewtopic.php?t=18354&p=179382#p179382 <![CDATA[add autobalance to ingame lobby]]>
1. the host would choose the team for each slot

2. the host would click an autobalance button, which moves players around between slots to get the best % game quality score. It could just brute force all permutations

bonus features:

the host could lock players to certain slots (this guy is air spot for this team)

the host could lock players together

players in the same clan start autolocked together

the program could balance the slots as well as the teams, by which i mean on setons it would make sure the middle is balanced, the air slots are balance, etc. not just that the teams are balanced. this would require some additional information to be added to each map. at the moment maps dont know which slots corrospond to which teams. maps dont know what slots corrospond to each other. someone could take the 200 most played maps and create this information. the information could also be displayed in on the map preview for easier manual balancing

Image

Statistics: Posted by nine2 — 02 Nov 2019, 05:58


]]>