-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Leveler] XP bar on the profile card is wrong #45
Comments
Can you check the same with |
Thanks for getting back to me so quickly :) I'm running a the bot only on one server, if that matters. |
Yep, that matches the numbers! Because when I check the profile of somebody with level 3 currently, Thanks :) Will the change just be pushed or do you gather commits to a big(ger) relase? You can also ping me on Discord in the RedBot server, once this fix is out (zonk there). |
If you want, you can switch to |
Thanks for the info :) If it might be unstable, I think I'll wait a bit. None of the bugs I've reported are super urgent currently. |
i dont know what im doing already, send help
Describe the bug
I've just done the math and was wondering why the leaderboard with
?top
says I have less XP than I should have by accumulating the values of the past levels shown on the profile card shown with?profile
. I couldn't wrap my head around it until I've tried around with some users. Seems like the XP required shown in the XP bar in the profile is calculated here:Fixator10-Cogs/leveler/leveler.py
Line 3620 in b96ff1f
But the top leaderboard and the XP that actually leads to levelups uses this formula:
Fixator10-Cogs/leveler/leveler.py
Line 3623 in b96ff1f
One example: the profile card said the user is Level 3 and at 468/621 XP to level up. But when I did check the leaderboard, it said they had 1080 points. I used the second formula to calculate that they needed 1094 XP to level up. So 14 XP more, not 153 XP like their profile said. They wrote a message, it gave 17 XP and they leveled up. The leaderboard showed 1097 points and their profile said Level 4 and 3/760 XP. the 760 needed is of course incorrect again. From 4 to 5 you need 621 XP to level up, not 760 (as calculated via the second formula). I've plotted the actual values in this pastebin. The "earned" value is interesting for the leaderboards. I assume that the XP required is calculated by the wrong formula here:
Fixator10-Cogs/leveler/leveler.py
Line 3022 in b96ff1f
I think you just need to use the second formula and subtract the overall XP for the next level from the overall XP of the current level. My guess could be wrong, though.
To Reproduce
Chat until
?top
says you're less than 20 XP away to a level up according to a value in the pastebin, e.g. 269 XP for level 2. Do?profile
and see how it says you need more than 20 XP for the level up. Write a message that yields XP. Check?profile
again and see that you've gained a level up.Expected behavior
The profile exp total for the level should be correct, for example with the formula mentioned above.
Bot's logs
No error or anything.
Red version
v3.4.0
Additional context
n/a
The text was updated successfully, but these errors were encountered: