1 |
after reading:
|
1 |
after reading:
|
2 |
http://code.google.com/p/zero-k/source/browse/trunk/other/Springie/Springie/autohost/AutoHost_commands.cs
|
2 |
http://code.google.com/p/zero-k/source/browse/trunk/other/Springie/Springie/autohost/AutoHost_commands.cs
|
3 |
\n
|
3 |
\n
|
4 |
i stand enlightened (and with headache)
|
4 |
i stand enlightened (and with headache)
|
5 |
\n
|
5 |
\n
|
6 |
from what i can understand the curent balancer:
|
6 |
from what i can understand the curent balancer:
|
7 |
picks the biggest elo player, dumps it on the first available team, then cycles through the teams till it has no players left
|
7 |
picks the biggest elo player, dumps it on the first available team, then cycles through the teams till it has no players left
|
8 |
(its basicly just one step above !random)
|
8 |
(its basicly just one step above !random)
|
9 |
\n
|
9 |
\n
|
10 |
\n
|
10 |
\n
|
11 |
my algorithm would be slower then this, and it will [u]definetly[/u] give beter balance
|
11 |
my algorithm would be slower then this, and it will [u]definetly[/u] give beter balance
|
12 |
\n
|
12 |
\n
|
13 |
\n
|
13 |
\n
|
14 |
sidenote: why didn't you just do a sort step at the start on ranker List?
|
14 |
sidenote: why didn't you just do a sort step at the start on ranker List?
|
15 |
(instead of sorting through all the rankers evry time you are looking for the highest elo player)
|
15 |
(instead of sorting through all the rankers evry time you are looking for the highest elo player)
|
16 |
\n
|
16 |
\n
|
17 |
also isnt:
|
17 |
also isnt:
|
18 |
[quote] foreach (var c in candidates)
|
18 |
[quote] foreach (var c in candidates)
|
19 |
{
|
19 |
{
|
20 |
var newElo = ((teamUsers[minid].Sum(x => x.Elo) + Math.Round(c.Elo/10)*10))/(teamUsers.Count() + 1);
|
20 |
var newElo = ((teamUsers[minid].Sum(x => x.Elo) + Math.Round(c.Elo/10)*10))/(teamUsers.Count() + 1);
|
21 |
if (newElo > maxElo)
|
21 |
if (newElo > maxElo)
|
22 |
{
|
22 |
{
|
23 |
maxUsers.Clear();
|
23 |
maxUsers.Clear();
|
24 |
maxUsers.Add(c);
|
24 |
maxUsers.Add(c);
|
25 |
maxElo = newElo;
|
25 |
maxElo = newElo;
|
26 |
}
|
26 |
}
|
27 |
else if (newElo == maxElo) maxUsers.Add(c);
|
27 |
else if (newElo == maxElo) maxUsers.Add(c);
|
28 |
}
|
28 |
}
|
29 |
var pickedUser = maxUsers[rand.Next(maxUsers.Count)];
|
29 |
var pickedUser = maxUsers[rand.Next(maxUsers.Count)];
|
30 |
[/quote]
|
30 |
[/quote]
|
31 |
\n
|
31 |
\n
|
32 |
doing the same thing as:
|
32 |
doing the same thing as:
|
33 |
[quote] foreach (var c in candidates)
|
33 |
[quote] foreach (var c in candidates)
|
34 |
{
|
34 |
{
|
35 |
var newElo = Math.Round(c.Elo;/10)*10
|
35 |
var newElo = Math.Round(c.Elo;/10)*10
|
36 |
if (newElo > maxElo)
|
36 |
if (newElo > maxElo)
|
37 |
{
|
37 |
{
|
38 |
maxUsers.Clear();
|
38 |
maxUsers.Clear();
|
39 |
maxUsers.Add(c);
|
39 |
maxUsers.Add(c);
|
40 |
maxElo = newElo;
|
40 |
maxElo = newElo;
|
41 |
}
|
41 |
}
|
42 |
else if (newElo == maxElo) maxUsers.Add(c);
|
42 |
else if (newElo == maxElo) maxUsers.Add(c);
|
43 |
}
|
43 |
}
|
44 |
var pickedUser = maxUsers[rand.Next(maxUsers.Count)];
|
44 |
var pickedUser = maxUsers[rand.Next(maxUsers.Count)];
|
45 |
[/quote]
|
45 |
[/quote]
|
46 |
just with a tone of usless steps?
|
46 |
just with a tone of usless steps?
|
|
|
47 |
(you can also take out the randomiser and Math.round() steps because they also have no real effect on the balance)
|