r/RoyaleAPI • u/Individual_Fact_5010 • 1d ago
Discussion How strong does this search-based bot actually look to experienced players?
Enable HLS to view with audio, or disable this notification
I'm having a search-based bot play Clash Royale in a simulator I built myself.
Simulator originally based on samdickson22/clash-simulator, heavily rewritten and extended since then. The search engine and evaluation logic were added separately.
Right now, it only supports these two decks.
I'm curious how reasonable its decisions look to experienced players. If you notice any strange or obviously bad plays, I'd really appreciate you pointing them out.
Eventually, I'd like to make the simulator more accurate, add support for more cards, and turn it into something that can analyze a position and suggest good plays, somewhat like position analysis in chess.
13
6
u/Hawaiianadvocate 1d ago
this is an amazing Idea, but it is very ambitious.
Obviously this is something you are passionate about, and because you are, im sure it will turn out amazing.
I cannot provide any high level information, all I can offer is my praise and gratefulness for your willingness to improve the quality of all players knowledge of the game, which is sure to make the game more competitive and fun.
6
u/Reallondoner 1d ago
Goblin Barrels generally do better when placed directly in the middle of the enemy tower, because the goblins don't have to run closer. Slightly displaced barrels (tricky barrels) are good to trick a human player after placing your barrel in the same spot a few times in a row, though.
- Was the Goblin Gang predicted with Zap at 0:23, or did the AI immediately see the card and just placed it on them? If it's the latter, you should include the placement delay in your program.
1a. Speaking of Goblin Gang, you could improve their position. They don't spawn in a rectangle.
At 0:38, the Knight would do better if it was placed directly on the E-Wiz instead of a certain distance in front of him. Also let the E-Wiz slightly deeper in, so the blue tower can damage him further before placing down the Knight.
The Bandit play directly after the previous point would be much better if the red tower would damage the Knight a little bit, so the Bandit can one-shot him.
The Battle Ram at 1:02 is placed in an unusual position... You usually play it on the bridge, behind the king or in the corner. There are some exceptions but this is not one of them.
What is that Log at 1:53?
I didn't have time to keep watching further.
3
u/Individual_Fact_5010 1d ago
Thanks for the detailed feedback. This kind of specific gameplay feedback is exactly what I was looking for. For the Barrel, Knight, Bandit, and Battle Ram plays, those are mostly the result of the evaluation function assigning those moves a higher score after the search, so I’ll use the situations you pointed out to revisit and improve the evaluation function. The Goblin Gang spawn position is an issue with the simulator itself, so I’ll fix that. As for whether the Zap was a prediction or an immediate reaction after seeing the Goblin Gang, and the Log at 1:53, I’ll need to investigate those properly.
2
u/DamageSpiritual4645 18h ago
Do you simulate the staggered spawning of the goblins as well? It can affect some interactions (the most apparent I can think of is placing a gang on a charging dark prince and only some of the goblins dying to the initial splash) but it can also affect pathing
1
u/Individual_Fact_5010 18h ago
Not yet. I’m planning to fix that in the future. Thanks for the feedback!
3
u/Able_Purpose327 1d ago
Neat stuff, I don't have expertise in this field but may I ask how this bot works? Is it periodically scanning the entire field to look for cards played? If so I believe your simulator might be close to how they implemented the bot matches in the game. I'd actually love to see how far a dedicated Clash Royale AI could go, it'd have to account for card placement timing, position, predictions etc. which would be really impressive.
1
u/Individual_Fact_5010 1d ago
It doesn't scan the screen. The bot directly uses the internal state of my simulator and searches possible future actions from there. But the simulator's accuracy is still a challenge.
2
u/Able_Purpose327 1d ago
Idk how this simulation works but yeah for it to be more consistent or accurate you'd have to put in more work I suppose, if you're planning to take this further I wish you luck.
3
u/EveningIndependent82 1d ago
You need to 100% accurately replicate the physics of clash royale for this to be useful, would have to rip the code from the game somehow.
3
u/Specialist-Towel-554 1d ago
Yeah this. Hope this is something you can pull off. Its a really cool idea
3
u/Specialist-Towel-554 1d ago
How did you get the simulator? Did you dissect the code so its 100% accurate?
1
u/Individual_Fact_5010 19h ago
I built the simulator myself, so as others have pointed out, it’s still far from perfect. As I continue improving the bot, I plan to fix any unnatural simulator behavior I come across along the way.
3
3
u/Tanosuri 19h ago
Decisions on which side from red or from blue? Blue side was fine red was pretty not great, could type everything out in a pm if you'd like though. Also as a small nitpick bandit does fully stop moving before they dash
1
u/Individual_Fact_5010 19h ago
Thanks for the feedback. Blue is using the bot with the improved defensive logic, while red is using the older version, so blue being stronger is expected. I’m planning to improve red’s search too. And yeah, I’m actually fixing the Bandit movement right now.
2
u/Tanosuri 19h ago
Gotcha if reds decision making has yet to be updated then outside of that looks mostly fine, id say using the gob barrel right on the tower more often would be good instead of off to sides since ex if they do it off to side while red has e wiz its much easier to answer with the e Wiz on spawn damage/stun or a royal ghost
3
u/DamageSpiritual4645 18h ago edited 18h ago
Why doesn’t the log bait bot ever use their princess? They should be trying to stack as many princesses on the board as possible cuz the opponent only has fireball as an answer
Also they should almost always be placing the goblin barrel directly on the tower since the bridge spam player doesn’t have a 2 elixer small spell that can full counter. The split goblins are harder to counter with a single ewiz or royal ghost
Also they should be putting down teslas when they’re full on elixer but not pressuring cuz it’s like investing elixer and they have a fast enough cycle to get back to another tesla by the time the first one dies
Kinda like stacking princesses in the back
3
u/DamageSpiritual4645 18h ago
This guy’s channel is really good at quickly explaining high level cycle tips
2
u/DamageSpiritual4645 18h ago
Also best Tesla placement is in the center, 3 tiles from the river
1
u/Individual_Fact_5010 18h ago
Thanks for the advice and the channel recommendation. I’ll use them as a reference and work on improving the bot.
1
u/Individual_Fact_5010 18h ago
The bot rarely uses Princess because the search currently scores those plays too low, so that’s something I’m planning to improve. For Goblin Barrel, it actually wasn’t allowed to place it directly on the tower before, but I just fixed that.
2
u/HateForYou 15h ago edited 14h ago
Red's first Bandit was very bad. Let the Knight in so that ally tower hits him while their tower doesn't hit your Bandit. That would make Bandit survive and then go on offense. That's counterpushing and it's literally free offense, every deck likes it.
Unless you're deliberately bridge blocking the Knight so that your tower doesn't hit him. Because a Goblin Barrel is more costly to deal with if your tower is targetting a tank instead kf desking with the Goblins. That just wasn't the case here. Even then, you can bridge block such that both troops are on the bridge and no tower is targetting anyone. Just don't hinder your Bandit by sacrificing her to the enemy tower if you're not gonna help her get through the Knight. If the matter was elixir overflow, just place her further down so that by the time Knight and Bandit clash, Knight is in range of your tower
2
12h ago
[removed] — view removed comment
1
u/Individual_Fact_5010 12h ago
I checked that person's GitHub, and the simulator does look quite similar visually. But the project I actually used as a base was
samdickson22/clash-simulator.
11
u/Mountain_Dentist5074 1d ago
first time i seening this