8th place overall, 1st python solution
Thanks a lot for the challenge. It was very fun
My strategy was to gather mana, then go on a full-scale attack. No defense at all, besides early emergency defenses.
1. Mana farming
This is the most unpolished, crude part in the solution and I know there are some simple things that would improve a lot in the bot’s performance. Basically all I’ve done is going after the closest visible monster, unless there is a hit-more-than-one-monster situation available. Also, heroes were forbidden from leaving their designated farming spots too far. During farming, there is a defender role assigned whenever there is a monster targeting my base that I could kill before it reaches the base. This role was assigned to the hero that could catch it the soonest.
2. Moving to the full scale attack
If enough mana was gathered (sadly, I didn’t check for the optimal amount), I send all the heroes closer to the enemy base. In this phase, I do some emergency defenses if I detect I can quickly save my base using Control or Wind. If I stumble upon a high health monster that is not targeting the enemy base, I use Control. I try to avoid damaging monsters that are threating the enemy base as well.
3. Full scale attack
My attack strategy is 3xWIND only. When I say shooting, I mean 3xWIND towards the enemy base.
When heroes are close to the enemy base, I iterate through all the visible monsters and select one that I can surround and shoot towards the enemy base the soonest (the exact options I consider are described below). The important part is I calculate in exactly how many turns I can shoot. I don’t necessary require the monster to reach the base immediately after shooting, because that would limit my shooting range to 6900. There are some strategies out there that defend very well against shooting from 6900 range.
Depending on enemy heroes’ locations, I sometimes shoot from much farther, even as far as 11000 units, if I figure that enemy heroes won’t be able to catch the monster in time OR if I have a lot of mana, I can shoot a spider just to force the enemy heroes to go back to save their base. After they go back to save their base, I can shoot freely from range 6900.
I analyze a few scenarios and select the best one:
a) Surround the monster, wait until it is close enough and shoot (30 mana cost)
b) Use Control on the monster, surround it and wait until it is close enough, then shoot (40 mana cost)
c) Wait until the monster is close enough, use Wind and shoot immediately after this (1xWIND->3xWIND 40 mana cost)
d) Rarely use Control, wait until monster gets close enough, then 1xWIND → 3xWIND (50 mana combo)
Additionally, I assert a few things heuristically:
- Will the monster be alive after shooting? Maybe it is already targeted by enemy heroes? How much damage can they deal before I shoot?
- Is it safe to deal some damage to the monster before shooting it? If yes, do this to get mana. It’s best to shoot monsters that have 1 or 2hp left.
If I find myself having less than 30 mana during the attack, I try to get the missing amount by attacking the monster without killing it. If impossible, I do whatever it takes to get mana.
A good counter for this strategy is a tenacious, Wind-heavy defense, which pushes my heroes far from the enemy base. My heroes tend to stick together and they actually need to be together to perform the attack. So splitting them up is a good move that will often work.
Representative replays to see the algo in action:
Very poor win ratio (like 10%) against #1 @bowwowforeach who had a great defense.
This is one of the lucky victories: https://www.codingame.com/share-replay/631483357
This is lost due to mana struggles: https://www.codingame.com/share-replay/631533331
Against #2 @blasterpoard I usually lost, but when I won it was a very short game:
https://www.codingame.com/share-replay/631502123
https://www.codingame.com/share-replay/631502123
Against defense heavy and late attacking #3 @Nanaeda (around 50% win ratio):
https://www.codingame.com/replay/631524787
#7 @tkodai had a very similar strategy, but he farms for longer so I usually won 1v1:
https://www.codingame.com/replay/631511795
Nicely solving some mana struggles during full scale attack (#17 @Zylo):
https://www.codingame.com/replay/631541193