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

Pokemon Optimizer enhancements #5365

Merged
merged 1 commit into from
Sep 12, 2016
Merged

Pokemon Optimizer enhancements #5365

merged 1 commit into from
Sep 12, 2016

Conversation

julienlavergne
Copy link
Contributor

@julienlavergne julienlavergne commented Sep 10, 2016

  • Sorting criteria and requirements for keeping Pokemon, evolving and upgrading, can now be defined independently:
    • You can define minimum requirements to keep Pokemon, on top of the already existing sorting feature
    • You can define minim requirements for evolution and upgrade.
  • You can now keep, evolve, upgrade Pokemon which have attributes within a certain range or below a value. Currently it is only above a certain value.
  • Configuration format changed a bit to couple with new features.
  • Update doc
    [Feature Request] release_above_cp #5337

@@ -19,35 +19,31 @@
"groups": {
"gym": ["Dragonite", "Snorlax", "Lapras", "Arcanine"]
},
"keep": [
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, The format changed again...

@solderzzc
Copy link
Contributor

solderzzc commented Sep 12, 2016

👍

Approved with PullApprove

@julienlavergne julienlavergne merged commit 917fbaf into PokemonGoF:dev Sep 12, 2016
@helloj
Copy link
Contributor

helloj commented Sep 12, 2016

@anakin5

$ diff -u pokemon_optimizer.py.orig pokemon_optimizer.py
--- pokemon_optimizer.py.orig   2016-09-12 14:55:40.893743000 +0800
+++ pokemon_optimizer.py        2016-09-12 14:52:04.641743000 +0800
@@ -415,11 +415,12 @@
                 full_upgrade_stardust_cost += upgrade_cost[1]

             candies -= full_upgrade_candy_cost
-            self.ongoing_stardust_count -= full_upgrade_stardust_cost

-            if (candies < 0) or (self.ongoing_stardust_count < 0):
+            if (candies < 0) or (self.ongoing_stardust_count < full_upgrade_stardust_cost):
                 continue

+            self.ongoing_stardust_count -= full_upgrade_stardust_cost
             upgrade.append(pokemon)

         if self.config_evolve_for_xp:

@julienlavergne
Copy link
Contributor Author

@helloj Yes, it is equivalent actually, but the reason I wrote it like that is because I wanted to follow what I did for the candies.
With the way I wrote it, you can actually get how many stardust you are missing to upgrade all the Pokemon you want to upgrade. But with the way you wrote it, you cannot.
That maybe an information I want to display at some point.

@helloj
Copy link
Contributor

helloj commented Sep 12, 2016

@anakin5 I have two pokemon, Pinsir and Vaporeon, can not upgrade
I can not remember the correct value at that time, please forgive me the following assumption value.

Total stardust = 50000

Pinsir candy: 3,
full_upgrade_candy_cost ~ 30,
full_upgrade_stardust_cost ~ 52000

Vaporeon candy: 100,
full_upgrade_candy_cost ~ 4
full_upgrade_stardust_cost ~ 4500

for pokemon in try_upgrade:  # => first item is Pinsir
  candies -= full_upgrade_candy_cost  # => -27
  self.ongoing_stardust_count -= full_upgrade_stardust_cost  # => -2000
  => continue to ignore Pinsir, OK

for pokemon in try_upgrade: # => second item is Vaporeon
  candies -= full_upgrade_candy_cost # => 96
  self.ongoing_stardust_count -= full_upgrade_stardust_cost # => -6500
  => continue to ignore Vaporeon, not OK

@julienlavergne
Copy link
Contributor Author

@helloj I see. for now Pokemon are taken in order of the Pokemon list because I do not have parameter to define who you want to upgrade first when several Pokemon can be upgraded. Some users might want to wait for enough stardust to upgrade Vaporeon rather than the Pinsir.
Your proposed change does not fix that issue, it simply has the effect of upgrading a maximum number of Pokemon but that may not be what people want.

Let's think about a way to define priority in upgrades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants