Nightbird, on 11 June 2020 - 03:54 PM, said:
Another point on how easy it is to do rolling average:
Today we have a saved variable per player called PSR, and after a match we have a PSR_change. So the code for the new PSR is:
new_PSR = old_PSR + PSR_change.
To do a rolling average for MS over the last 50 games, we only need to save two variables, avgMS and N (N is matches played). After a match we have currentMS score.The code for the new avgMS is:
if N<50 then new_avgMS = old_avgMS * N/(N+1) + currentMS / (N+1)
if N>=50 then new_avgMS = old_avgMS * 49/50 + currentMS / 50
new_N = old_N+1
To do a rolling average for W/L over 50 games, likewise we need to save just two variables WLR and N. After a match we get a RESULT which is 1 for a win or 0 for a loss. Code:
if N<50 then new_WLR = {N * [old_WLR/(old_WLR + 1)] + RESULT} / {N * [1 - old_WLR/(old_WLR + 1)] - RESULT + 1}
if N>=50 then new_WLR = {49 * [old_WLR/(old_WLR + 1)] + RESULT} / {49 * [1 - old_WLR/(old_WLR + 1)] - RESULT + 1}
Takes a programmer 1 hr to do all of this. A new MM would take time but just a rolling MS or WL average took me 10 minutes to figure out.
Not even that.
Just assume N=100 always.
When you first start (a player, or weight class, or a chassis, or a variant), seed it with N dummy match scores.
New player = "N * target to be average" (or 90% of that if we assume they suck to start)
New weight class = "N * player average" (or 90% of that if we assume they suck to start) - means your first mech assumes you are 81% of average.
New chassis = "N * weight class average" (or 90% of that if we assume they suck to start) - means your first mech assumes you are 72% of average.
New variant = "N * chassis average" (or 90% of that if we assume they suck to start) - means your first mech assumes you are 63% of average.
(Or you just seed player, and mech 1 at 90% straight up)
Weight Class PSR is calculable as SUM(PSR for class variants) / number of variants on the rare occasion you need it,
Chassis PSR is calculable as SUM(PSR for chassis variants) / number of variants when you need it,
Let's say your "rolling average" PSR for your BLR 1G = 250 * 100 = 25,000. And that's your "player" PSR as well.
This match you get 280. 25,000 - 250 + 280 = 25,030. 25,000 - 250 + 280 = 25,030.
There's your new PSR with 100 match rolling average.
You drop in your first match in your new BLR 1D. You get given a PSR of 25,030 * 0.9 = 22,527
This match you get 250. 22,527 - 225 + 250 = 22,552. 25,000 - 250 + 250 = 25,000.
Next match you get 240. 22,552 - 226 + 240 = 22,566. 25,000 - 250 + 240 = 24,990.
Then let's say once a month, you go
"The average PSR is 20,000"
Player PSR = Player PSR + ((20,000 - Player PSR) * 0.05)
e.g. 25,000 + (0.05 * -5,000) = 25,000 - 250 = 24,750
BLR-1G PSR = BLR-1G PSR + ((20,000 - BLR-1G PSR ) * 0.05)
BLR-1D PSR = BLR-1D PSR + ((20,000 - BLR-1D PSR ) * 0.05)
...
And you use "PSR" instead of W/L because you can change PSR more subtly than W/L.
Even make it = W/L.
Edited by David Sumner, 11 June 2020 - 11:22 PM.