ToontownRewritten / api-doc

Documentation of Toontown Rewritten's Web APIs for developers.
https://toontownrewritten.com/
47 stars 7 forks source link

silly-meter: Calculating percentages from rewardPoints is slightly inaccurate. #13

Open LittleToonCat opened 4 years ago

LittleToonCat commented 4 years ago

With the v2.6.8 game update, the rewardPoints value was introduced, but attempting to calculate the percentage of each team with them does not exactly match up with the percentages shown in-game. In fact, adding the points all together doesn't add up to the exact 5,000,000 total.

I may not know how point accumulation works within the game itself, but a couple friends of mine have suggested that the API doesn't accumulate the points from the players who has not voted for a Silly Team (if this is true at all) and in return, inaccurate percentages.

The screenshot with the in-game percentages and the percentages based on the points returned by the API, and the points value itself from the last Reward phase is provided below for reference. image "rewardPoints":[1015490,959080,2683028]

While I can calculate the percentages by adding all three points together... 1015490 + 959080 + 2683028 = 4657598 And use that result in place as the whole instead of 5000000, That will result in a more accurate results, but it still doesn't slightly match up with the in-game percentages.

>>> 100 * 1015490 / 4657598
21.802869204255067
>>> 100 * 959080 / 4657598
20.591729900261896
>>> 100 * 2683028 / 4657598
57.60540089548304

(Notice how the first two percentages are correct, while the last one is not.)

Thunderbird91 commented 3 years ago

I brought up the whole "the team point values don't add up to 5000000" thing on the official Discord server a few months ago, and it was pointed out to me the fact that most of the various negative portions (Cog Buildings, Cog Invasions and cogs spawning) do NOT count against the individual team point values (going sad might, since that happens to individual toons), but they do affect the overall Silly Meter.