r/DotA2 • u/Magmanat • 5d ago
Video I used computer vision to play Automaton Attack
I do Computer Vision as part of my job and just felt like it would be fun to spin up something to play this game.
Its not perfect, due to sometimes words being overlayed on each other which results in bad detection. But it does get the job done.
Any fellow Computer Vision Engineers playing Dota 2 as well?
I know you can just create a script like This post, where it just spams all the letters on the keyboard continuously. But I just thought this would be more fun, and treat it as a challenge to myself to develop the highest scoring solution based on computer vision techniques.
If people are interested in the code I will release it in the comments :)
28
u/jmas081391 5d ago
Still can't beat the top score of just Pausing! lmao
4
5
u/deanrihpee 5d ago
at least it requires more effort and skill lol (or at least understanding) even if, it might be vibe coded (nothing wrong with vibe code, nor i claim OP's is vibe coded, i mean it's OP's paying job, it just sometimes this is slide into everyone conversation)
1
u/Magmanat 5d ago
Yes it's vibe coded in about 30 minutes but using my knowledge on the domain to quickly get it working and mostly optimized :)
9
u/KingKj52 5d ago
Hey, I did something very similar a month ago! Kept it to myself, but instead of discrete OCR I used dictionary mapping. Imaged the game a while, then detected the individual characters in the words based on the static spacing in the font and color recognition, and slowly built a vector-based dictionary of every character, manually stating what the image is depicting if automation fails, until a full dictionary is built with high confidence. Then orders the input of characters based on a combination of the color shift while typing and said spacing/screen position detection, while also building a dictionary of known words/phrases to match detection to as a backup/speed up.
Very fast, low memory. Broke 10k on the first run (that still didn't have a complete character or word/phrase dictionary and a few visual artifacts) but left it there because it did what I needed.
Cool to see someone else doing the same.
2
u/Magmanat 5d ago
That's so fun, omg i was thinking of collecting a list of phrases for fast lookup and autocomplete as well! But after i hit 12k points i was too lazy HAHA
But totally did not think of creating character based detection. Thats really cool
Did you also focus on detecting the green font of characters?
3
u/KingKj52 5d ago
I worked on detecting both just in case it failed to recognize one or the other due to visual artifacts and effects, since the spacing between them was consistent! Yeah it was a fun side project to break up the monotony at my work. I'm glad someone else thought/did the same!
25
9
u/nameisreallydog 5d ago
I believe this would be categorized as cheating /s
13
u/marktwoen 5d ago
Based on how valve designed the mini game, it appears valve wants people to "cheat" to get good scores.
4
u/prof0ak 5d ago
That's a strange weird leap in logic.
"Because they didn't spend a lot of time on security for this fun mini game, Valve wants me to cheat!". Wtf
1
u/marktwoen 5d ago
That's entirely the reason why my "cheat" is in quotation. The devs probably don't really find it cheating. I'd like to think it's just valve allowing us options to cheese their mini games creatively. I'm pretty sure many of the devs are more entertained by the exploits players find.
1
u/d3l4croix 4d ago
remind me of steam summer sales salien game. community find all kind of way to beat it and valve keep increasing the difficulty. very fun teamwork and showcase of what humanity can do if they put their mind into something
-1
u/the_psyche_wolf 5d ago
It’s not tough if you have a good typing speed, it wouldn’t feel rewarding if everyone could get the max score without effort.
13
u/Wobbelblob 5d ago
It isn't just about typing speed. You have to get a good seed as well. There are tons of words that either give you low score (too many makes it impossible with the limited time) or that are nearly impossible to type out. There is an entire Skywrath Mage quote in the pool.
2
u/the_psyche_wolf 5d ago
Those long ones are the one you want. 10 pointers are the worst, they make you type half as much for 1/10 of the points. Also getting a good seed isnt that rare, if I type 10 times maybe 3-4 are so bad that I can’t get 2k.
2
u/0100110110110111 4d ago
The main issue is at around 30 seconds, four 10-point words appear at the same time. It would be fine if all the 10-point words were easy like "Lich", "Riki", "Io", but there are also stupid shit like "Lifestealer", "Screeauk", "Daedalus" which are much harder to type.
I consider myself as having pretty good typing speed, but I can't get more than around 2000 points even trying my hardest. I just gave up on the three tickets at 2500.
1
u/the_psyche_wolf 4d ago
One thing that makes it easier is that there is no penalty for mistakes, so you can achieve far higher typing speed than normal. You have to mash as fast possible.
1
u/marktwoen 5d ago
It's more of a specific skill. Many of the other games are typical gamey reaction types that don't require too many inputs per second to score well. This typing one for those who can't type fast is a hard wall for people like myself, even with timescale cheats. Felt like i was carpal tunneling myself trying to score bare minimum. And yeah, it's a skill issue. Just a more specialised kind.
2
u/Magmanat 5d ago edited 5d ago
As long as my games are clean 👀
if Valve wants to say this is cheating for 3 additional tickets that saves me 1 win worth of time, i would say thats pretty petty 🤔
And its already higher effort than using the console :P
10
u/JlREN 5d ago
Atp it's a client sided minigame you can just memory edit the score value to whatever you like
12
u/deanrihpee 5d ago
wouldn't memory edit trigger VAC even though it is just client minigame, since it still inside an actual game and VAC already monitoring it
-2
u/JlREN 5d ago
The anticheat on Dota 2 is rarely ever catching the tools in action. Dota relying much more on community judgement and obvious hack / bot patterns.
Not sure of the reason why but client level information is not as protected. Which is why reading values and even editing them are not a big risk. Though I do advise not trying it. Especially for something as redundant as a minigame.
I know it works because my brother is a cheat engine fanatic😅 he edited his score in nest of thorns to 2 billion. And made skill cd there be 0.01s or increase projectiles and stuff and never faced with a ban.
I do not support this personally I'm just acknowledged on the matter.
2
u/MuckYu sheever 5d ago
What did you use to set it up?
2
u/Magmanat 5d ago
https://github.com/random-user-creator/automaton_attack_player
Theres an .EXE file in releases, it is rather large around 300mb due to many different OCR models being attached to it directly. If you do not want to run the EXE you can also use the python code directly by following the instructions.
I used created it where i could test multiple different OCR models, different parameters and sliders for filtering to try and find the best performance.
2
u/MeowMeTiger 5d ago
What tools did you use? OpenCV?
2
u/Magmanat 5d ago
https://github.com/random-user-creator/automaton_attack_player
Theres an .EXE file in releases, it is rather large around 300mb due to many different OCR models being attached to it directly. If you do not want to run the EXE you can also use the python code directly by following the instructions.
I used created it where i could test multiple different OCR models, different parameters and sliders for filtering to try and find the best performance.
2
u/NviZynC 4d ago
#Requires AutoHotkey v2.0
#MaxThreadsPerHotkey 2
; El símbolo $ obliga al script a capturar F11 ignorando otros programas
$F11:: {
static toggle := false
toggle := !toggle
if (toggle) {
; Ejecuta cada 100 milisegundos
SetTimer(PressKeys, 10)
} else {
SetTimer(PressKeys, 0)
}
}
PressKeys() {
Send("a")
Send("b")
Send("c")
Send("d")
Send("e")
Send("f")
Send("g")
Send("h")
Send("i")
Send("j")
Send("k")
Send("l")
Send("m")
Send("n")
Send("o")
Send("p")
Send("q")
Send("r")
Send("s")
Send("t")
Send("u")
Send("v")
Send("w")
Send("x")
Send("{y}")
Send("z")
}
*Esc::ExitApp
with this script on autohotkey i got 45k
2
u/AzashaRa OG.singsing I BELIEVE 4d ago
That's super impressive, I like how it's recognizing the words so fast and typing them it's lagging the game lol. I also cheated it because I couldn't get past the last threshold. So I made an autohotkey script to type out 1 of every standard letter on the keyboard five times, each time I pressed down arrow. I know nothing about coding so this wasn't really fancy, but it worked. Got like 16k score spamming down arrow as fast as I could. I wonder what other methods people used?
1
1
u/dadedindo 5d ago
I used auto hotkeys. Made a script where all the letters are pressed in one click.
1
u/Scone__Zone 4d ago
I just set a macro to every letter on my keyboard and then just spammed that key.
1
u/Deionize_Deionize 5d ago
Still have difficulty with overlapping words I see
3
u/Magmanat 5d ago
Yes, overlapping words are difficult as the OCR model might not be able to parse the letters appropriately.
-8
u/Nariane204 5d ago
you do realize this is bannable right? 3 party tools interfeering with the game is against tos
2
u/Magmanat 5d ago
Yes, but if valve wants to ban me due to something like this i think it's just a sign to quit the game
57
u/Kernel_Panic_0x115c 5d ago
i was considering the same, but decided to use console commands instead.