-
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
Add Gym and Pokéstop scanning from DB and requested file dumps #1957
Conversation
Hi Arengo, Looks like a very interresting feature. Anyway, I'm a bit surprise this wan run with only -np set. I thought you can scan with a 450m range only if running -np -nk ? Could you also give more details on how this would work ? Will this PR do some kind of initial scanning to discover gyms in the same way -speed is doing it and then automatically switch to skip-empty ? What if gyms have been scanned already ? How will workers be assigned to different hives ? In other word, will this work with a very big -st as workers will automatically calculate ideal path the closest gyms ? I fear as distances can be quite big in gym-only scanning my workers might start travelling 100km to get to a gym on the other side of the map. Thanks |
@bbdoc |
ok so my workers will simply teleport between the different hives that contain a gym ? How do you define the time between the scans for each gym ? Is there some sort of formula to know how many workers you need based on the number of hives that contain some gyms ? Btw, will status screen report on the number of gyms found and number of hives that need to get scanned ? |
It's fully configuration dependant. You simply decide with |
Works like a charm thanks so much! |
pogom/models.py
Outdated
if geopy.distance.distance( | ||
center, | ||
((pokestop['lat'], pokestop['lng'])).meters <= | ||
step_distance): |
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.
you messed up the brackets in this one.
should be:
if geopy.distance.distance(
center, (pokestop['lat'], pokestop['lng'])).meters <= step_distance:
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.
Oh, you're right. Thank you, will fix it! Flake8 persuaded me to write shitty code :-P
It seems that this PR updates the db to a newer schema version. Beware of that while checking this out. For the rest, this PR is quite gamechanging while scanning gyms. It has issues, e.g. with massive step distances (like st 50 or 100) it takes forever to fire up the threads (if it ever starts), and I still get some "empty" scan. This thing asks for a step up, something like clustering the dumped points and feeding them in a -ss like fashion. A massive improvements from a regular hex nonetheless! |
@leccarelepalle When it comes to huge |
@aRengo about empty scans, I'll tell you more once I did more testing, I already have a reasonable -sd though . I've yet to fire up a st100, because the hex schedulers gets stuck for ages. I think the problem is in the skip-empty algorithm which needs to calculate which cells are empty. I agree that clustering is totally optional, but a better approach for wide areas would be the aforementioned "-ss like" approach in which only non-empty points are used (and directly fed by the DB/Json). This way the whole "which cells are empty" calculations are avoided (worth mentioning that some of those routines are also pretty broken and unreliable for distances like a st100 gym scanner) and you may actually go big with gym scans. Using this approach the scanning points clustering (just spatial clustering) may be really nice to avoid to scan many times the same area if they are full of forts. Would also be a pretty trivial modification of the already existing tool. |
@leccarelepalle from a computational point of view, I totally agree. It will be much resource lighter in the start up. In this case, clustering makes sense instead multiply scan one area with multiple forts. Thanks for your feedback! Let me hear about your findings regarding the empty scans. |
I have been using this for 2 days+ now, working fine and no bug or exceptions detected for now. |
@aRengo empty scans seems quite sporadic, and we don't have any on smaller step sizes. Using st < 20 is quite fast to fire up (seems faster pulling directly from DB instead of Json), even when dinamically changing location. I can use up to st 40ish with a reasonable startup time, anything above seems to get stuck forever...Can anything be done about it? I would love to scale up to st 100 hexes |
Am I the only one who cannot get this to work ? I'm getting |
@bbdoc I guess beehives probably produces the error. While this should be addressed by me to support all viable scanning methods, it is not recommended to use beehives when you can cover the same area without |
The problem is, @aRengo , I can't really exceed st 40ish or the threads never start, so I too could make some use of the -bh flag |
Close/Open to restart Travis. |
Any chance to get an update working with -bh ? ;-) |
I'm giving this PR a try without -bh at the moment ;-) Anyway, getting a lot of those error messages :
No big deal as probably linked to some accounts being banned, but should not throw this error... |
As I researched on those errors, it seems that this is a problem with old / left-over code that should not be there anymore. I removed those parts (line 1962-1978) and it is working fine without errors. |
@michikrug So you removed lines that were added by this PR on models.py ? Would prefer to let @aRengo check this will not result in any side effect. [EDIT] Removed those lines, but now getting another error : |
@bbdoc since I have merged a lot of PRs I can not really tell, what is also changed in my code in comparison to this current PR |
I didn't merge any other PR. Fresh clone of dev + merged only this PR + deleted those lines from models.py. I'll wait for @aRengo to remove those lines and push another commit if he confirms they are not needed and will try again. |
I have the same problem as bbdoc after getting a more recent version of this, with the original it worked flawlessly, didn't change anything else. |
Actually, I just "solved" it for me by inserting |
Will probably rebase that soon and change a lot. Let's use the deprecated |
@aRengo - Any chance of this PR coming back? I need this for my gym only scanner. |
@rpotpogo I have it still maintained in my new-api and raids branch. But I have to say, there is also a lot of customized code and content included. |
Yes, chance for a re-write with -ss for raids and --skip-empty for forts is there. |
I know this is closed but I need to say THANK YOU for this, I adapted it to work with my map and I have the ability to lure stops on my map, so now i have a dedicated lure placement scanner .....my community thanks you :) |
@SkOODaT How did you manage that? |
Implemented the ability to dump data of gyms and Pokéstops directly to a json file. Additionally a scan mechanic was introduced to scan forts (i. e. gyms and Pokéstops) based on the
skip-empty
scan method since a real spawnpoint scanning is not relevant when there is no timer. Gym scanner are now better to track by vision, adding a old and never merged PR feature which increases scanned location radius on map.Description
The implementation was done with respect to the existing features of dumping spawnpoints as well as the skip empty cell scans. This resulted in the introduction of a new scan flag
--fort-scan
(-fs
) for so called "gym scanners". Hereby, valid gyms and Pokéstops inside the step-limit are pulled from the DB and stored inside a file if--dump-gyms
or--dump-pokestops
is specified together with a file. If not file is added for scanning or dumping, the new scan sub-classHexSearchFort
pulls all otherwise dumped forts from the DB directly and the generated hex area is thinned out when no fort is found inside each cell.All these features are best used with the
--no-pokemon
(-np
) flag to increase the cell size from standard Pokémon size of70 m
to a respectable gym scan size of450 m
.To make the bigger cells when using
-np
finally visible I implemented PR #861 to todays DB structure. All credits to @wesleytsai.Motivation and Context
This feature has been requested various times since gym only scanners are often used to expand the gym map while not increasing ressource costly Pokémon scan areas. Most lately the highly voted request of DevKat and in Issue #1487, #1321 and #1154
How Has This Been Tested?
On my personal map.
Types of changes
Note: This feature can be extended with Lured Pokéstop support - finding a lure with a fort scanner locks scan-position for one worker and switches
scan-delay
to each 3 min. to retrieve the newly spawned Pokémon until the lure expires.Checklist: