#Egg Automation Testing
224 messages · Page 1 of 1 (latest)
Great post! Everyone should discuss egg testing here please and thanks
Will also leave it running for next 8 hours or so, it's been running for about 1 and doing fine so far :-)
Hashtag unsupported platform
Post a screenshot of your overworld with the Y-COMM icon visible and wait for Gin. 
haha, will do as soon as I get it back.
The worst part is, I could see the inference box sitting there.
Hopefully it's not my OpenCV implementation from brew.
The Y-COMM icon detector broke on one of my cap-cards are well. So this isn't new.
:phew:
We're not using OpenCV for this. 
12 and a half hours and 4 shinies later, seems to all still be working well
I think I ended up with a handful of extra eggs (5) the next box over, but it didn't crash or anything

Always happy to recompile if you need me to test anything.
I pushed the fix. Your Y-Comm icon is slightly higher than the pixel area ratio threshold 
git pull and recompile?
ka chonk ka chonk
Ooo and it has the json fix in there, too
Yes
cool, I'll give that a shot the next time I can get the Switch
Disney Dreamlight Valley is my competitor now.
there we go, hatching
It'll be interesting to see if the set of "grab an egg every 2 laps" is good enough or not for yamper
I see why the Y-Comm is so important, since it has to fly all the time
Ohhh, all those inference boxes on the menu screen are to figure out where the cursor is. Lovely.
I want to eliminate those extra eggs. But I don’t know how to do this. Do u have any idea? Like if there is an error causing game reset?
ive been running it for about 24 hours already couple of crashes at the start but working flawlessly since then already got 5 more shinys for my shiny living dex
time to go shopping .... 
What is a crash you mean? I don’t think the game or the program crashed and you had to restart them
I definitely love how well it tolerates the nursery lady not having an egg. Yamper hatches so fast that it doesn't make sense to fetch every 2 loops, but she doesn't always have an egg after only one loop.
I haven't ended up with more since, so this is probably a false alarm caused by user error. 
don't know what happened they were just gone from taskbar after a while and had to restart didn't come up again since
Is there anything in the ErrorDumps/ folder?
this is what showed up
thx
Looks like your computer ran out of memory. What's the specs of your computer?
The second crash is on a null pointer in the video stack. Another possible symptom of running out of memory.
hmm 
i do know i need more ram but i need a job to pay for it
Is your CPU by any chance pegged at or near 100% CPU while the program is running?
If the program is CPU starved, it can also run out of memory.
20-30 currently
hmm
i was playing a game but it never caused an issue in the past
Anyway, keep an eye on the memory usage. If it ever goes above like 500MB something is wrong.
Oh you were playing a game?
yeah
and im runing 2 instances
never caused me issues in the past even with more ram hungry games
The other possibility is that the game is starving the program of CPU. If the program's video processing gets starved and cannot keep up with the capture card, all those frames will start clogging up memory until it either gets enough CPU to catch up, or it runs out of memory and crashes.
maybe but i don't think that's it probably just ram as the cpu rarely goes over 70 with the lighter games
What is your current total RAM?
That should be plenty even when running most games alongside automation, assuming you don't have other background stuff going on
plex server is the only other major thing i have going and ocasonal recording during a zoom class but i never had issues in the past and ive been doing it for over 8 months now
hoping i can move plex to a separate linux server in the future and hopefuly i can run the programs there too
Commence overnight testing, looking for shiny yampers and yampers with perfect IVs
Well, only 130 eggs to get a shiny yamper and test shiny detection. That wasn't long.
Everything seems to be going fine with the egg automation. Been running it for amost 30 hours in the last 2 days and have gotten 6 shinies. Now there has been a few times were it has had to recover its self because it couldnt see thr rotom phone for some reason but it was able to recover from that everytime
Can you send the logs related to those errors?
Is it alright if i just send the whole file?
And is it the serialprograms.log file ?
Therez another one tht also say cannot detect flying taxi animation
Later tonight, ima start the home box sorter or the cramamatic. I want to spend about 2 days on each to test everything that way it can have things done and ready for SV stuff
I restarted the program just before i left my house and gottennthe same error twice in 25 mins
Thanks for testing! I will fix it later 
Update: Haven't gotten any other extra eggs, so I'm fairly sure I was mistaken and those were the result of me running it wrong the first time (i.e. without an already-full party of eggs)
I have been running it since last night, three shinies and no crashes. It was rough to get started because I have an elgato and I had to adjust the colors a lot for it to see the Y-Comm, but once it was dialed in it was off to the races. I do notice there's a discrepancy of a few eggs between "Fetch Success" and "Eggs Hatched" - I have 838 hatched, and as it gets to "Found egg 5/5" I am at 835 "Fetch Success". So somehow it's hatched 3 more than it's found lol. Coincidentially that's the same number of shinies found.
Overall really stable and something I absolutely LOVE and appreciate having 🙂 Thanks mucho!
first success
no issues so far for me, using the build that was updated this morning
Can you post some screenshots from before you "fixed" the colors? Ideally we want our detector to work on most of them anyway.
I can share that this was the tweak I made to the "Game Capture HD60 S" source properties in OBS:
Which honestly makes the colors look dumb... But it works
At minimum we want things to work on all default settings. And have room for some of the more common distortions.
And default fails on the latest beta?
considering you released an update 40 minutes after I upgraded last night I'm not on the latest lol
I'll hit go on it and see if it fails now... If it does I will update to the one from last night
yep..
@split scroll want me to take a look at this later this week? 
Sure please halp 
Please use the newest one
hey, it's working on last night's beta
it's GORGEOUS. STUNNING.
Pinnacle of human achievement. All of my thanks 🙂
Oh it does work on the latest? I thought that error message was already on the latest. 
nah that was confirming it was still broke on default video settings on the previous beta. My bad
To be clear, it is currently running perfectly on default elgato settings on last night's release
I tuned the threshold for Rotom phone menu selection arrow detector. It should pass now.
The new code is on Github
Thanks ill test it out
oh my god I love this so much more than bdsp egg auto. why the hell is that game so slow lmao
I did have one error/crash today, but it recovered and then promptly found a shiny a few cycles later. 😄
is there a log I can look at to see what happened?
There is SerialPrograms.log.
You can find the part where it has the error and upload here. Warning: it will be a very long log
i've hatched >2000 eggs with no hiccups so far (v0.18.9)
I'm about 4k in with the same lack of issues :-)
The first 5 shinies I hatched I only had 2 errors or so, with 1075 eggs hatched. I've recently started breeding for shiny Clobbopus, and there seems to be more frequent errors, with 6 errors and 279 eggs hatched. Could it be due to Clobbopus having a higher step count to hatch -6425 - 6681 steps- compared to the previous pokes which were only 5140 - 5396 steps?
Specifically, it's the Rotom phone error
On my computer the inference happens really fast. The only time I saw rotom error was when I was using too much CPU for other things and PA started to lag 🤷
I've only experienced errors after switching to 1 bike loop per fetch, if that means anything. didn't have any errors before changing from 2 loops to 1. here's the lines from the log on this one (maybe my 4th or 5th error in a few days, but all recovered perfectly)
2022-10-27 22:37:50.558644 - [Console 0]: Sending: pbf_press_button() - seqnum = 23640, button = 2( BUTTON_B ), hold_ticks = 10, release_ticks = 240
2022-10-27 22:37:50.718613 - [Console 0]: Sending: pbf_press_button() - seqnum = 23641, button = 2( BUTTON_B ), hold_ticks = 10, release_ticks = 240
2022-10-27 22:37:55.597349 - [Program]: Fly to reset position
2022-10-27 22:37:55.608564 - [Console 0]: ConvertFrame: Count = 5, Mean = 9.098ms, Stddev = 1.19416ms, Min = 7.921ms, Max = 11.078ms
2022-10-27 22:37:55.612187 - [Console 0]: OperationFailedException: Cannot detect Rotom phone menu.
2022-10-27 22:37:55.624674 - [Console 0]: Saving failed inference image to: ErrorDumps/20221027-223755624657-EggAutonomous.png
2022-10-27 22:37:55.828712 - [Program]: EventNotification(Program Error (Recoverable)): Sending notification.
I think Gin made some fixes. Will be a new build hopefully in a day or so. Just need to validate some changes I made to the way config options work.
Nearly 6k in, no issues yet. That said, all the mons I've been trying with have been 5140 - 5396 steps, I can investigate later with higher step counts
I'll read the code in a few to check what happened ^^
hmmm okay, well a lot of files from command line tests had the wrong name, I fixed that locally
but is it dead code ?
hi, just started testing egg autonomous on sw/sh,
let me know if you need extra hands for testing something specific
that's the two waterfilled object it sees in this image 🤔
tests are failing but that should make it easier to repro 😄
Can u enabled the save debug video option on the program? It saves a Video into Switch when error
I changed file name parsing from using - to separate words to using _
This breaks older test filenames but I’m lazy to fix
The reason for this change is to allow negative numbers and pokemon name slugs uses in filenames
Got the rotom phone error again on last night's build.
I haven't encountered any errors as of yet myself with the latest build, but I'm currently only hunting eggs with less than 5k steps required
no repro since 😄
but the pics I added in this PR https://github.com/PokemonAutomation/CommandLineTests/pull/2 still fails the tests
or maybe it was the wrong screen ?
(I'm stupid, I forgot to deposit a pokemon in the daycare
)
I've seen no major issues regarding the autonomous eggs other than an authentication of the digital game on a secondary system which is no fault of the program happy to say i have added gen 8 shiny living dex to my collection in the last 2 weeks thanks to this software
only 8? you need to automate more!!!
oh i have 1 2 3 and 4 already
working on 6 as its the smallest hoping to be done before scarlet violet (at least what is available)
For me on linux it's unable to detect stats, then it says unable to detect pokemon menu in storage box, tries to restart and then it's failing to detect Home screen and stops, I will try on Windows 11 now
On windows everything is detected nicely so far
Can you post this image? ErrorDumps/20221107-203047064455-NoPokemonMenuInStorage.png
Not being able to read stats probably means Tesseract isn't working. Or you didn't select the language?
Oh it's trying to release the mon, but maybe it dropped a press and thus the arrow that appears when you press A doesn't show up.
Yep I selected language now it's detecting the stats but crashes the same way and fails to detect the home screen
Can you post a screenshot of your Switch home?
Indeed it fails the detector. Seems like your background it quite a bit brighter than most.
I'll push a fix in a sec. But this makes me wonder about the other related detectors.
Are you able to bring up the Switch or game update window? Or are you already fully updated on everything?
I just updated yesterday :/
damn 
Fix pushed for the Home detector. Will need to look further at why it's breaking in the box.
Ok it will need some time to build again I will let you know if it's fixed
For the box issues, we might need a video with the log visible.
I can do that in a bit
@split scroll can you see what's wrong? Is it dropping one of these button presses? https://github.com/PokemonAutomation/Arduino-Source/blob/main/SerialPrograms/Source/PokemonSwSh/Programs/EggPrograms/PokemonSwSh_EggAutonomous.cpp#L706
What if you replace:
pbf_press_button(context, BUTTON_A, 20, 200);
with
mash_A(context, 220)?
mash_A() is in PokemonSwSh_Commands_Misc.h
Took a look at the video. The problem is that somehow the button press to clear the last black dialog box after releasing one pokemon is not pressed. So the black dialog box is still there when the program thinks it is OK to press A to show the pokemon menu
mash_A() cannot be used here because it will open the pokemon menu of the next pokemon
We can have a video detection on the black dialog box, and as long as this box is there, we press A to clear it
Oh wait, we already have that black dialog box visual detection...
Try pulling latest. Gin made a fix last night. 
Yep it didn't stop where it usually does now I can leave it overnight for a bigger test 🙂 thank you so much guys
did it drop another button press here?
What did u mean?
some times it restarts with error NoRotomPhoneMenu at the above image, I wonder if it similarly fails to press A and go to the egg hatch screen
happened 4 times in ~130 eggs
Interesting, can you give a recording of this (including the log)?
The code detects egg hatching by:
- checking if Y-comm icon in the lower left corner of the screen disappears.
- If yes, an egg is about to hatch, keep pressing A until the Y-comm icon appears again
So it should not miss button A to go though egg hatching dialogs
One possible explanation is that it counts an additional "fake"/phantom hatching event. So when the program thinks it hatches all five, it actually only hatches four, and therefore it tries to open Rotom Phone menu when the last egg is about to hatch, in this screenshot
I can try to get a video, it's a bit more difficult as it doesn't happen all the time and the video gets to big
my assumption from looking at it is that is trying to fly back to the nursery but the eggs are still hatching, as I saw those yellow squares that show up when it gets into the menu, so the phantom hatching event sounds very possible to me
even with the errors it worked overnight and I got the shiny
didn't have any errors on a few hours run with a new pokemon, maybe the hatch time matters?
I noticed one of my cpu cores going 100% CPU usage when using Egg Automation and I can't do much more with my computer while using it
is anyone else having similar issue? I still can't figure out if the program got too heavy for my pc or if there is anything wrong on my pc or the code
i5 8600K with 16gb ram and 2060rtx
How much is the program itself using?
I will go home in about an hour and let u know
That doesn't sound right.
I am using 85% of memory with only Serialprograms running
What if you stop the program and set the camera to (none)? Does the memory usage go back down?
Or even better, switch to a settings tab so you don't have any program that has an active video.
I made some tries yesterday without very consistent results but when I switch to settings or another program the cpu usage drops significantly
also switching back to Autonomous eggs without camera and not started, went to 100% usage again
but let me hatch this batch and try again
So the program is using 100% CPU with no active video?
let me confirm that again
I was too sleepy to trust me
there is a bug on linux where it crashes when i change the camera 🤙🏼 let me find a workaround
You sure it's a bug in Linux and not in our code? Where does it crash?
Granted, our stuff works on Windows and Mac, but that doesn't exclude a program bug.
I mean in the code but it only happens on linux
hmm, putting the camera to none doesn't change anything but putting the serial port to none drops the usage to almost 0
So serial is spinning? Can you do a gdb break and bt?
Curious to see where it's spinning.
Both Mac and Linux use the same POSIX serial stack. But I don't think @split scroll has observed any 100% CPU from the serial?
I should build it in debug mode to use gdb right?
Debug mode isn't necessary, but you do need symbols.
I had similar issue on win 11, I will make more tests and come back to you
(No debugging symbols found in ./SerialPrograms) what do I have to do to have symbols?
Probably need to add a flag -g? to the compile options? /cc @weak trench
Make sure it actually does what we want before blindly adding flags. 
built it with BUILD_TYPE:STRING=Debug, I had symbols but I couldn't start the program
segmentation fault (core dumped)
a bit out of my comfort zone with gdb sorry 🙂

it sure add -g to the build and that's what we want 
debugging with visual studio is easier 😄
Out of town. Cannot test 
I got into gdb by using this argument instead -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo but now I am like