SteamWar/BungeeCore
Archiviert
13
2

Hotfix team elo scaling
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-05-13 15:35:47 +02:00
Ursprung 9af07f821d
Commit 4422fbdc8b

Datei anzeigen

@ -185,11 +185,11 @@ public class FightEndsHandler extends PacketHandler {
} }
private void calcSchemElo(int eloSchemOwn, int eloSchemEnemy, int schemId, double result) { private void calcSchemElo(int eloSchemOwn, int eloSchemEnemy, int schemId, double result) {
double winSchemExpectation = calsWinExpectation(eloSchemOwn, eloSchemEnemy); double winSchemExpectation = calcWinExpectation(eloSchemOwn, eloSchemEnemy);
SchemElo.setElo(schemId, (int) Math.round(eloSchemOwn + K * (result - winSchemExpectation))); SchemElo.setElo(schemId, (int) Math.round(eloSchemOwn + K * (result - winSchemExpectation)));
} }
private double calsWinExpectation(int eloOwn, int eloEnemy) { private double calcWinExpectation(int eloOwn, int eloEnemy) {
return 1 / (1 + Math.pow(10, (eloEnemy - eloOwn) / 600f)); return 1 / (1 + Math.pow(10, (eloEnemy - eloOwn) / 600f));
} }
@ -212,19 +212,11 @@ public class FightEndsHandler extends PacketHandler {
} }
private double getBlueEloFactor(int blueElo, int redElo) { private double getBlueEloFactor(int blueElo, int redElo) {
if (blueElo == 0) blueElo = 1; return 2 - calcWinExpectation(blueElo, redElo) * 2;
if (redElo == 0) redElo = 1;
return sigmoid(redElo / (double) blueElo);
} }
private double getRedEloFactor(int blueElo, int redElo) { private double getRedEloFactor(int blueElo, int redElo) {
if (blueElo == 0) blueElo = 1; return 2 - calcWinExpectation(redElo, blueElo) * 2;
if (redElo == 0) redElo = 1;
return sigmoid(blueElo / (double) redElo);
}
private double sigmoid(double x) {
return 1 / (1 + Math.exp(-2 * (x - 1))) * 2;
} }
private double getRematchFactor(FightEndsPacket fightEndsPacket) { private double getRematchFactor(FightEndsPacket fightEndsPacket) {