A solid demonstration of using computer vision to bridge the gap between raw pixels and real-time strategy. While 1,000 trophies is a modest milestone, the project provides a clear and accessible blueprint for applying machine learning to dynamic gaming environments.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
I Coded A Clash Royale AI, Then Took it to LadderAdded:
I love Clash Royale.
>> Yes.
>> The only problem is I suck.
>> Aw.
>> So, I trained an AI that plays the game for me using machine learning to detect and place cards. And today, I'm going to take it into ladder to see how many trophies a bot can get. The average beginner Clash Royale player is at about 1,000 trophies. So, if I can get my bot to surpass that, I'd call this experiment a success. All right, so I just made a fresh account.
>> Teddy Huck 2008. Perfect. And I've got the bot booted up right here. Let's hop into our first game. Okay, giant in the back. I like that. The first few games are pretty easy.
>> Two towers. Come on, giant. So, if you want to know how the bot works, let me break it down. Ahem. All right, this bot works by using computer vision.
Basically, as the match goes on, it constantly takes screenshots of the arena. It then converts each screenshot into a simulated board where each square represents an in-game tile. That's game.
All right, we took an L. That's fine. I think we're like six and three right now. Don't laugh at me. During this process, all visible cards, as well as friendly and enemy towers, are also copied onto the board. This way, my bot can actually understand what's happening in the game. All right, I'm going to upgrade some cards here just so that we're not struggling [music] as much.
The knight >> to level three. Our archers can go up.
All right, there we go. [music] Our king tower upgraded, too. That's good. Teddy Huck 2008 will take over ladder. But, hold up. Detecting these troops is where I'll actually need to use machine learning. So, I recorded some gameplay of my starter deck going up against the 12 cards that it could face in the first arena of the game. I split that video into 200 frames and went in and manually labeled each troop on each frame. It took a lot of time, dude. See my eye bags?
>> And the result is that my bot can actually see what's happening in the game. So, check it out. If I give it this frame as an example, it can detect this enemy fireball from this enemy knight and giant from its own musketeer and even this mini pekka that's hiding away over here. Pretty cool, right?
>> I mean, what else would you expect from the Mekanism Mekka channel? We do stuff like this all the time. Y'all should all subscribe. Hit that like button. All that stuff, man. You know, I'mma keep talking. I don't ever stop. We don't All right, one more. Boom. 300 trophies.
No human gameplay, just a bot. Checking the recording, that took 32 [music] minutes. So, we're off to a great start.
But, we just unlocked some new troops that our opponents can use. We'll come back for day two.
>> [groaning] >> All right, guys. It's day two. My goal by the end of the day is to hit the Barbarian Bowl, which is at 600 trophies. So, to start the day, I scanned in the four new troops we just unlocked, and then got to work playing.
Giant in the back. I like that play. My bot's auto clicker also tried to buy the battle pass when I was looking. What the No, no, no, no, no, no, no. It's buying stuff. It's [music] buying stuff. Dude, we lost that. All right, this might take a while, so let me finish explaining the bot.
So, you've established that my bot can see the game, right? Look, when I drop a giant, it gets detected here in my terminal. But, how does it make plays?
Basically, when the bot decides that it wants to make a move, it first scans the four cards in its hand. Each one of these cards is then image matched [music] their elixir value by this Python function, allowing my bot to choose which card to play. When it makes a choice, it simply simulates a click on the card it wants to play, and then simulates a second click at the desired coordinates. Okay, he's wasting elixir on a fireball. That's tower. Mini Pekka is so clutch, I swear. That could be the game-winning giant. Oh, Mini Pekka in the pocket. Let's go. Come on. Oh, and we need defense. It's going to go to overtime. Kill it. No, the fireball is going to Oh, let's go, man. Good job, Teddy Huck.
I'm so proud of you. Guys, I have a confession. Throughout the first 400 or so trophies of this push, my bot actually hasn't been doing anything.
Hold up. No, no, no. I mean, it's been playing all the games, but less of it was, you know, algorithmic decision-making, and more of it was, you know, pure randomness. Oh, you're you're not surprised at all. Anyway, this randomness approach has worked so far where I could just drop [music] down a level five Mini Pekka and just like destroy everything. But, my opponents are getting better now. So, I created this Python file where I'll be teaching my bot how to actually play. So, to start, I'm just going to add some basic [music] rules for it to follow. Like, only place giants in the back. Don't let yourself leak elixir. You know, simple things like that. And with these five starter rules in place, I was happy with the bot and ready to finish that push to the Barbarian Bowl. Oh my god, look at this trifecta coming down at the king tower. Boom! Finish him. Finish him.
Finish him.
We are one game away from the Barbarian Bowls. All right, here we go. Last game.
Boom. Defend the Giant. Boom. There we go. Rule four right there. Mini Pekka on the Giant. Oh, there's the Skeleton Army.
Okay. Okay, the arrows are just late, but that's fine. Minions to bridge. No one told you to play Minions to bridge.
Oh, he's got a Giant. Let's defend him with a Mini Pekka.
All right, last tower, but he takes mine. Rule three Giants in the back.
Okay, there we go. Arrows on the Minions or the Goblins. Just defend the Giant.
There we go. Okay. If I didn't have these rules, I would be fried right now.
This could be the kind of push. Oh, the Giant's going to walk up now. Oh, you lost. One more hit.
Let's 600 trophies just above, man. We had done it. The Barbarian [music] Bowl. But this push doesn't end until we get 1,000 trophies, remember? So, I went to sleep for the night and got ready for the final day.
Okay, I said the Barbarian Bowl was like twice as hard as the first arena, so this one should be maybe three times? I was wrong. No. No.
Although my bot was better and my cards were stronger, the increase in opponent's skill level was just too much to bear. Musk in the complete wrong Damn. This guy means business, yo. That is the fastest loss of the whole challenge. What? And because I was already bored enough sitting there watching my bot barely squeak through a 60% win rate, I decided it was time for my final batch of updates. First, see this right here? The two [music] seconds it takes you to put my hand on the mouse to queue for the next game? Yeah, no, it's way too long. So, instead, I created this for loop to repeatedly queue my next match over and over. Come on. Take tower. Take tower. Oh, he defended. Come on. Come on. That should be it. That should be it. Come on.
Come on. All right, there we go. There we go. Okay, and second, I added more rules. Oh, Barbs, dude. Barbs are going to cause me issues. Oh my god, I need to be able to fireball these Barbs.
Specifically for all the new troops that my opponents kept placing. Like these Barbarians, man. So annoying. So, now my bot knows to fireball enemy Barbarians, [music] place Mini Pekkas on enemy Battle Rams, and place Giants on the opposite lane of Cannons, Huts, or any building. All right, there we go. There we go. We are at 800 trophies. We're getting there slowly but surely, but we're getting there. And with these changes, I had a solid increase in my win rate and was ready to hit a thousand trophies in no time. That's our Teddy.
There we go, Teddy.
Come on, last game. We know it, too.
Come on, last game. Come on!
It's too easy. Come on. One more hit.
Oh, so close. Drop something. Drop something, please. We lost the tower.
That's game, though. [music] One more hit. One more hit.
All right, there we go, man. We are 991 trophies, which means that we're one game away. Teddy, do not fail me.
Ooh, and it's in the spell valley, too.
Good fireball. Good fireball.
Okay, it defends them defends the battle ram. That's good. All right, what do we have for a counter push, Teddy? Come on.
You mini pekka, what do we defend it with? With nothing. Not the best start for Teddy here.
Okay, musk at the bridge. Mega minion coming down the other lane.
Okay, mini pekka archers knights. Okay, we's got to defend this giant with a good counter push. We drop minions on this giant, right? Come on, Teddy. No minions on the giant. Teddy is struggling this game, man. Nervous, man.
Oh my god, ran into the barbs. It should fireball when I had enough elixir, though.
There we go, good fireball. We got it.
That right side is a little bit lower.
We could maybe get that right side.
Okay, mini pekka to the left. Doesn't listen to me at all. Perfect. Good timing. Good timing. Okay, those minions should defend. They are mad low level, though.
All right, nice. Good job. Good giant counter push. Let's go. Okay. Wait, we might get both towers. Got to defend that battle ram. The archers should take care of it. Here we go. Oh, that right side, too. That's a tower trade. There we go. Teddy, spend some damn elixir, man. What is that? Musk. Okay, mini pekka on the giant. Mini pekka on the giant.
Good knight to pocket. Minions to pocket. Everything to pocket.
Oh, it missed the fireball. Oh, no, my face cam died, bro. Okay, giant. There you go. Mini Pekka on the giant. Mini Pekka on the giant.
Oh my god, this could be it. Night. 3 days of work.
We hit 1,000 trophies with a bot I coded on my own ass. 1,000 trophies. We're actually higher than the game lets us with our king level. I mean, the thing about success, guys, is sometimes it just comes to you in waves, you know?
You got to really [music] just sit there and appreciate what's there. Yeah, I hope you guys enjoyed the video. If you want to see more of me, go check out my Twitch. We got great clips happening all the time. FOR EXAMPLE, HILARIOUS, RIGHT? I KNOW. ANYWAY, YEAH, SUBSCRIBE. BYE.
Related Videos
OpenHuman VS Hermes AI: Who Wins?
JulianGoldieSEO
285 viewsβ’2026-05-29
BREAKING: Microsoftβs New Image Generating Model Beat Out GPT 1.5 and Nano Banana 2
aimmediahouse
122 viewsβ’2026-06-03
Long-Running Agents β Build an Agent That Never Forgets with Google ADK
suryakunju
142 viewsβ’2026-05-30
I Made the Same Anime Fight Scene in Every AI Video Generator
NobleGooseAnime
295 viewsβ’2026-05-30
Nvidia Bets Big On AI PCs | New Chip To Power Windows Laptops | Technology | AI Updates | N18S
cnnnews18
3K viewsβ’2026-06-01
I Tested NEW Opus 4.8 on Four Projects (Updated LLM Leaderboard)
AICodingDaily
298 viewsβ’2026-05-29
3D Platformer Update - NO CAPES
SolarLune
294 viewsβ’2026-05-30
AI Doesn't Create Bias β It Inherits It
UXEvolved
176 viewsβ’2026-06-01











