I tried to make a Valorant AI using computer vision
Vložit
- čas přidán 26. 05. 2021
- I went down a rabbit-hole of trying to make a Python program that can play Valorant using computer vision and some radio shenanigans.
More details, errata, etc.: www.riveducha.com/valorant-ai...
Radio dongle: CrazyRadio PA amzn.to/3GDzEhb
This video intentionally doesn't go into too much technical detail - not sure if that's something people want or not. I tried to present enough so that you can at understand what this bot can and can't do, and also understand some of the problems it's having. And if you don't play Valorant, hopefully the premise is understandable - shoot the bad guys.
If you're worried about this being a hack, you can rest easy. It's not like a wall hack where it looks at Valorant's process memory to get information that's supposed to be secret. The bot's not at the level of advanced Valorant strategy right now, but I have lots of ideas for future development.
Software used include:
* labelImg - used for labeling the data set
* PyTorch - similar to TensorFlow
* NumPy - amazing library for working with matrices
* OpenCV - great library for doing some image processing (in conjunction with NumPy)
* Google Colab and Jupyter Lab - great for exploratory programming, especially when working with images
* PySide2 - y u conflict with torchvision dependencies??
Some people doubted that the OpenAI shell video I made was real despite the mediocre results shown, so I hope that by showing even worse results in this video more people will believe it's real.
Also, follow me on Twitter: @riveducha - / riveducha
Images:
Human Brain clip art: CC-BY 4.0 SykesOffice commons.wikimedia.org/wiki/Fi...
Music:
Corbyn Kites - Shadowing
"Inspired" Kevin MacLeod (incompetech.com)
Licensed under Creative Commons: By Attribution 4.0 License
creativecommons.org/licenses/b...
NoMBe - Take Me Down to the Fashion Show
Kwon - Pluckandplay - Hry
...but why? Why do any of this?
cuz it's interesting AF
you're more than a year late to ask that homie
@@jazzWF Its a question unbound by time
Cause computer vision is awesome!
Because he can.
It's amazing how you can easily replicate my teammates in comp
lmaoo absolute gold comment. This should get pinned HAHAHA
Yes
He should make a neon bot that sprints into the enemy's spawn with spike lmao
@@zem0ku605 what rank are u?
1to1 replica
This video made me understand why my friends call me a bot.
105 likes
No comment.After 1 year let's fix it.
Lol
@@reportagebykonstantinos8030 agree
4 comments
LMAO
Calling Valorant a csgo gamemode is the funniest and most fitting description of the game I've ever heard
the AI is like a noob and a pro fighting over the controls.
you're getting close.
Anyone else just get recommended this video 1 year later?
Great video btw
Yes
Just got this recommended. Really good work!
I am impressed by the performance you can achieve with transfer learning on your "small" annotated Valorant dataset. You still remember how high the performance for different objects was on your test set (accuracy or MAP if you have computed that)?
It also really hurt me not seeing your model TURN upon hearing someone behind :D Would really love to see you including audio next, and then seeing some nice 180 flicks in version 2.0.
reocmmended
When i was doing my project with computer vision, I gained almost x10 performance increase just by downscaling input image by some ratio. Of course, it lowers the accuracy of results, but, sometimes full resolution is MUCH bigger than enough and downscaling isn't going to affect the results at all.
So, by downscaling input images you can boost performance for free by finding the optimal level of downscaling.
One thing I thought you could do is make it so a label has to show up for 150ms (roughly a standard pro reaction time) - that way it doesn't shoot at every 1 frame ghost it thinks it sees, but only at persistent threats - and also it makes it seem more realistic and human-like by having somewhat realistic reaction times. You could also have it move the aim slowly over time in trial movements until it's over the top of the marked target and only shoot once it lines up, which would not only improve reliability of the aim but make it seem even more human-like and I just realised this video was from may 2021 and you're likely not even working on this any more oh well
nice
Desinc on a 1 year old vid
@@eHeSTaFIXtatiCkANKpiQU I know, I wanted to write it anyway so I did
@@eHeSTaFIXtatiCkANKpiQU dawg
This takes "My teammate is a bot" to a whole new level
hi mom
hey mom
Not me getting false banned for "3rd party program" then this guys making an ai for valorant 💀💀
Why do I honestly think this bot could at least get bronze... Iron is a weird place
The only flaw I see is that it doesn't know to trash talk
Pretty interesting video, ans it's really well made as well. And it has subtitles! Thanks!
I’m happy that somebody likes the subtitles!
@@riveducha hello friend, my name is Luigi, would you please help me?
@@luigiesposito2481 help you in what?
now get 8 more people and make a custom lobby so the bot can learn from actual gameplay experiences.
The lore of Terminator 7
@@andraskmeczo575shit actually happened in rocket league 😂
As someone getting a PhD in Machine Learning, you're doing the work of someone getting a PhD in Machine Learning.
why just after 1 year? youtube hello?
So, I know this video is kind of old, but I just discovered your channel and I'm watching all your videos 😅. I'm a PhD in machine learning, and I saw on the quick code that appears on the video that you are using large images. I don't think that this is necessary. You could downscale the images, use on your model, and recalculate afterwards where the BB is on the real feed. A second thing I would suggest os already use a pretrained huggingface object detection model just to see if it detects the caracteres as a person and use simple code to see the color of the border. This solution should help with the low data amount. You could even create data this way :) I don't have a solution for the spikes and mollies tough. Either way awesome video!
Bro said he didnt share the code but somehow I see this in all of my ranked games
This is a prime example of a CZcamsr who needs a shit ton more attention. Well done!
Play unrated pleaseeee. I need to hear how the ai will react to verbal abuse
I said it before and I'll say it again.
These are the *best* videos on CZcams right now. You sir are on the fast track to 2mio subs if you keep up this frequency and quality.
Good luck and well done 👍
Appreciate the support!
when Riot don't make bots in custom so you do it yourself
Just go into a comp game
@@qaugithaduck5771 but then I'll be the bot
So this is what my braindead ranked teammates were using
6:04 not going to lie that far friendly on the left, i thought that was sova until you pointed it out.. i guess im just an engineered AI
You need to reduce the size of the images the neural net is provided with. Go black and white and scale down the images, this will let it perform so much faster
But also reduce the resolution.
But also reduce the resolution.
This is extremely cool, and I’m super impressed! You’ve given me the motivation to get started on a few personal projects I’ve been considering.
I love stuff like this, combining hardware hacking and multiple devices and data streams - managing complexity like that and coming up with solutions for problems in that space is so much fun.
This project really is incredible - the way the video was captured, the way inputs were sent to the game, the problem solving of getting a used dongle when the exploit was patched, all of it was wild!
Id love to see a series on this as you keep trying to improve it, it was so much fun to watch
whoa, I didn't know pytorch was so hard to download year ago. Now everyone can download it
THIS IS SOO GOOD. As a person just starting off with OpenCV and AI and stuff and an interest in Valorant, this is godly. I do want to see your code just to see how you used all the AI libraries and stuff purely from an academic standpoint but it makes sense why you would not want to.
I wanna see the code as well lol ive made a kinda poop bot for CSGO but it was cool please make a github with the code maybe or something
bro literally made my ranked teammates
This is why you never take down videos. They could pop off years after uploading
Wow youtube algorithm took its time
SAME
"grad student or other sweatshop labor" - lol.
This is gold. Things I think you can do (although it's been a year so who knows what happened) is obviously have it be aware to object presence, as you have said in the video, but also respond to sounds, voice commands (via wheel ore voice chat), awareness to economy, and most importantly, have it teabag other players.
Bro just created an Iron 1 player.
Also this bot oddly resembeled the teammates I get during my rank ups lmao.
Well you never really know since there are a lot of bots out there that can roughly simulate human actions
@@DreamingBlindly me when i lie
Just got recommended your video today randomly and loved it. I thought you were a much bigger channel, you definitely deserve more views!
It is so painfull to see ai struggling, knowing he is just not good enought and there is nothing it can do until some human makes a better version of itself.
No what's more painful is knowing there are actual human being that plays like this, viewangle desync (aiming at the ground), doesn't use audio etc etc
Eh, if you use one of those learning bots it can. Also I don’t know much about this stuff so lmk if what I’m assaying is incorrect
have a 5v5 with copies of this bot
It's funny, I wrote computer vision bots for both PUBG and BDO using very similar tech. I followed nearly the same thought paths as you, used the same strategies / tech, and hit the same roadblocks. The part about being unable to load cudart had me dying, I know that pain. People would ask me why I bothered and I had no answer other than it was fun, so yeah I totally get this video and am glad to see someone else understands how satisfying making something like this can be, even though there is no real advantage to be gained.
This video is a year old and now is being recommended to everyone
"this looks fun, but i might get banned if i test it in a multiplayer lobby"
"ever heard of tf2?"
Honestly, I have watched this video about 4 times in the last month; because of how good it is, unfortunately there are not many good videos explaining how to train a custom data set, but your sources in the video's description helped me alot thank you for sharing this information.
It would be super fun to have like a league where it’s only AI you make yourself. 5v5 AI tourneys
Those kind of tournaments exist in Cs : each team has code from a specific dude who programed all the moves of the bots of his team. Very funny to watch
the lack of object permanence is pretty realistic for pugs honestly.
Dude thanks for making this video. You have finally proved my point that this game has bots in ranked, started noticing it since I hit rad
Oh so that's how an Iron Player is created
Best iron player I’ve ever seen tbh 💀
I worked with cv2 already but this is next level, my dude. I love this video so much and computer vision is extremely interesting. I actually consider focusing on computer vision in my future career. Anyways, thx for this awesome video and great inspiration.
U are an beast
plz keep training this AI to point it can play at at least Iron level) Waiting for part 2)
wait, u mean irons are better than this?
@@sakana6388 yeah, they are
I am actually planning on developing a thesis with Machine Learning and AI, and your video just shows up on my feed. Incredible, you just gives me an idea! Thank you so much for that, really appreciate it.
Looking back at the older games like Counter Strike 1.6 that has bots, we are totally hoping this game also have like that bot you have made. Actually it's easier to create it on the system itself, not based on Computer Vision, but anyway... this project is smaller than large companies made for robots and self-driving cars like Tesla. Don't compare yours to them, this one-man project really amazes and inspires us on the community.
yo this is actually a really cool video and experiment. thanks for sharing your findings!
if only you could train it using a REPLAY SYSTEM
This takes "It dosen't use headphones!!!" to a new level
You should meet TacticalPumpkin
More videos like that with deeeeep technical explanations, i understand in this video so much things that i been searching about and didn't understand
awesome work here man ! Would definitely love to see a part 2 some day
Amazing work. My daughters told me about this and I was impressed so had to check this out. Well done!!
I think it would be really cool to have it read chat commands from teammates
stuff like"!go A" "!Defend Spike" "!defuse spike"
My dream is literally being able to do these things. I love the video, keep it up!
This is hard AF, I've tried computer vision before. This guy did a great job
Well done
so this must be what all my teamates are
It's things like this that make me wish I had the patients to learn coding and neural networks, I'd have so much fun just experimenting and pushing the boundaries of what I could create
I’m actually a CS student that is like kinda losing passion. I love playing game and all but after going through 3 years of pain automata theory and algorithm which burnt my brain with a little twist of discrete math.
I don’t really see how all these things can help me in any practical way as web development job and other common field actually dont really need much theory
So kinda lost. Be like why am i here… why am i suffering for no apparent reason 💀 I recently got into like data science and getting deeper with developing machine learning model. Find it quite interesting since it’s actually highly practical (we need to train data anyways so it cant be non practical) other than machine learning math course.
Buttt My uni didn’t offer much unit for this field so pretty blur on what I can do other than training facial recognition models…and it kinda gets boring along the way.
In the mean time, i grind much Valorant to get through uni stress
THEN CZcams RECOMMENDED THIS.
Just wanna thank you alot as final sem student here and sincerely lost on what the hell i should do for my future.
This project is definitely awesome and fun. It’s an inspiration to me for real. I really wanna grind more ml knowledge to be able to make project like this ahahhahaa
Would love to see more owo ❤️
You should set 2 of these up and have them 1v1 eachother
What an amazing project, these types of projects are what we engineers think of doing and give up saying it's way too much work 😂. Anyway great work and good content.
That was a really good video explaining AI and ML. Great Job!
You knew that what you made wasn't perfect, but the feel of making something on your own is awesome. great video!
CZcams algorithm as unusual as always, glad i found this gem of a channel
an improvement method for your labelling:
you can add the ability to analyze moving images (for paint-splatters) by introducing a LSTM or similar.
this will also remove the false labelling of beams or shells as enemies or spikes because the data in the short-term memory makes it impossible to mistake a bullet-shell for a spike. and the data in the long-term memory might even know which friendly is holding the spike.
i think u gotta distinguish not just from enemy, but enemy head, body, and legs, so it knows where to aim to.
Inb4 you literally make an aimbot
@@adrielle1i23 haha not on purpose, but it would eliminate a lot of the error -making in the process of elimination for the AI when it notices a close-up enemy or even an in-movement enemy. it would be hard for the AI to notice a head peaking enemy otherwise or somesuch.
@@kecs2 I actually don't think that would make a difference. The biggest difference would be from using multiple frames instead of a single. Even humans have a hard time noticing features of a still image. But if something is moving it's much easier to see.
@@oblivion_2852 ya thats what i mean, multiple frames to highlight a different portion of the body the way valorant divides its damage multiplier: head, body, legs
this is still really impressive! well done!!
hes designed a very evil new generation aimbot and he doesn't know
exists already for months, ik ppl who sell those aimbots
its nothing new, people have been doing this since 2017
@@ZapWyd are those based on AI or they just somehow able to read encrypted data of valorant inside the computer and judge the position?
No way... this guy finally found a way to have fun in Valorant
Awesome Video. Changing the border color for enemys to a bright Pink or so could probably help with lots of false Enemys. The second one is a bit more tricky you are right. But I believe this could be since the AI get trickked in a way of an illusion like the Necker cube. Since you allways start the round facing correct you'd could use that data to make a null-point and just add the inputs and afterwards delete them again to allways have the correct view. Anyway thanks for the video I look forward for more.
Very interesting video!
By the way, the creator of YOLO had ceased his research to prevent the tech from being used for military applications. I hope it will not be misused.
no way i found where my teammates come from
This is getting recommended after 1 year lol
Incredibly knowledgeable and we'll-spoken teacher. Nice tutorials comfortableness with the subject makes starting soft real exciting!!
I'm glad this vid got recommended to me. For enemy detection, you could probably use the fact that the game outlines all enemies in the same bright red color to make the job easier on yolov5.
Getting the resolution down 2 to 3 times would massively benefit fps and save some computing power
youtube recommended us all at once
tf
Tru
There is probably a way to randomly generate training data. The games assets are probably available, so rendering pngs of just character models (with alpha 0 background) at different distances and angles, placing them randomly into background shots of the game and automatically generating the outlining box where the png got placed (that you till now had to manually draw) could give you lot's of training data very quickly wich should improve the results of your AI model by a lot. Just an idea
you should setup a custom game 5v5 with these bots, then spectate and see who wins!!
He’d need like 20 computers lol
@@kaveenchainani127 2v2
Reinforcment learning is better at such tasks than ML or DL
Reinforcement Learning is a field of DL and ML...
Actually, some of this situations looks like average player on 15-20fps
This is actually really cool, i recently did a project using opencv and yolov5, and i was wondering if i could make a valorant bot like you did. i am absolutely blown by this
Hey love the content, speaking as a overglorified trolley collector studying computer science and biomechatronics, ive only ever really worked with prerecorded material for AI, so forgive me if this cant be applied. I thought could be interesting using interpolation to track specific markers between set intervals/frames to track the future, pass and present frames for charactor motion and to predict where to aim and shoot with the low frame rate. For the navigation aspect, my big dumb idea for that is using planar homography, taking in the height of the player model and angle to visually map and record coordinates around the map and develop a nav mesh which the ai could then use to get around corners
It's amazing how many people in the comments fundamentally misunderstand the viability of this project. There are so many holes and workarounds in play that fundamentally handicap the prospect of making this an actual bot, and getting through them would require insane amounts of both processor time and man-hours. This is _not_ EZ Valorant cheats; it's three brain cells fighting over who gets to control the legs.
cant believe you picked brim instead of kayo during testing
This is unbelievably high quality video, big kudos!
Honestly I wouldn't be mad if I encountered this in a real game. Because it gets the same inputs as a human and it's not stronger than one, it seems fair enough to me.
said no one ever
Right now, yeah, but if this got better it could easily be better than a pro player
@@carterlove yep. Give it a good gpu and a few month of data and you'll die instantly facing it.
it would be cool to see 2 AI's 1v1 each other in valorant
OMG YES PLEASEEEEEEEEEEEEE
I see alot if the comments are from hours ago, somehow this old video is suddenly getting recommended to people
if you look closely the comments are sorted by recent by default in this video
@@kujubuo thing is if you change to top comment it still is whithin this month
It's so much easier with valorant than with cs because of the player highlight and no friendly fire. In cs the players blend into the environment and the training is much more complicated.
genuinely impressed by this, im looking forward to more improvements
How are we all just seeing this now?
fr lmfao
One thing you could do is connect a wireless audio adapter into the game PC and have it transmit to the Bot PC.
Then you could use an audio library to monitor the left and right audio channels for things like footsteps, gun shots, volume, etc.
Then compare those findings to the mini map to see if those sounds are coming from a teammate or enemy. If it couldn't be coming from a friendly, have the AI turn in the direction of the sound.
That'd be a way to at least get some basic sound integration done.
dude this video is awesome! AI technology is amazing. Hope you continue to improve this type of stuff!
I Hope to see more of this!