Closed SoaringEagle93 closed 3 weeks ago
Can you provide me more information about this issue?
Thanks
Thank you for the answer, it really helped me understand what is happening!
I didn't know this message even existed. I found this on the official Nintendo webpage: https://en-americas-support.nintendo.com/app/answers/detail/a_id/47555/~/%E2%80%9Cchecking-if-the-software-can-be-played%E2%80%A6%E2%80%9D-message-when-starting-software
Regarding the autorestart issue, the program automatically restarts the game when it gets stuck in some states for more than STUCK_TIMER_SECONDS
, which is set to 30s by default. It sometimes happens that a button is not correctly received by the console and the program would get stuck in the same state forever. It is a correction measure.
May I ask you some questions:
This is the worst option (not recommended as you will lose a lot of time every reset), but you can increase the STUCK_TIMER_SECONDS
in the Constants.py
file to 45 or above if necessary and the game will not restart. As said, I highly recommend finding another solution if can you help me solve this issue.
So this is not my primary Switch as I purchase games digitally so that my fiance can play them on her Switch which is set as my primary. I am unable to set the switch to airplane mode when on the dock.
I did however change the Stuck_Timer_Seconds to 45 and that didn't resolve the issue. I then changed it to 60 and it launches the game now sometimes and gets into combat. It will stay on ENTER_COMBAT_2 for quite awhile before restarting the game again. ( I assume this is where the 60 seconds is coming into place.)
Also even with that timer change, the Game will still not launch sometimes. It seems when it is trying to launch the "controller" is spamming "A" which hits cancel on the checking message.
Not sure if it is related but the Encounter Count is staying at 0.
In order to solve the "Checking if the the software can be played..." issue:
a. Update the program to the latest version of the program. You can either clone the repository again git clone https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter.git
or update the current one git pull origin master
in your local repository folder.
b. Now, you have two options:
Macros.py
script inside the Modules/
folder and change the restart_game_macro()
function as follows:
This will make the macro wait some time between button presses. The error should be solved; if not, try to increase the sleep time to 2 or even more if necessary.Can you please upload a video of the ENTER_COMBAT_2
issue so I can check it? The encounter count is 0 because it increases in the following states your execution doesn't arrive at.
Ok I updated the program and made the 2 changes you listed in the Macros.py. The game seems to launch everytime now, however I am unable to get to load into a save.
It also waits much longer on the WAIT_PAIRING_SCREEN before moving on now.
Here is a video of the full process. https://www.youtube.com/watch?v=SanPFHMD5RA
I did some more testing and I changed for_in range(4): back to for_in range(10): and now I can get the save to load. Now I am back to the Enter_Combat_2. See the video below:
Thank you for the videos; I really appreciate them! Now, I understand the problem. It seems your capture card is capturing slightly different colors from mine. For you to understand how the program works: Do you see the little purple line that moves around the bottom-left part of the screen? The program is checking the color of these pixels and comparing them with some values. Let's break this into two parts:
In the https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter/issues/11#issuecomment-2299913054 video, your state is not going from RESTART_GAME_1
to RESTART_GAME_2
because it is not detecting the black color of the screen. In my case, values are (B, G, R) = (7, 7, 7).
In the https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter/issues/11#issuecomment-2299928628 video, your state does not go from ENTER_COMBAT_2
to ENTER_COMBAT_3
because the program is not detecting the white colors of the text box. In my case, these values are (B, G, R) = (255, 255, 255).
I will need some help from you to solve this issue, since I'm not able to replicate it. I'd really appreciate it if you did the following steps so I could push a new version that works regardless of the capture card that is being used:
Modules/
folder and run python3 Game_Capture.py
. Select the option 2 "Check current capture device". Now you should be able to see the Nintendo Switch screen and control it using your joycons.Media/Tests/
folder. Can you please tell me the color of the pixels that correspond to the black loading screen and white text box? If you don't know how to do it, you can send both images to me, or you can follow these steps:
Constants.py
script and change the TESTING_IMAGE_PATH
for one of the two images' path. It should look something like 'Media/Tests/xxxxx.png'.Modules/
folder and run python3 Image_Processing.py
. Select the option 1 "Process image". The image should plot.Really appreciate the effort, thank you!
Here are the two screenshots, black screen is R:0 G:0 B:0 and white text box is R:255 G:255 B:255
I uploaded a new version of the program, it now checks a range of values for each pixel instead of an exact value. Can you both @SoaringEagle93 and @Xion3582 confirm whether the issue is solved or not?
In order to download the latest version, you can either clone the repository again git clone https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter.git
or update the current one git pull origin master
in your local repository folder.
Ok so after taking the screenshots and doing the image processing, the black screen is showing as R:0 G:0 B:0. The white part when the pokemon appears is showing as R:250 G:250 B:250.
Here are both screenshots.
https://github.com/user-attachments/assets/5f1f17eb-ef8e-4cf0-a6b6-4118ecf83c00
I am experiencing the same infinite loop of resets even with the new version of the program (as of about an hour ago). It also took over 90 seconds to change from the pairing state to the restart game state.
I uploaded a new version of the program, it now checks a range of values for each pixel instead of an exact value. Can you both @SoaringEagle93 and @Xion3582 confirm whether the issue is solved or not?
In order to download the latest version, you can either clone the repository again
git clone https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter.git
or update the current onegit pull origin master
in your local repository folder.
I tested the new version and was no longer getting stuck booting the game or getting stuck on ENTER_COMBAT_2. However now there is a weird stutter when the pokemon appears and it is causing the program to see it as a shiny. I will get a video of it happening after work. I ran out of time on my lunch when getting you the color values.
I am experiencing the same infinite loop of resets even with the new version of the program (as of about an hour ago). It also took over 90 seconds to change from the pairing state to the restart game state.
I see... The error you are encountering is the same as for the other users. Please make sure you have updated the program to the latest version. In order to download the latest version, you can either clone the repository again git clone https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter.git
or update the current one git pull origin master
in your local repository folder.
I tested the new version and was no longer getting stuck booting the game or getting stuck on ENTER_COMBAT_2. However now there is a weird stutter when the pokemon appears and it is causing the program to see it as a shiny. I will get a video of it happening after work. I ran out of time on my lunch when getting you the color values.
We are making some improvements, we are almost there. The stutter you say happens because when the pokémon appears, exactly at the frame the following image shows, it performs text detection to recognize what pokémon has appeared (in this case, "Regirock"). If the resources of the VM are low it can produce a small lag. The program detects if the pokémon is shiny by calculating the stars' animation time. That spark could cause it to be higher than it should be.
The solution I propose to you is to slightly increase the SHINY_DETECTION_TIME
in the Constants.py
file from 2 (seconds) to 3 or maybe a little bit more. Just don't exceed the animation time, which is about 6 seconds.
Ok I got home from work and tried it again. Everything worked for about 3 resets before the stutter. I am going to up the SHINY_DETECTION_TIME per you recommendation. However do you think increasing the Memory or CPU allocated to the VM would help with the stutter? I already have it set to 4gb of memory and 4 CPU cores.
Changing the SHINY_DETECTION_TIME still results in false shiny detection when it stutters even with 4,5,or 6 seconds. Something else I have noticed is that when I check the Database it doesn't show Regirock, instead it shows the following:
Ok I got home from work and tried it again. Everything worked for about 3 resets before the stutter. I am going to up the SHINY_DETECTION_TIME per you recommendation. However do you think increasing the Memory or CPU allocated to the VM would help with the stutter? I already have it set to 4gb of memory and 4 CPU cores.
Regarding the resources allocated, they should be sufficient. The program only uses about 200 MB of RAM; you can try allocating more, but I don't think it will change anything. On the other hand, I have the same CPU allocated to my VM:
Changing the SHINY_DETECTION_TIME still results in false shiny detection when it stutters even with 4,5,or 6 seconds. Something else I have noticed is that when I check the Database it doesn't show Regirock, instead it shows the following: !
If you are increasing the SHINY_DETECTION_TIME
and the issue still happens, it's because, for some reason, during the spike it's detecting a white background and, thus, wrongly detecting a shiny. Please send me the video if you can.
Finally, regarding the Database, it does not affect the program at all, just saves the wrong pokémon in the database. This happens because there are different texts for different encounters, and I set the program to take the last word of the sentence (in the image's case, "Buizel"). So the sentence I was working with was "You encountered a wild Regirock!", but for legendary pokémons it is "Regirock has appeared!". I didn't think about it; thank you for reporting that, I'll change it in the next update.
I did verify that increasing the RAM to 8gb and the CPU to 8 cores still didn't fix the stutter so I set that back to 4gb and 4 cores. Here is a video of the lag/stutter. In the video it even works the first time but occurs on the second encounter. It seems to be the whole program locking up as even the time stops advancing until it unlocks.
As for the database issue, I will disregard since you will have to push a new update to fix that.
Thank you for the video. I think the name recognition is causing the issue for some reason. Let's confirm that. In the Shiny_Hunter.py
script, could you please comment on the line where the name is being recognized and just set the name "manually", as in the following image (Don't forget to save the file using Ctrl+S):
Does the issue disappear if you run the program after this change?
On the other hand, I have seen it takes a whole 2 minutes on the pairing screen after the controller is connected. This should not happen; the program should start a few seconds after the controller connects. I will work on a solution.
I did some testing and it seems that when I set pokemon_name to Regirock it fixes the stutter/lag. I was able to do 10 back to back encounters with no issue. I then set the code back and it failed on the second encounter. I went back and forth with that 3 different times with the same results. I think you are correct in saying the recognition is causing the issue.
In regards to the 2 minutes on the pairing screen. It started doing that when you had me update back 2 days ago
I did some testing and it seems that when I set pokemon_name to Regirock it fixes the stutter/lag. I was able to do 10 back to back encounters with no issue. I then set the code back and it failed on the second encounter. I went back and forth with that 3 different times with the same results. I think you are correct in saying the recognition is causing the issue.
Thank you! It may be that the function is using so many resources, but for some reason, my computer does not make even a small stutter. I run the program on a minicomputer with superlimited resources, and it does not happen even there. I'll have to investigate a bit.
In regards to the 2 minutes on the pairing screen. It started doing that when you had me update back 2 days ago
So in the previous versions you downloaded, it was exiting the pairing menu right after connecting the controller?
I mentioned back in this comment that the pairing menu was staying up for a long time. This was the first time I noticed it.
https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter/issues/11#issuecomment-2299913054
Is there a reason I should pull my capture card into the VM via webcam and not USB? I tried doing it that route and surprisingly enough it seemed to run without the stutter for a few encounters. I am going to let it run for a while and see what it does. Before I tried that I was up to 75 encounters and no stutter with the manual entry of the pokemon name.
I mentioned back in this comment that the pairing menu was staying up for a long time. This was the first time I noticed it. #11 (comment)
Thank you for clarifying, it seems it is not correctly detecting the pairing menu gray color (see image). I will need some help from you, as I'm not able to replicate the issue on my computer.
Can you please try going to the Image_Processing.py
script (inside the Modules/
folder) and adding the following line in the check_pixel_color()
function: print(self.original_image[pixel[0]][pixel[1]], color, differences)
. It should look like this:
It should spam a message on the terminal. Please, before executing the program, make sure you are already at the pairing menu. Can you please send me the output that is being spammed in the terminal?
Is there a reason I should pull my capture card into the VM via webcam and not USB? I tried doing it that route and surprisingly enough it seemed to run without the stutter for a few encounters. I am going to let it run for a while and see what it does. Before I tried that I was up to 75 encounters and no stutter with the manual entry of the pokemon name.
There's no reason at all; I just solved the lower FPS issue that happened when it was connected as a USB device instead of a webcam, and it is easier and more convenient since you don't have to manually add the capture card every time you start the VM. I don't think it will affect the performance of the text detection, but anyways, it'd be nice if you could confirm that. Thank you.
Here is what spams in the terminal when I run the Shiny_Hunter.py with that code inserted.
Over the last 5 hours I have let it run with my capture card set as USB instead of webcam and had zero issues. That is even with letting the program determine the pokemon. (Once you fix the detection it will hopefully even see the correct pokemon.)
So it seems running as USB seems to be the fix for my case with the stutter. Its not an issue to me to have to select it each time, because I had to select it even as a webcam each time.
That is even with letting the program determine the pokemon.
So can you confirm the stutter issue was solved by connecting the capture card as a USB device?
So it seems running as USB seems to be the fix for my case with the stutter. Its not an issue to me to have to select it each time, because I had to select it even as a webcam each time.
No, with the USB device system, you do not have to select it every time. Just repeat the same process as you did with the Bluetooth card.
Here is what spams in the terminal when I run the Shiny_Hunter.py with that code inserted.
Thank you for the image! It seems the problem is related to color detection again. For your information, the program has a default color to detect, which is slightly different depending on the capture card that is being used. To solve that issue, I added a range of ±5 points for every color, but as you can see, one value is getting a difference of 8 points. I tuned the color for the black load screen color and the white text box, but not this one.
I have pushed a new version of the program, please download the latest version. You can either clone the repository again git clone https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter.git
or update the current one git pull origin master
in your local repository folder. Can you confirm if the issue has been solved?
Yes connecting my capture card via the USB device and not webcam fixed the stutter issue completely. Not sure why one is fine and the other isn't, however I ran it all night with zero issues. If it works then that doesn't bother me any.
The lastest version of the program has fixed where it was getting stuck on the WAIT_PAIRING_SCREEN. However now it seems to get stuck when launching the game the first time. It still shows WAIT_PAIRING_SCREEN even though it is launching the game, then switches to ENTER_STATIC_COMBAT_3. It does get past it eventually but it takes a little bit. Its fine after that first launch. I included a video to show it.
The lastest version of the program has fixed where it was getting stuck on the WAIT_PAIRING_SCREEN. However now it seems to get stuck when launching the game the first time. It still shows WAIT_PAIRING_SCREEN even though it is launching the game, then switches to ENTER_STATIC_COMBAT_3.
The same color detection issue is happening with the home screen. Could you please repeat this and provide me the otuput values that prints when you are on the home screen and in WAIT_PAIRING_SCREEN
state?
It does get past it eventually but it takes a little bit. Its fine after that first launch. I included a video to show it.
Regarding this, the game should be opened before executing the program. You have to load the game, wait in front of the pokémon and then go to the pairing screen without turning off the game. That's why it gets stuck.
Again, thank you so much! You are helping me a lot in solving this issue; I didn't even know this could happen.
Here is the output while on the home screen while in the WAIT_PAIRING_SCREEN state.
I have pushed a new version of the program, please download the latest version. You can either clone the repository again git clone https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter.git
or update the current one git pull origin master
in your local repository folder. Can you confirm if the issue has been solved?
Ok I downloaded the latest version and it seems to resolved. Once the controller pairs it starts right up with the first encounter and continues from there. Really appreciate how fast you have been able to fix these color issues for me! Any update on getting the pokemon name to appear correct since Regirock's name shows up at the beginning of the text box and not the end?
Thank you! I try to do my best! Enjoy your shiny hunting now (while you spend your free time on more important things)!
Regarding the name issue, let's continue on this thread https://github.com/Dinones/Nintendo-Switch-Pokemon-Shiny-Hunter/issues/20. Could you please resend what's exactly the issue?
Before my game will launch I get the following message "Checking if the the software can be played.." Sometimes it will get past this screen and sometimes it doesn't. Even when it does get past this and launches the game, it still restarts the game before it can even load the save.