prawigya / shiny-bot-pokemon

Python script that automates Shiny Hunting of Pokemon in DS/ GBA emulators
27 stars 4 forks source link

The bod isn't working correctly #3

Open noodle42069 opened 3 years ago

noodle42069 commented 3 years ago

Hey can anyone help me? the bot won't execute correctly, every time it stops after one encounter. even if it isn't shiny. also changed the reference picture to something completely different and execute the same. some help here please!

prawigya commented 3 years ago

I've addressed this problem in the README today, one of these could be the reason as to why its not working:

The script says encountered a Shiny even when it is not a shiny.

This can happen because of two reasons:

  1. In Gen 4, the male and female sprites are slightly different for some pokemon. The reference image you saved can be of one gender and when you encounter pokemon of another gender it assumes it is a shiny since the sprites are different. For example female Combees have a mark on their forehead, while males do not. One way to get around it is to minimze the size of the reference screenshot so that the part that differentiates males and females are cropped out, and thus not considered. You can also use two sprites, one of male, and one of female and modify the script to consider both the genders while checking for shiny. (The script for combee uses both gender sprites as reference images whereas the Giratina script uses only one reference image as legendaries don't have genders)

  2. You have included the background in your reference image. In Gen4 you have day, evening, and night cycles and the encounter screen background also changes accordingly. If your script is running for hours and the time changes from day to night, your encounter screen will change to night, but your reference image will still have the day backgorund. Comparing the images will cause the script to return a True for differences in the image. This results in a False Positive. A fix for this is to reduce the reference image as to not include the background. (You do not have to worry for cave encounters like Giratina as the background for cave encounters do not change.)

P.S. I've also added other instructions in the Readme, can you check if you're adjusting the code correctly?