farkam135 / GoIV

https://www.reddit.com/r/goiv
Other
372 stars 138 forks source link

Automatically update trainer level #326

Open nahojjjen opened 8 years ago

nahojjjen commented 8 years ago

Since the pokeball in the center of the screen when in map view is persistent & has a pretty unique pixel signature, I think it's feasible to automatically detect the trainer level in the bottom left of the screen. I intend to try and implement this feature after the refactor.

sarav commented 8 years ago

I was thinking about this myself a while ago, but this will increase power consumption a lot to OCR that region every .75 seconds. That's why I have it up. Level up doesn't happen often enough to matter. I think one request was to also add a +/- button to the notification. I think that's she best compromise. No?

nahojjjen commented 8 years ago

I wouldnt need to ocr that region every 0.75 sec, I'd just need to check if 2 pixels are a perfect match to the pokeball that's only visible on the map screen. Thats the same type of if check thats performed to check if the user is looking at a pokemon. The performance cost is negligible.

sarav commented 8 years ago

Sure, I understood that part already. But that's going to match majority of the time. And the you are going to have to check the trainer level using OCR to see if the trainer level changed. So, it's still a lot of OCR without the user triggering anything.

Am I missing something that makes sure the OCR only runs when the level up actually happens?

nahojjjen commented 8 years ago

The ocr would run once every time the the user navigates to the map view in my current imagined implementation.

Example for clarification:

User is not on map screen, no ocr is performed User enters map screen, ocr is performed User is still on map screen, no ocr is performed User leaves map screen, remember to check next time user enters map screen.

This implementation would work by having some boolean hasLeftMapView, and the ocr would only run if hasLeftMapView is true. Running the ocr would set the boolean to false, and leaving the map view would set it to true.

sarav commented 8 years ago

Ok, that's better, but this is still a lot of work (code and runtime power cost) that can be handled by a simple "+/-" button on the notification.

ZombieProtectionAgency commented 6 years ago

It may not be perfect but instead of OCR you could just take screenshots of levels 1-40 and diff them all together to come up with which pixel combinations are unique to each level then just hard code those reference points and compare against that