Correct, the old score is lost, but the old PP value(the raw floating point number) doesn't have to be. If it's stored temporarily as just a number, you could regularly calculate a player's pp after he sets a highscore then compare it to that temporarily stored raw value. That is, store it before you update a player's pp, compare it, update with the appropriate value, and delete the temporary memory segment. There is no need to recalculate the old pp value again using 2 highscores per map as you said. It's a really quick and simple algorithm, and I honestly do not see the problem in implementing that. You must know something regarding the algorithm that I don't if you're still not convinced.Tom94 wrote:
That works only for the first new score coming in. Imagine a new (higher) pp value gets chosen and updated while the score which caused the pp increase doesn't get saved, since there is a higher score lying around already.CookChefSteak wrote:
But since every player's current pp is stored as an integer on the server, why is it not possible or plausible to store newly calculated pp as a temporary variable before calling on the server's pp-update method, and compare it with the stored[old] pp value? It looks like a simple if statement in my head. It just seems like something like that should be very possible in a well-modulated algorithm. I'll say it again though, I don't know how you programmed it so it might not be that simple. Maybe if you could shed some light on the technical aspects of the algorithm I'll understand better.
Now the same scenario happens again: The newly calculated pp value only features the one new score + all old ones in the database. The score used previously to increase the pp is completely lost!
Also, just to clarify: pp is a floating point number. Even if the number you see doesn't change with a score you get, you still might have gotten a fraction of a pp.
anyways an example:
1. a highscore is achieved
2. current player pp is 2280
3. 2280 stored as float = current_pp
3. pp method runs with the highscore as an argument
4. algorithm yields 2270 as the appropriate pp considering the new score(float newpp = ppcalculate(args);)
5. newpp > current_pp ? server.query(newpp) : server.query(current_pp);
that's it...