Skip to content

Commit ae571d2

Browse files
authored
Merge pull request #108 from ekzhang/develop
Release 3.1.1
2 parents 154d415 + 0faf062 commit ae571d2

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

functions/src/index.ts

+5-7
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ const MAX_GAME_ID_LENGTH = 64;
1313
const MAX_UNFINISHED_GAMES_PER_HOUR = 4;
1414

1515
// Rating system parameters.
16-
const SCALING_FACTOR = 400;
17-
const LEARNING_RATE_BEGINNER = 32;
16+
const SCALING_FACTOR = 800;
17+
const LEARNING_RATE_BEGINNER = 64;
1818
const BASE_RATING = 1200;
1919
// Parameters not currently in use, see additional comment in finishGame().
20-
// const LEARNING_RATE_INTERMEDIATE = 16;
20+
// const LEARNING_RATE_INTERMEDIATE = 32;
2121
// const LEARNING_RATE_INTERMEDIATE_THRESHOLD = 250;
22-
// const LEARNING_RATE_ADVANCED = 8;
22+
// const LEARNING_RATE_ADVANCED = 16;
2323
// const LEARNING_RATE_ADVANCED_THRESHOLD = 500;
2424

2525
type TransactionResult = {
@@ -135,7 +135,6 @@ export const finishGame = functions.https.onCall(async (data, context) => {
135135
}
136136

137137
// Compute new rating for each player.
138-
const playerCountMultiplier = 1.0 / (players.length - 1);
139138
const updates: Record<string, number> = {};
140139
for (const player of players) {
141140
const learningRate = LEARNING_RATE_BEGINNER;
@@ -163,8 +162,7 @@ export const finishGame = functions.https.onCall(async (data, context) => {
163162

164163
const newRating =
165164
ratings[player] +
166-
playerCountMultiplier *
167-
learningRate *
165+
learningRate *
168166
(achievedRatio[player] - likelihood[player] / totalLikelihood);
169167

170168
updates[`${player}/${gameMode}/rating`] = newRating;

src/pages/HelpPage.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -327,8 +327,7 @@ function HelpPage() {
327327
S<sub>i</sub>
328328
</em>{" "}
329329
is the achieved ratio of sets obtained by player <em>i</em> and{" "}
330-
<em>K</em> is an additional factor based on the number of players in
331-
the game and your level of experience.
330+
<em>K</em> is an additional factor based on your level of experience.
332331
</Typography>
333332
<Typography variant="body1" gutterBottom>
334333
Note that while the rating is displayed as an integer, it is stored

0 commit comments

Comments
 (0)