Let's talk about PPR! PPR Changes on Freon 1  (Read 15127 times)

Piglet

  • 1337
  • *
  • Posts: 3181
  • Country: gb
Let's talk about PPR! PPR Changes on Freon 1
« on: August 07, 2020, 12:50 »
"A Round"

A round isn't a standard thing in Freon, even more than in TAM. A round could be over in seconds with everyone frozen, or go on for a long time with people being thawed over and over again in overtime. Sure, overtime starts at 120 seconds...but the round can just go on and on and on and on.  A good player's contribution to a short round might be extreme. They might kill all 3 players on the ennemy team and score...what?...5 points?...and have a PPR of 5. A bad player could score more than that on a long round after dying 30 times just by spamming in the general direction of the enemy and get a higher PPR.

Average PPR

This is shown in the last column of the scoreboard. This is simple and easy to understand. You think. It's the average PPR over a number of games you've played on the server.

However it's not that easy. It doesn't take into account the map or the number of players in the game at the time. To remove the worst excesses of this I introduced a setting which can tell the server to not store stats for any match where there were not more than "n" players. We have this set to 5. Any match with fewer than 6 players is not counted.

If I only played Contrast or Goose, where you can thaw a lot my PPR would be about 15. If I only played open hitscan maps then it would be about 3. It sort of evens out over time....

The PPR that is stored is the Current PPR at the time the game ends or you leave. That value is not calculated very well at all:


Current PPR

This is shown in the first column of the scoreboard. It's supposed to show how well you're doing in this game so far. This is what the code currently has (up to today):

Code: [Select]
if("number of whole rounds played" > 0)
"What is shown" = "your Score" / "number of whole rounds played"
else
"What is shown" = "your Score"

The first problem is that it doesn't give a sensible number. For example:

If in the first 20 seconds of the first round of 120 seconds you score 5 points, it will show PPR = 5. By the time you hit overtime (after 120 seconds), if you continue scoring at that rate, then it will show PPR of 30 - even though your rate of scoring has not changed at any point in that round.

Ignore overtime for now. Assume the round ends after 120 seconds.

In the subsequent rounds the calculation uses the number of whole rounds played in the calculation of PPR. So, in the first second of the 2nd round, before you score your PPR is still 30. If you keep scoring at 5 points per 20 seconds in the second round then by overtime in that second round you've scored 60 points. The calculation for PPR says that you are scoring at a rate of "your Score / number of whole rounds played" = 60/1: you are shown as having 60 PPR.

We've become used to that in-game. As we've played a lot we sort of take that into account as we look at the scoreboard.

Here's the big problem: The balancer uses a combination of "Current PPR" (which is rubbish towards the start of a game) and "Average PPR" (which evens out from a combination of rubbish and good values). This combination gives rise to some of the strange balancing decisions you may have seen on the server. It doesn't matter how good the balancing logic is if the numbers it's using are bad.


PPR used in balancing.

As I mentioned, the balancer uses a combination of "Current PPR" and "Average PPR". We currently use 10% of the "Current PPR" and 90% of the "Average PPR" in the calculations. The idea behind this is that if you are having a bad day or a great day the balancer takes that into account as 10% of the PPR is uses when assigning teams.

From what I have said before, the Current PPR is really bad at certain points that the balancer may make calculations - and this leads to some poor moves to "balance".  If your average PPR is 6, but at the moment it does calculation of PPR you are in round 2 with a Current PPR of 60 due to the calcuation I show above then the balancer uses a value of (10% of 60)+(90% of 6) = 11.4.



Thoughts I had to make current PPR "better" tactically.

I know rounds can be over quickly, however many good games have rounds which go into overtime. If we assume that a round "is 120 seconds" (configurable) then we could calculate current PPR like this. The 0.2 is to prevent PPR looking really silly in the first 24 seconds of the map. One good spam into a group of enemies could be multiplied up to a really silly number PPR:


Code: [Select]
"proportion of current round played" = "round time so far" / 120
If "in overtime" then "proportion of current round played" = 1

if("number of whole rounds played" > 0 or "proportion of current round played" > 0.2)
"What is shown" = "your Score" / ("number of whole rounds played" + "proportion of current round played" )
else
"What is shown" = "your Score"



Thoughts I had to make the PPR value that the balancer uses better:

At the start of the game the current PPR value isn't helpful. There isn't enough information yet to use it. In the same way that I've used 0.2 to ignore the first 24 seconds of the first round for calculating current PPR (showing points instead), for balancing I would propose to use average PPR only for the first 0.2 of a game (24 seconds), and not to take any notice of current PPR.


So - for the first 0.2 of a round you're there, the balancer would use Average PPR to balance you.
After that time it would use the proportion of Current PPR (using the new method of calculation) and Average PPR configured.


I have a version of the code ready to test - now playing on Freon 1 - which shows the new Current PPR using that calculation method, as well as Average PPR and the PPR the balancer is using for you at any point in time. I think it does what I've explained above. If it doesn't work at all, use one of the other freon server (ictf/Freon) and let me know what you see as problematic. Screenshots and helpful information would be apprecoated.

« Last Edit: August 07, 2020, 14:35 by Piglet »

Piglet

  • 1337
  • *
  • Posts: 3181
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #1 on: August 07, 2020, 13:57 »
My initial observations.

1. The assumption for PPR purposes is that a round is 120 seconds means that for shorter rounds the current PPR is inflated - it assumes that you will score at your current rate for 120 seconds. It corrects at start of next round.

2. The assumption for PPR purposes is that a round is 120 seconds means that at 120 seconds when overtime starts it stops "predicting" your PPR, and effectively uses your current score in the round as the round total. As the overtime continues your PPR reflects the points you actually scored in rounds. It has no idea how long overtime could be so it can't predict it any longer.

holyspam

  • 1337
  • *
  • Posts: 329
  • Country: gr
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #2 on: August 07, 2020, 14:37 »
If the definition of PPR is changed to Score per 120 seconds, then it should no longer be called points per round, but points per unit of time.
Regular deathmatch already has this and it's called PPH, but there you respawn instantly.
Most rounds dont last 120seconds or reach overtime, but usually it's 1 minute and 10-20 seconds

Let's test this.
Player1 has avg ppr of 10, Player2 has avg ppr of 5.

Player1 gets 10 score in 30 seconds and dies right after thawing Player2.
Player2 gets 5 score in 20 seconds and dies, gets thawed, doesnt thaw Player1, then another 5 next 40 seconds and dies.

The round lasts for 120 seconds.

Player1 has a PP2M or PPR of 11.
Player2 has a PP2M or PPR of 10.

Next round begins and Player1 gets 10 score in 30 seconds, Player2 gets score of 1.
They both die at 30 seconds.
Round ends.

Player1 has 21 score. Player1 has 16.8 PP2M or 10.5PPR

Player2 has 12 score. Player2 has 9.6 PP2M or 5.5 PPR
« Last Edit: August 07, 2020, 14:41 by holyspam »

[MiA]Dave

  • 1337
  • *
  • Posts: 677
  • Country: us
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #3 on: August 07, 2020, 15:29 »
hmmmmmm
P.U.?
or
Poo P.U.?

Jozz

  • Junior Member
  • *
  • Posts: 37
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #4 on: August 07, 2020, 15:39 »
How is average PPR (from previous games) calculated? Does it average all the rounds you played and all the points you scored in those rounds? Or the average PPR per game, averaged over the number of games? How long a history?
 One thing I've often noticed is how easily the value drops (if for instance you join for last round and don't score, you lose a whole point from AvePPR), whereas it takes a long time to increase. I lost 2 points early this week because I joined in last round, someone ressed me seconds before end of game, and next game my phone went off and had to be answered around the end of first round. A big reduction for 2 rounds of partial play..

Piglet

  • 1337
  • *
  • Posts: 3181
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #5 on: August 07, 2020, 17:12 »
Hi Jozz,

The back end code appears to select the average of the last 20 maps in which you played for at least one round:

SELECT AVG('score'/'rounds') AS ppr FROM (SELECT 'score','rounds' FROM gamestats WHERE server_id=us AND player_id=you AND rounds>0 ORDER BY timestamp DESC LIMIT 20 AS t1");

That "rounds > 0" looks bad to me. If you just joined for a very short time at the end of the round and then left when the next round started it would give a low number

I might increase that number of rounds to include only when you've played more rounds....perhaps 3 or 4? More?

Edit: let's try with 4 or more rounds needed to count towards average PPR

« Last Edit: August 07, 2020, 17:17 by Piglet »

Jozz

  • Junior Member
  • *
  • Posts: 37
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #6 on: August 07, 2020, 17:19 »
Excellent, I knew there was something fishy there, that will fix a lot!
 Kops will have a higher PPR in future for instance  :D

kops

Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #7 on: August 07, 2020, 17:58 »
I get scared if my ppr >3

nyrde

  • Full MemberĀ 
  • *
  • Posts: 66
  • Country: fi
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #8 on: August 07, 2020, 18:53 »
If the distrubution of the appr over different maps is not normally distributed the median value could result in better results... It would "remove" extremeties from both the low and high end of ppr.

Piglet

  • 1337
  • *
  • Posts: 3181
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #9 on: August 07, 2020, 22:00 »
Are you any good with stats?

Here's an extract of score, number of rounds, and player ID across every recorded entry where the player has played at least 4 rounds:

https://hax.miasma.rocks/data.csv

If you can work out a better indicative PPR method than averaging the last 20, please let me know.

..and yes, we've had a 45 round game of freon....

hagis

  • 1337
  • *
  • Posts: 404
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #10 on: August 07, 2020, 22:54 »
..
The first problem is that it doesn't give a sensible number. For example:

If in the first 20 seconds of the first round of 120 seconds you score 5 points, it will show PPR = 5. By the time you hit overtime (after 120 seconds), if you continue scoring at that rate, then it will show PPR of 30 - even though your rate of scoring has not changed at any point in that round.

Ignore overtime for now. Assume the round ends after 120 seconds.
..

120 is just the standard round time - after which overtime starts

so the 'round' may take 30 seconds or 300 seconds,. but it's still a round?

I think it's not perfect,. and I may be persuaded to some other method but I don't see what advantage there is to points per time unit,. or whatever,.

some games I meet the same shooter, die and spend a lot of time froze,. other games I meet different players and alive,. so if we extend it further we could count the points made in the time whilst alive (am not actually suggesting that)

PPR has advantage,. it's easy to understand and it mostly works for balancing

the balancer at 10% current seems pretty good mostly,. restricting the ability to call 'teams' actually had made games fun,. rather than someone keep typing teams every time one side is a couple of rounds ahead

imagine if the balancer was 'perfect' and each side had same chance if everyone played at their standard,. - well that's not how it works,. sometimes you have a good game and other times not so much,. but overcoming an imbalance are actually the most fun and rewarding games,. like "we kicked a$$ and their team was stacked"

will see what it does I guess :)

hagis

  • 1337
  • *
  • Posts: 404
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #11 on: August 07, 2020, 22:58 »
That "rounds > 0" looks bad to me. If you just joined for a very short time at the end of the round and then left when the next round started it would give a low number

I might increase that number of rounds to include only when you've played more rounds....perhaps 3 or 4? More?

Edit: let's try with 4 or more rounds needed to count towards average PPR

Ah - that kind of change I can get behind,. I think TR's 3psn has a similar function,... PPR is only recorded at the end when you played 4 rounds and that makes sense (it's easy to come in near the end of the game kick a$$ for 2 rounds and end up with lot higher than normal PPR)

Piglet

  • 1337
  • *
  • Posts: 3181
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #12 on: August 07, 2020, 23:07 »
It was easier to add into the back-end than the game. I might retro-fit it into the game

hagis

  • 1337
  • *
  • Posts: 404
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #13 on: August 07, 2020, 23:17 »
ah - I say TR 3psn - but they did something likely in what was the backend - they ditched the standalone PHP and made the PPR stuff run within the game server (at least that's how it was explained to me)

but adding it in the php stuff is just as good / could be configurable from the php / mysql side

hagis

  • 1337
  • *
  • Posts: 404
  • Country: gb
Re: Let's talk about PPR! PPR Changes on Freon 1
« Reply #14 on: August 08, 2020, 01:00 »
actually,. I mentioned before somewhere but I do see an area where the current/avg ppr mix doesn't really work,.

so the idea of adding in current PPR to the mix is to deal with case where player is under or over performing to a significant degree

and that's cool - we can fiddle with the percentage of each PPR type and see what happens (10% is ok I think)

but.. where current PPR is not useful is when a player joins mid-match,. ideally we would apply simply avg PPR for players who recently joined (e.g. within 2 rounds)

current PPR doesn't need to be mixed in for players just joined (if that makes sense)