-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Gurzeh 4553 #4589
Gurzeh 4553 #4589
Conversation
Dev merge to master, PR
As prev_level_xp is in fact the xp of the current level - 1, we need to have the have the value of the current level, which we get from a hard coded value matrix xp_per_level
Merge branch 'gurzeh-4553' of https://github.com/Gurzeh/PokemonGo-Bot into gurzeh-4553
@Gurzeh, thanks for your PR! By analyzing the annotation information on this pull request, we identified @Moonlight-Angel, @brantje and @sergiopalacio to be potential reviewers |
|
||
# hard coded values to supplement unknown current_level_xp | ||
global xp_per_level | ||
xp_per_level = [[0, 0], [1000, 1000], [2000, 3000], [3000, 6000], [4000, 10000], [5000, 15000], [6000, 21000], [7000, 28000], [8000, 36000], [9000, 45000], [10000, 55000], [10000, 65000], [10000, 75000], [10000, 85000], [15000, 100000], [20000, 120000], [20000, 140000], [20000, 160000], [25000, 185000], [25000, 210000], [50000, 260000], [75000, 335000], [100000, 435000], [125000, 560000], [150000, 710000], [190000, 900000], [200000, 1100000], [250000, 1350000], [300000, 1650000], [350000, 2000000], [500000, 2500000], [500000, 3000000], [750000, 3750000], [1000000, 4750000], [1250000, 6000000], [1500000, 7500000], [2000000, 9500000], [2500000, 12000000], [3000000, 15000000], [5000000, 20000000]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do i read this? is there any pattern?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are couples of xp / level (40 of them)
The first value is the XP to reach the level, the second is the total XP earned.
Reference is there http://heavy.com/games/2016/07/pokemon-go-xp-gained-per-level-how-much-needed-need-to-up-advance-chart-graph-image/
It seems the tests/update_live_stats_test must be updated as well. |
@Gurzeh Are you going to take care of updating the test as well? Also the xp_per_level data should probably live in the data folder rather than the function so that if any other workers require access to it, they can. I agree it may not update very often, but it is global data that should be able to be used by others (good coding practice) |
@k4n30 yes for updating the test, and ok for moving the list outside code. |
XP is now in a json file in data directory test file update_live_stats_test.py to reflect chnage in calculation
@k4n30 not that familiar with GitHub... But I think the new commits are incorporated. Do you confirm? |
Looks good to me :) added second review tag for devs to review and merge if all good |
Short Description:
As current_level_xp is not available in API, we put hard coded values in matrix xp_per_level and referred to it to calculate accurate stats.
Details
at any level, level_stats should show (like the app):
XP earned at the current level / XP to pass next level
in fact, level_apps shows (XP previous level + XP earned at the current level) / (XP previous level + XP to pass next level)
Ex: Level 16 is 20.000 and level 17 also, so when it starts, it shows 50% where it should show 0%
Level 16 (20,095 / 40,000, 50%)
Issues references
Fixes #4553