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

Limit PokemonOptimizer logs only after catching a Pokemon #5235

Closed
hobbes3 opened this issue Sep 6, 2016 · 9 comments
Closed

Limit PokemonOptimizer logs only after catching a Pokemon #5235

hobbes3 opened this issue Sep 6, 2016 · 9 comments
Assignees

Comments

@hobbes3
Copy link

hobbes3 commented Sep 6, 2016

Short Description

Make the PokemonOptimizer display log only after catching a Pokemon.

Possible solution

PokemonOptimizer currently spams the logs every second. Regardless of whether the bot catches a Pokemon or not. For example:

[2016-09-06 07:48:44] [FollowPath] [INFO] Walking from (37.79268757281985, -122.39339298324255, 8.030725657710692) to (37.7930338, -122.3929975, 8.0), distance left: (0.05 km) ..
[2016-09-06 07:48:45] [UpdateLiveStats] [INFO] xxx | Uptime : 0:33:37 | Earned 4,801 Stardust | +9,195 XP | 16,412 XP/h | Visited 46 stops
[2016-09-06 07:48:45] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:48:45] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:48:45] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396113 stardust]
[2016-09-06 07:48:46] [FollowPath] [INFO] Walking from (37.79271549998604, -122.39336821335196, 8.220596891714258) to (37.7930338, -122.3929975, 8.0), distance left: (0.05 km) ..
[2016-09-06 07:48:46] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:48:46] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:48:46] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396113 stardust]
[2016-09-06 07:48:47] [FollowPath] [INFO] Walking from (37.79274049309204, -122.39333704535689, 8.275425897523267) to (37.7930338, -122.3929975, 8.0), distance left: (0.04 km) ..
[2016-09-06 07:48:48] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:48:48] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:48:48] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396113 stardust]
[2016-09-06 07:48:49] [FollowPath] [INFO] Walking from (37.79277202401491, -122.39330045941107, 8.095191705819452) to (37.7930338, -122.3929975, 8.0), distance left: (0.04 km) ..
[2016-09-06 07:48:49] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:48:49] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:48:49] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396113 stardust]
[2016-09-06 07:48:50] [FollowPath] [INFO] Walking from (37.792804316699886, -122.39326152817988, 8.293767625894523) to (37.7930338, -122.3929975, 8.0), distance left: (0.03 km) ..
[2016-09-06 07:48:50] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:48:50] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:48:50] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396113 stardust]
[2016-09-06 07:48:51] [FollowPath] [INFO] Walking from (37.79282832407298, -122.39323150022919, 8.389271657574023) to (37.7930338, -122.3929975, 8.0), distance left: (0.03 km) ..
[2016-09-06 07:48:52] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:48:52] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:48:52] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396113 stardust]
[2016-09-06 07:48:52] [  SpinFort] [INFO] Spun pokestop Les 3 Dauphins. Experience awarded: 50. Items awarded: 3x Pokeball
[2016-09-06 07:48:56] [FollowPath] [INFO] Walking from (37.79284954410439, -122.39320413633706, 8.419873814028811) to (37.7930338, -122.3929975, 8.0), distance left: (0.03 km) ..
[2016-09-06 07:48:57] [UpdateLiveStats] [INFO] xxx | Uptime : 0:33:49 | Earned 4,801 Stardust | +9,245 XP | 16,406 XP/h | Visited 47 stops
[2016-09-06 07:48:57] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:48:57] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:48:57] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396113 stardust]
[2016-09-06 07:48:58] [PokemonCatchWorker] [INFO] A wild Zubat appeared! [CP 412] [NCP 0.64] [Potential 0.58] [A/D/S 14/8/4]
[2016-09-06 07:49:08] [PokemonCatchWorker] [INFO] Nice Curveball throw! Used Greatball, with chance 41.36 (3 left)
[2016-09-06 07:49:08] [PokemonCatchWorker] [INFO] Zubat capture failed.. trying again!
[2016-09-06 07:49:19] [PokemonCatchWorker] [INFO] Excellent Curveball throw! Used Greatball, with chance 41.36 (2 left)
[2016-09-06 07:49:19] [PokemonCatchWorker] [INFO] Captured Zubat! [CP 412] [NCP 0.64] [Potential 0.58] [14/8/4] (402/800) [+210 exp] [+100 stardust]
[2016-09-06 07:49:19] [PokemonCatchWorker] [INFO] You now have 26 Zubat candy!
[2016-09-06 07:49:25] [UpdateLiveStats] [INFO] xxx | Uptime : 0:34:17 | Earned 4,901 Stardust | +9,455 XP | 16,550 XP/h | Visited 47 stops
[2016-09-06 07:49:25] [PokemonOptimizer] [INFO] Pokemon Bag: 411/650
[2016-09-06 07:49:25] [PokemonOptimizer] [INFO] Transferring 0 Pokemon
[2016-09-06 07:49:25] [PokemonOptimizer] [INFO] Skipping evolution step. Not enough Pokemon to evolve with lucky egg: 4/80
[2016-09-06 07:49:25] [PokemonOptimizer] [INFO] Upgrading 0 Pokemon [396213 stardust]

How it would help others

Show more relevant information for the PokemonOptimizer in the logs.

@julienlavergne
Copy link
Contributor

julienlavergne commented Sep 6, 2016

You config issue, read https://github.com/PokemonGoF/PokemonGo-Bot/blob/dev/docs/pokemon_optimizer.md
You specifically asked the PokemonOptimizer to always run, whatever the state of your bag.
change min_slots_left

@beltoft
Copy link

beltoft commented Sep 6, 2016

but instead of it running after every task it should only run if there's a change in the bag.
After a pokemon have been catched.

Also i don't understand why it exchanges pokemon before evolving for xp. I see that pokemon is exchanged even if i have enough candy to evolve them. when evolve for xp is true I would assume that it would evolve every pokemon possible and then it could exchange after have evolved whatever possible

@julienlavergne
Copy link
Contributor

  • The Pokemon optimizer only run when your bag has less space left that what is in config. Otherwise it does not run. There is no such thing as "it run after every task".
  • No, Pokemon that we plan to evolve for XP are not transferred.

@beltoft
Copy link

beltoft commented Sep 6, 2016

ok if "min_slots_left" is set higher than bag size it will run all the time creating the log above. What we are asking here is if would be possible to make it only run if a pokemon is catched. There is no need for the optimizer to run if the bag haven't changed since last run.

My other question is that i often see this even when Evolve for xp is true:
[PokemonOptimizer] [INFO] Exchanged Weedle [IV 0.47] [CP 70] [110 candies]

why is this not evolved even though there's enough candy available? i don't have any lucky eggs so it's not because it's waiting for more, also no other weedles is evolved after the exchange.
I think it would make more sense to evolve for xp first and then exchange after.
Maybe another round of evolve could then be run if there's enough candy after the exchange.

I'm hoping i could make the bot catch a pokemon, check if it can be evolved for xp and then exchange it, if it's not a keeper.

@julienlavergne
Copy link
Contributor

julienlavergne commented Sep 6, 2016

ok if "min_slots_left" is set higher than bag size it will run all the time creating the log above.

Yes, so why are you putting it higher than the bag size if you don't want the task to always run ?

My other question is that i often see this even when Evolve for xp is true:
[PokemonOptimizer] [INFO] Exchanged Weedle [IV 0.47] [CP 70] [110 candies]

why is this not evolved even though there's enough candy available?

I have to see your config to explain the scenario. This is a very normal behavior and there is multiple way to explain it.

I think it would make more sense to evolve for xp first and then exchange after.
Maybe another round of evolve could then be run if there's enough candy after the exchange.

That is not at all how it is working. There is an algorithm running that already know in advance how many Pokemon will be transferred, how many will be evolved and how many candies you will have left at the end.
At the end of the task, there is no other evolution that can be done at all, you can open your app and verify that by yourself. You will either have not enough candies, or will have to evolve a Pokemon that does not meet the criteria you have in your config.

I'm hoping i could make the bot catch a pokemon, check if it can be evolved for xp and then exchange it, if it's not a keeper.

You have to use the Evolve task for that, not the Pokemon Optimizer. The Pokemon Optimizer will keep Pokemons on long run for the sake of xp or candies.

@hobbes3
Copy link
Author

hobbes3 commented Sep 6, 2016

I set min_slots_left to 99999 because I still occasionally log on my account normally and I don't want to see 600+ Pokemons in my bag. It's fine that PokemonOptimizer keeps some Pokemons that will be evolved but for me it'll only keep up to 80 until it pops a lucky egg and evolve them all.

And I don't mind that the PokemonOptimzer runs every second, but can we suppress the messages if nothing has changed in the bag?

@julienlavergne
Copy link
Contributor

Let me dig into some details to explain why it is not that easy to do:

  • Once you have less space left than the configured value (your case), the Pokemon Optimizer will run. What can impact the result is not only the fact that a new Pokemon has been caught. It can also been gaining candies, stardust, leveling up, spinning fort etc...
    So running only after the content of the pokemon bag has changed is going to break stuff.
  • It is easy to not log anything when there is 0 pokemon to evolve or 0 pokemon to transfer. It is hard to see why we would not log the line that says you are 4/80 for lucky eggs. And i can already see Improvement request coming asking to still get log messages when the PokemonOptimizer has nothing to do. Otherwise you won't even know it is running.

Now, I am thinking about another solution, but I need to think more :)

@julienlavergne
Copy link
Contributor

I got something to work. Will do a commit soon to fix that.

@julienlavergne
Copy link
Contributor

Done

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

No branches or pull requests

3 participants