Forged Alliance Forever Forged Alliance Forever Forums 2019-10-05T15:24:51+02:00 /feed.php?f=42&t=16989 2019-10-05T15:24:51+02:00 2019-10-05T15:24:51+02:00 /viewtopic.php?t=16989&p=178741#p178741 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> https://github.com/FAForever/fa/pull/2863

Statistics: Posted by keyser — 05 Oct 2019, 15:24


]]>
2019-10-05T15:18:39+02:00 2019-10-05T15:18:39+02:00 /viewtopic.php?t=16989&p=178738#p178738 <![CDATA[add a lobby algorithm that finds the fairest teams]]> Statistics: Posted by spewaysaf — 05 Oct 2019, 15:18


]]>
2019-09-24T09:48:17+02:00 2019-09-24T09:48:17+02:00 /viewtopic.php?t=16989&p=178445#p178445 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> https://github.com/FAForever/fa/issues/2853

Statistics: Posted by thecore — 24 Sep 2019, 09:48


]]>
2019-05-22T04:21:55+02:00 2019-05-22T04:21:55+02:00 /viewtopic.php?t=16989&p=174951#p174951 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> Statistics: Posted by armacham01 — 22 May 2019, 04:21


]]>
2018-12-26T15:11:01+02:00 2018-12-26T15:11:01+02:00 /viewtopic.php?t=16989&p=170504#p170504 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> Statistics: Posted by nine2 — 26 Dec 2018, 15:11


]]>
2018-12-26T02:43:47+02:00 2018-12-26T02:43:47+02:00 /viewtopic.php?t=16989&p=170492#p170492 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]>
But for that we need the java server deployed. And now you're crossing into the deepest mud of FAF politics.

Statistics: Posted by Geosearchef — 26 Dec 2018, 02:43


]]>
2018-12-26T02:10:03+02:00 2018-12-26T02:10:03+02:00 /viewtopic.php?t=16989&p=170491#p170491 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]>
In fact, why not make team matchmaker

Statistics: Posted by nine2 — 26 Dec 2018, 02:10


]]>
2018-12-19T19:41:50+02:00 2018-12-19T19:41:50+02:00 /viewtopic.php?t=16989&p=170271#p170271 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> IF that is true, it does nothing in terms of position balancing and is exactly the same as auto-teams except its worse than that because it uses shown rating instead of game quality (i might be wrong though because recursive code is somewhat confusing to me).

Btw., even though i am a programmer, i don't like expressing ideas in code (even worse if its low-level C-like stuff). It means that non-programmers can't discuss it and it doesn't work if the algorithm us non-trivial.

Proposed Algorithm for for best position balancing:
Treat every position in game as 1v1 game. So, you just ask Trueskill for all game qualities of all possible one-vs-one for all members of the team. Example:

If there are four players (A, B, C, D) you get game qualities of:
AvB, AvC, AvD, BvC, BvD, CvD

(If teams are fixed like AB vs CD but you want to randomize positions only, just get: AvC, AvD, BvC, BvD)

Then you calculate squared sum of game quality for all possible team compositons,where a team compositon is a combination of 1v1s so that every players appears once per composition:
Compositon 1 Quality = (AvB + CvD)
Compositon 2 Quality = (AvC + BvD)
Compositon 3 Quality = (AvD + BvC)
and choose the one with highest quality. If you don't want to punish high differences, use sum instead of squared sum, simple. Then you put players that are in a 1v1 into opposing spots on map. Of course this only works for two teams of same size.

Edit: Example code:
https://gist.github.com/Katharsas/c2697 ... 1d7a549087

Statistics: Posted by Katharsas — 19 Dec 2018, 19:41


]]>
2018-12-18T00:48:13+02:00 2018-12-18T00:48:13+02:00 /viewtopic.php?t=16989&p=170251#p170251 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> Statistics: Posted by Endranii — 18 Dec 2018, 00:48


]]>
2018-12-17T23:34:01+02:00 2018-12-17T23:34:01+02:00 /viewtopic.php?t=16989&p=170249#p170249 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> Statistics: Posted by Katharsas — 17 Dec 2018, 23:34


]]>
2018-12-14T14:56:24+02:00 2018-12-14T14:56:24+02:00 /viewtopic.php?t=16989&p=170198#p170198 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]>
Please take into account that the rating of a player IS NOT a single value but a normal distribution with a mean and standard deviation.

Statistics: Posted by Geosearchef — 14 Dec 2018, 14:56


]]>
2018-12-14T14:35:43+02:00 2018-12-14T14:35:43+02:00 /viewtopic.php?t=16989&p=170197#p170197 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]> reference here
https://www.codesdope.com/blog/article/ ... f-an-arra/

Note it is in as3 but should be easy to convert to c++

Code:
var playerArray: Array = [700, 783, 843, 953, 1100, 1253];
var temp: int;
var a;
var b;

var stringArray: Array = [];
var lastScore: int = 99999;
var fairestTeam: String = "";

var i: int;
var j: int;
var size: uint;
var myString: String = "";
var team1: int;
var team2: int;
var diff: int;
f_mutate(playerArray, 0, playerArray.length - 1);

//returns a string with the team
trace(fairestTeam);

//f_mutate function
function f_mutate(arr: Array, start: int, end: int)
{
   if (start == end)
   {
      size = end + 1;
      i = 0;
      j = 0
      myString = "";
      team1 = 0;
      team2 = 0;
      diff = 0;
      for (i = 0; i < size; i++)
      {
         myString += String(arr[i] + ",");
         if (i < (size * 0.5))
         {
            team1 += arr[i];
         }
         else
         {
            team2 += arr[i];
         }
      }
      if (team1 >= team2)
      {
         diff = team1 - team2;
      }
      else
      {
         diff = team2 - team1;
      }
      myString += " diff " + diff;
      if (diff < lastScore)
      {
         fairestTeam = myString;
         lastScore = diff;
      }
      myString = "";
      return;
   }
   
   var k:int = 0;
   for (k = start; k <= end; k++)
   {
      //change position in array
      temp = arr[start];
      arr[start] = arr[k];
      arr[k] = temp;
      f_mutate(arr, start + 1, end);
      temp = arr[start];
      arr[start] = arr[k];
      arr[k] = temp;
   }
}


Out put
700,843,1253,953,1100,783, diff 40

resulting in
team 1
700
843
1253

Team 2
953
1100
783

So all that needs to be done is when a button is pressed have it store all the player's ratting/trueskill in playerArray, run the algorithm and from the output sort the players into teams.

Code is very messy but it is a start.

Statistics: Posted by thecore — 14 Dec 2018, 14:35


]]>
2018-12-14T06:16:09+02:00 2018-12-14T06:16:09+02:00 /viewtopic.php?t=16989&p=170192#p170192 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]>
thecore wrote:
Wanted to see what people think of the idea first.


Sounds like effort.
But I'm not necessarily against it.

Statistics: Posted by moonbearonmeth — 14 Dec 2018, 06:16


]]>
2018-12-14T01:03:04+02:00 2018-12-14T01:03:04+02:00 /viewtopic.php?t=16989&p=170191#p170191 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]>

TheSetoner kinda has this function for TD's. Specify players and team size, it checks the ratings of the players and generates even teams based on that.



The lobby already has an option to mix spawns on start and balance teams although I don't know how well this works


The idea with this method is to quickly find the fairest teams based on rank/true skill but then allow the players to make adjustments when needed (it may be even teams but if the algorithm puts the lowest rank player in a key position against the highest rank player then that will affect the balance).


If you want to take a look or implement sth take a look at the github repo


Wanted to see what people think of the idea first.

Statistics: Posted by thecore — 14 Dec 2018, 01:03


]]>
2018-12-13T18:02:30+02:00 2018-12-13T18:02:30+02:00 /viewtopic.php?t=16989&p=170180#p170180 <![CDATA[Re: add a lobby algorithm that finds the fairest teams]]>
I also want to mention that your rating isn't a single number. You don't want to balance the ratings above which players will play with 99.7 % certainty (the displayed rating, 3 times the standard deviation percentile) but instead want to maximize draw probability (called game quality). Take a look here for info on trueskill: https://trueskill.org/

Statistics: Posted by Geosearchef — 13 Dec 2018, 18:02


]]>