tejado / pgoapi

Pokemon Go API lib
Other
1.4k stars 445 forks source link

wild_pokemon missing after update #158

Open ghost opened 8 years ago

ghost commented 8 years ago

get_map_objects responses are missing wild_pokemon entries after update.

genIterator commented 8 years ago

You need to add a sleep of minimum 5s to get any pokemon data. (get_map_objects) Guess its due to the people that scanned with 10 accounts and whole countries. Must have created tons of traffic on niantics side.

joshk6656 commented 8 years ago

Could you explain what you mean by this? I have added a sleep before the get_map_objects call, and still am getting no response with 3 as the status.

dnsBlah commented 8 years ago

I'm having the same problem here. Even tho I get reply on the mapobjects, 9/10 times there are no wild_pokemon, or catchable_pokemon Only nearby_pokemon But there are no coordinates for them, as I guess these are the pokemons inside the 'radar' and only showing pokemon_id, distance (always 200) and encounter_id

Guess its time to walk around nearest spawn_points wait a second or 3 and see if something appears. :)

genIterator commented 8 years ago

Mh, indeed i have noticed the same issue. Checked nearby and wild/catchable pokemon and the difference is huge. Catchable pokemon are only those that are inside the 70m radius of your geolocation. The nearby list are all around a 200m radius (and always returns 200m for the pokemon distance...). Therefore the amount of nearby pokemon is probably always higher, because there can be pokemon outside the scanning grid, but inside the nearby "path" created by the grid. However, the difference is not acceptable at the moment. There is definitely something wrong. I get 10 different nearby and 1 wild pokemon for a scanned area. Though i know that there should be at least 5 pokemon in the grid. This probably means the scanning speed is too high.

I am currently running 4 accounts for scanning. The grid I want to scan (array of geolocations) gets split up, so the time for a full scan is reduced. This is due to the fact that each scan needs at least 5s time.sleep() after each api.get_map_objects() to not get a timeout. However, the current problem is, that we do not get a status_code 52 or anything else as an error. The server responds with an "s2_cell_id" and "current_timestamp_ms" dict, which could mean that the actual cell is empty because threre are no stops, arenas, or pokemon inside, or that the request was too fast and the server responds with that basic dict.

I am going to implement the solution that the guys at PokemonGo-Map did: https://github.com/AHAAAAAAA/PokemonGo-Map They implemented a longer sleep if a certain threshold of failed parses (namely KeyError) is exceeded. As you can see here, starting at line 158: https://github.com/AHAAAAAAA/PokemonGo-Map/blob/master/pogom/search.py Maybe I get better results with this. Otherwise I am going to check the outcome with a single-account scan. And if everything fails I am going to try something else. ;-)

genIterator commented 8 years ago

I did some tests and so far i could not find any clue why the scans look so "empty" and somtimes they dont. I switched to util.get_cell_ids from the current api update using a radius < 100 so the cell_id array is not too large. Also, i did not convert lat and long with f2i anymore, as suggested here: https://github.com/AeonLucid/POGOProtos/issues/83#issuecomment-235614778 Timeouts do not seem to matter. I did tests with 0s, 5s, 5s+random, 30s and all of them gave sometimes a decent looking result and often a rather empty map. Scans with the same settings, but different accounts, with a scanning gap of less than 4mins gave totally diferent different results. Some pokemon were found in both scans, some only in one. Even though they should have been in all scans (judging from the despawn time) The overall results were not reliable at all.

dnsBlah commented 8 years ago

Did you do the scans on the exact same location as well?

And btw the delay does matter, well at leas lt for the forts to show up :( I do 1 call for map objects for everything

genIterator commented 8 years ago

Yes, I did several scans on the exact same location with the exact same grid. Meaning it should result in the same pokemons. I tried one map call using a large radius for the cell_ids, but this did not work at all. With a test radius of 1000 i got the same pokemon as with a radius of 100. I probably has to do with the maximum 70m radius in which the pokemon actually appear around the character. Therefore, pokemon which are futher away than that are only send back as "nearby pokemon" information, I suppose.

weissi1994 commented 8 years ago

having the same issue here, im using the catchable_pokemons array as workaround, but the wild_pokemons array is empty in every request.