Masuzu / GBFPokerBot

The return of the (in)famous Grandblue Fantasy poker bot
https://gbtools.azurewebsites.net/PokerBot/en/Home
10 stars 1 forks source link

Random crashing during double up #5

Closed boxednoodles closed 8 years ago

boxednoodles commented 8 years ago

During double up if I'm a few rounds in the program will hang briefly and crash immediately. It doesn't crash immediately during double up, it'll always be a few rounds in and then just dies. Not sure if it's related to the calibration issue in the other thread.

Problem signature: Problem Event Name: APPCRASH Application Name: GBFPokerBot.exe Application Version: 0.0.0.0 Application Timestamp: 57f29d1e Fault Module Name: MSVCR120.dll Fault Module Version: 12.0.21005.1 Fault Module Timestamp: 524f7ce6 Exception Code: 40000015 Exception Offset: 000a7676 OS Version: 6.1.7601.2.1.0.256.1 Locale ID: 1033 Additional Information 1: fb2a Additional Information 2: fb2a24e8ba2717ddd5a9c5132e001981 Additional Information 3: 4a36 Additional Information 4: 4a369c96b16ba9fbdfcf49cd77c56846

2016-10-03 13_34_56-granblue fantasy

Masuzu commented 8 years ago

Hello,

Did you encounter the same issue with the previous version (1.7.11)? With the previous version, the bot would have looped indefinitely in this case. The bug you are reporting means that the bot failed to identify properly the position of the 1st card on the board. I am aware that when that card is a 10 of clubs there might be some issues but it should be very rare. What were the cards on the left and right side which caused this bug please? Also, do you still have the picture PokerTableHook.png (in the same folder as the exe file)? It should look like this: https://s4.postimg.org/jnvf137ct/Poker_Table_Hook.png

Browser screen setup to avoid

Preferred browser screen setup

Using the preferred browser screen setup showcased above, we can somehow avoid such issues. I will look thoroughly into this matter in the next days.

Also it seems that your HookToXXXButton have abnormally low values (on my side I always have values >= 0.9). That observation is very likely linked to the crash since those are linked together, somehow. I wonder if it is again an issue related with scaling issues.

boxednoodles commented 8 years ago

The version I'm using is v.17.2. This is my browser screen. It should be optimal enough for the poker bot to run. I'll kill the submenu and tighten the window further and see.

2016-10-03 14_24_35-granblue fantasy

Masuzu commented 8 years ago

Indeed, it would be great if you could upload your Poker_Table_Hook.png picture please.

boxednoodles commented 8 years ago

pokertablehook

Masuzu commented 8 years ago

Ahhh!!! Got it! As you can see, the hook system occurred too soon: the right card was still loading. This issue happens with low-end computers which can't take enough screenshots per second to detect the end of the animations. A solution in this case is to play with the values in the section [MotionCapture] of the ini file.

ConsecutiveFramesWithoutMovement=30 -> might need to be **increased** for your computer
MinDelayInMsBetweenFrames=5 -> might need to be decreased for your computer

Also, you might want to increase the value of WaitTimeInMsBeforeHigherOrLowerHookInitialization=1000 to let enough time for the 2 cards to load the first time you reach the higher or lower phase (the default value is set to 1 second): -> this is not needed with most computers though, which load the 2 cards fast enough.

You want your Poker_Table_Hook.png picture to look exactly like this: https://s4.postimg.org/jnvf137ct/Poker_Table_Hook.png

boxednoodles commented 8 years ago

I see. I'll lower the values and leave the bot running for a while and wait.

Masuzu commented 8 years ago

As soon as you reach the higher or lower phase, you can press escape to stop the bot and check that your Poker_Table_Hook.png picture looks like this: https://s4.postimg.org/jnvf137ct/Poker_Table_Hook.png

As long as it is not the case you will run into those crashes.

However, after you manage to tweak your ini settings to have the expected Poker_Table_Hook.png, if you still run into crashes, please let me know.

Masuzu commented 8 years ago

Just a correction to my previous comment in case you did not notice it:

ConsecutiveFramesWithoutMovement=30 -> might need to be **increased** for your computer
boxednoodles commented 8 years ago

I'm still getting the same errors, the only difference is how late I can delay when this happens. I can get a few winning hands before the program stalls and crashes like in the first screenshot. During some value tweaking there are times where I'll get at quite a few desynchronization to one of the buttons. Sometimes it's Yes, sometimes it's Low or High button.

This is the current PokerTableHook pokertablehook

[EDIT] The errors I'm getting now seem to be related to a specific number. Black 10 Clubs and Spades will usually cause problems. There are other cards, but they're not a sure fire thing.

connectve commented 8 years ago

I've got the same issue and I tried the fixes listed here, my pokertable hook looks appropriate as well, yet the same error as the one above appears on the first double up it gets without even getting through a round. http://puu.sh/rx4wX/7eba695996.png Or this popup appears pokertablehook

Masuzu commented 8 years ago

If it can't even go through the first round and crashes, the console should display the message "Perform recalibration", is that correct? The issue related to the crash when you draw a 10 of clubs or 10 of spades should only occur when the recalibration is performed, which is not something you are expected to see often if the [Motion capture] parameters are properly configured. That would mean that you have a whole load of HookToYes button/HookToHigh button desyncs. What values do you have for those (values close to 0.75 or lower)? If the values are still above 0.7, that's fine. Just lower the default detection threshold of 0.75 to 0.7 in the ini file. This is not something you should observe often on "decent" computers, unless the parameters in the ini files are not set tweaked properly.

boxednoodles commented 8 years ago

All the errors I get all start with OpecnCV Error: Assertion failed. The one other time I got an error a pop up appeared saying "Double up chance expected to find 2 cards." during the first round of the double up.

Double up hook error

2016-10-03 18_43_16-granblue fantasy

More 10 of Spades causing problem.

2016-10-03 19_01_34-granblue fantasy

ConsecutiveFramesWithoutMovement=60 MinDelayInMsBetweenFrames=6

Masuzu commented 8 years ago

@boxednoodles @connectve It is absolutely impossible to have your error with such an easy card pattern (cards with value 2 are especially easy to detect) unless the hook on the 2 cards occurred too early. Increasing the default 1000 ms before trying to hook on the 2 cards should solve the issue.

Masuzu commented 8 years ago

@boxednoodles As for the crash during the second round as seen in your last screen shot, you can see that the card detected was a 5 of spades which is obviously wrong. The reason why this happens is that the bot failed to detect the end of the animation (that is to say the moment when the card is card is fully visible on the board) and triggered the card identification too early, therefore detecting a wrong card value instead. On good CPUs this never happens as they are fast enough to detect accurately the end of animations. On the YouTube channel there is still a video showcasing the effect of multiple parameters on the animation detection. However, I can see that the recalibration kicked in right away, which is a bug indeed. I will fix this tomorrow. As a side note, I use an Intel I7 4970K which is overkill to run the bot and also tried to run it on a less powerful computer with an Intel I7-5500U without encoutering the issues described in this ticket.

Masuzu commented 8 years ago

The version 1.7.4 fixed this annoying bug introduced by the version 1.7.2. I apologise for the inconvenience.

Masuzu commented 8 years ago

Hello @boxednoodles and @connectve ,

I am sorry if the advice regarding the update of the GBFPokerBot.ini parameters felt a bit fuzzy. At last, here is a short self-explanatory video guide showing what I meant and how to get the bot to work smoothly on less powerful computers! https://youtu.be/vtW7fTDJANk

Best regards