Skip to content
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

PVP Stats #120

Merged
merged 33 commits into from
Jul 24, 2020
Merged

PVP Stats #120

merged 33 commits into from
Jul 24, 2020

Conversation

123FLO321
Copy link
Collaborator

@123FLO321 123FLO321 commented May 23, 2020

Description

  • adds pvp stats for great and ultra league
  • added pvp_rankings_great_league and pvp_rankings_ultra_league columns to pokemon table
  • added pvp_rankings_great_league and pvp_rankings_ultra_league to pokemon webhook
  • added pvp ranking info to pokemon marker popup
  • added image generator for Italian Language Support #1, Should be Meteor Mash #2 and Should be Muddy Water #3 pvp pokemon (add the icons bellow to the misc folder

Icons

  • first.png:
    first
  • second.png:
    second
  • third.png
    third

Format

{
    "pvp_rankings_ultra_league": [
        {
            "rank": 2007,
            "percentage": 0.7161216527817746,
            "pokemon": 410,
            "form": 0,
            "level": 40.0,
            "cp": 69
        },
        {
            "percentage": 0.7999241285739804,
            "pokemon": 411,
            "form": 0,
            "rank": 3007,
            "level": 25.5,
            "cp": 420
        }
    ],
    "pvp_rankings_great_league": [
        {
            "form": 0,
            "pokemon": 410,
            "rank": 2007,
            "percentage": 0.7161216527817746,
            "level": 40,
            "cp": 69
        },
        {
            "rank": 3007,
            "form": 0,
            "pokemon": 411,
            "percentage": 0.7999241285739804,            
            "level": 25.5,
            "cp": 420
        }
    ],
   ...
}

Motivation and Context

includes #119

How Has This Been Tested?

Tested locally. Needs more testing

Screenshots (if appropriate):

Bildschirmfoto 2020-05-24 um 00 11 16

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@123FLO321 123FLO321 added enhancement New feature or request backend Related to the backend frontend Related to the frontend db-migration minor Adds functionality labels May 23, 2020
@123FLO321 123FLO321 mentioned this pull request May 24, 2020
6 tasks
@123FLO321 123FLO321 linked an issue May 24, 2020 that may be closed by this pull request
@LordJavi
Copy link
Contributor

Has been running 24h without issues

@LordJavi
Copy link
Contributor

LordJavi commented Jun 3, 2020

I think Galarian form doesn't evolves

Screenshot from 2020-06-03 21-54-58

@123FLO321
Copy link
Collaborator Author

123FLO321 commented Jun 3, 2020

@LordJavi Stunfisk doesn‘t have an evo in general right?

@unseenmagik
Copy link

image

Suffering huge CPU issues with the PR.

@LordJavi
Copy link
Contributor

LordJavi commented Jun 4, 2020

oh, you're right

Screenshot from 2020-06-04 08-52-52

In this case, rank is wrong.

15/15/15 -> 2162CP rank1 for UL

@DavisPoGo
Copy link
Contributor

I've been running this for the past couple days. The pvp aspect of this works well. The CPU consumption needs to be looked at. When I first ran this, I did not add the new icons and the increase to CPU was noticeable but pretty minor. Then, I added the icons and restarted. The CPU was >90% during icon creation. I expected the load to be reduced after all the icons were generated but this was not the case. Even after icons were generated and I restarted RDM, CPU load was >90%. So, I removed all the new icons and restarted. CPU load dropped back to normal.

@LordJavi
Copy link
Contributor

Some problems with Oddish (evolve to Bellossom)

Screenshot from 2020-07-17 14-39-01

Screenshot from 2020-07-17 14-40-51
Screenshot from 2020-07-17 14-42-16

Bellossom is rank2 and RDM says rank1

Probably it happens with more pokémon

@123FLO321
Copy link
Collaborator Author

Thats just a rounding problem. Notice how they are extremely close in ranking points.
Also in the first picture both have the same pointe (making the both nr1).
RDM doesn‘t round the result while other sources might. If you someone can tell me what correct implementation is I‘ll fix it but every pokemon pvp rankings list rounds differently.

@LordJavi
Copy link
Contributor

Thats just a rounding problem. Notice how they are extremely close in ranking points.
Also in the first picture both have the same pointe (making the both nr1).
RDM doesn‘t round the result while other sources might. If you someone can tell me what correct implementation is I‘ll fix it but every pokemon pvp rankings list rounds differently.

Not really, but if CP is calculated can't be compared? rank 1 always have best CP, isn't?

@123FLO321
Copy link
Collaborator Author

That shouldn't matter.
Both have the same PVP rating and therefore a both number 1

@123FLO321
Copy link
Collaborator Author

Does the performance problem still exist?

Copy link
Contributor

@DavisPoGo DavisPoGo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With the latest commits, the CPU usage is not significantly higher than rdm without this pr. During image generation, CPU usage spikes but once that is complete, CPU drops to normal. PVP calculations look good as well. Ready to merge in my opinion,

@kbtbc
Copy link
Contributor

kbtbc commented Jul 21, 2020

That shouldn't matter.
Both have the same PVP rating and therefore a both number 1

Given identical PVP ratings, why wouldn't CP then be the deciding factor? It could matter depending on the match-ups if a 2281 CP vs a 2275 CP allows the Pokemon to absorb one more hit, thus making it "better". It seems like it should matter.

@123FLO321
Copy link
Collaborator Author

@kbtbc i believe thats already taken into account when calculating the pvp value

@123FLO321
Copy link
Collaborator Author

123FLO321 commented Jul 21, 2020

Their attack defense and stamina values (not IV but calculated values) are identical just happens to not be identical CP because of how pogo calculates cp

@kbtbc
Copy link
Contributor

kbtbc commented Jul 21, 2020

Ok, cool. I'm pulling now to test.

When you merge, please add a 'if exists drop' for the db migration ;-)

@123FLO321 123FLO321 requested a review from a team July 21, 2020 19:20
Copy link
Contributor

@kbtbc kbtbc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have deployed the latest version of this, and it seems to be running fine last 30min. No noticable cpu spike. I am not running the front-end, so no image-generation was done in my test.

I do see the new values updated in the new pvp fields in my db. Everything seems to be functioning fine.

...Will there also be an update to the Poracle PR?
see: KartulUdus/PoracleJS#151 (comment)

@123FLO321 123FLO321 merged commit e6540d3 into RealDeviceMap:master Jul 24, 2020
Swiss-Rainbow added a commit to Swiss-Rainbow/RealDeviceMap that referenced this pull request Jul 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Related to the backend db-migration enhancement New feature or request frontend Related to the frontend minor Adds functionality
Development

Successfully merging this pull request may close these issues.

[Feature Request] PvP Rankings
7 participants