@@ -13,13 +13,13 @@ const MAX_GAME_ID_LENGTH = 64;
13
13
const MAX_UNFINISHED_GAMES_PER_HOUR = 4 ;
14
14
15
15
// 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 ;
18
18
const BASE_RATING = 1200 ;
19
19
// Parameters not currently in use, see additional comment in finishGame().
20
- // const LEARNING_RATE_INTERMEDIATE = 16 ;
20
+ // const LEARNING_RATE_INTERMEDIATE = 32 ;
21
21
// const LEARNING_RATE_INTERMEDIATE_THRESHOLD = 250;
22
- // const LEARNING_RATE_ADVANCED = 8 ;
22
+ // const LEARNING_RATE_ADVANCED = 16 ;
23
23
// const LEARNING_RATE_ADVANCED_THRESHOLD = 500;
24
24
25
25
type TransactionResult = {
@@ -135,7 +135,6 @@ export const finishGame = functions.https.onCall(async (data, context) => {
135
135
}
136
136
137
137
// Compute new rating for each player.
138
- const playerCountMultiplier = 1.0 / ( players . length - 1 ) ;
139
138
const updates : Record < string , number > = { } ;
140
139
for ( const player of players ) {
141
140
const learningRate = LEARNING_RATE_BEGINNER ;
@@ -163,8 +162,7 @@ export const finishGame = functions.https.onCall(async (data, context) => {
163
162
164
163
const newRating =
165
164
ratings [ player ] +
166
- playerCountMultiplier *
167
- learningRate *
165
+ learningRate *
168
166
( achievedRatio [ player ] - likelihood [ player ] / totalLikelihood ) ;
169
167
170
168
updates [ `${ player } /${ gameMode } /rating` ] = newRating ;
0 commit comments