Closed jason00-r closed 2 years ago
bot will do nothing and the game will end due to 0 hearts left
What OS are you running on? Do you have any custom keybinds?
I can't seem to reproduce the issue
What OS are you running on? Do you have any custom keybinds?
I can't seem to reproduce the issue
Running Windows 11. All hotkeys in-game are the defaults. No custom keybinds outside of the game either.
In the game, my screen size is set to 2560x1440 in the settings. I tried in both full screen and windowed mode. Both just start and do not place any towers.
Could you try with the latest release and see if anything happens now?
Could you try with the latest release and see if anything happens now?
That did not fix the issue.
I did notice that the cursor moved to the left of the map quickly and I circled the area roughly with a white circle in the screenshot below.
In that screenshot I have the cursor set to X-Large, but I also have tried with the normal size. It did not help.
Could you check what python version you have with py --version
in your CMD or terminal? Also do a pip freeze
and send the output here
Could you check what python version you have with
py --version
in your CMD or terminal? Also do apip freeze
and send the output here
C:\Users\Jason>py --version Python 3.10.5
C:\Users\Jason>pip freeze Fatal error in launcher: Unable to create process using '"c:\program files\python39\python.exe" "C:\Program Files\Python39\Scripts\pip.exe" freeze': The system cannot find the file specified.
C:\Users\Jason>python -m pip freeze keyboard==0.13.5 mouse==0.7.1 MouseInfo==0.1.3 numpy==1.22.3 opencv-python==4.5.5.64 packaging==21.3 Pillow==9.1.1 PyAutoGUI==0.9.53 PyGetWindow==0.0.9 PyMsgBox==1.0.9 pyparsing==3.0.9 pyperclip==1.8.2 PyRect==0.2.0 PyScreeze==0.1.28 pytesseract==0.3.9 pytweening==1.0.4
i also encounter this issue, the game starts and it places no towers. i can provide the same statistics also on w11.
✖-1073741510 ✗ py -3.10 --version
Python 3.10.5
➜ py -3.10 -m pip freeze
keyboard==0.13.5
mouse==0.7.1
MouseInfo==0.1.3
numpy==1.22.3
opencv-python==4.5.5.64
packaging==21.3
Pillow==9.2.0
PyAutoGUI==0.9.53
PyGetWindow==0.0.9
PyMsgBox==1.0.9
pyparsing==3.0.9
pyperclip==1.8.2
PyRect==0.2.0
PyScreeze==0.1.28
pytesseract==0.3.9
pytweening==1.0.4
After debugging i have figured out that it is due to the ocr being wildly inaccurate spewing out inconstant results (don't even try with autohdr as there is no hope)
Woah thats way off..
Could always try with implementing tesserocr instead of pytesseract, but I think it will just improve the performance and not the accuracy. I also found PaddleOCR which can be tested, maybe that will fix the issue!
After debugging i have figured out that it is due to the ocr being wildly inaccurate spewing out inconstant results
Would it be possible if you could try to view the image that its capturing on your instance by adding:
cv2.imshow('Screenshot', numpyImage)
cv2.waitKey(0)
cv2.destroyAllWindows()
in https://github.com/linus-jansson/btd6farmer/blob/5803d6e1c55a5912543844e358143d51de869e21/bot.py#L67-L72 on line 72 to see if it is even capturing the right place of the screen?
I've already looked at the images it's produced and they don't look particularly wrong but I'll upload the images for the stages when I'm back on my computer.
this is what tensorflow sees:
this is the image which is captured before post processing / converting to black and white:
hope these images help improve the software [my resolution is 5120x1440 so that's why there is excess black pixels but that should be happening i think due to padding mechanism]
I realized that the width and height of the screenshot shouldn't be scaled depending on the monitor res. (that results in your case that the upgrade button is shown which it shouldn't really)
Try with the latest commit to see if that changes anything?
Edit: Don't really think that this would fix the main issue as @jason00-r has the same res as i'm testing on which still should capture in the correct way without any padding..
Jason would it be possible for you to send what round the program think its on by adding print(text)
on line 81 in bot.py
?
I realized that the width and height of the screenshot shouldn't be scaled depending on the monitor res. (that results in your case that the upgrade button is shown which it shouldn't really)
Try with the latest commit to see if that changes anything?
Edit: Don't really think that this would fix the main issue as @jason00-r has the same res as i'm testing on which still should capture in the correct way without any padding..
Jason would it be possible for you to send what round the program think its on by adding
print(text)
on line 81 inbot.py
?
Your most recent commit seems to fix the issue for me. I will run through a full game to verify.
Sorry I didn't clarify - I also have an ultrawide monitor with the same resolution so I have the black on the side as well. The resolution I mentioned before was what the game was set to.
Something appears to be wrong still.
I got a defeat at round 35 from camo balloons. Dart monkeys were not being upgraded at all.
Then after restarting the script, I got a defeat at round 63 with $38,964. dart monkey1 0-0-2 dart monkey2 0-0-0 super monkey 0-0-1 both sub 2-0-3 alchemist 3-0-0 obyn placed and level 13 both monkey villages 0-0-2
Something appears to be wrong still.
I got a defeat at round 35 from camo balloons. Dart monkeys were not being upgraded at all.
Then after restarting the script, I got a defeat at round 63 with $38,964. dart monkey1 0-0-2 dart monkey2 0-0-0 super monkey 0-0-1 both sub 2-0-3 alchemist 3-0-0 obyn placed and level 13 both monkey villages 0-0-2
I will open that in a new issue to seperate the subjects a bit
Something appears to be wrong still. I got a defeat at round 35 from camo balloons. Dart monkeys were not being upgraded at all. Then after restarting the script, I got a defeat at round 63 with $38,964. dart monkey1 0-0-2 dart monkey2 0-0-0 super monkey 0-0-1 both sub 2-0-3 alchemist 3-0-0 obyn placed and level 13 both monkey villages 0-0-2
I will open that in a new issue to seperate the subjects a bit
That makes sense. I will close this issue then. My original issue of no towers being placed is solved.
The bot won't place any monkey towers. It just starts the first round. After issue #12 was fixed, this is the new behavior.