This was my best performance in a contest so far.
I want to thank the creators AntiSquid, Illedan & Wildum for the work they put into the contest, and also the testers csj & nmahoude. I really enjoyed the contest despite some evident flaws mentioned by some previous fellow commenters. The most important one being how easy it was to counter any strategy, then optimizing the code to beat certain players and incentivating AI hidding. I submitted my last code on sunday nigth and went to sleep knowing that I couldn't possibly win the contest since any top player submitting after me beat my AI. Away from that, I loved the concept (I never played a moba game before, I even had to look for it in wikipedia), really liked that it's very innovative on the platform, and that you can play it with heuristics and focus on the strategy (I would have liked a more straigthforward referee so that simulations could be more competitive too).
To my strategy:
Hidden hero detection
I save the state of the heros in previous turn to detect if they are hidden in the current turn. If I can't see them and the last location was over a bush, then they are hidden. I didn't implement logic to detect if the hero is dead, so if I kill a hidden hero my AI still thinks there is an alive hero there. This led to wasted fireballs on some cases.
Every time I attack a hero, I set an aggro variable to 3 and treat every rival minion as if he is in aggro mode. So keep out of his range even if one of my minions is closer.
Every turn I compute a safe range for each combination of my heros and rival heros. So each one of my heros should try to avoid being closer than that safe range. This range depends on different kinds of game conditions. For instance, if rival has hulk I want to be outside the charge range. But some hulks are more aggressive than others and if I keep outside this range for the entire game he will outfarm me, so I have a decaying factor to be increasingly closer over time.
We are under attack!
If one of my heros is closer to a rival hero than the safe range, or if a rival hero is too close to my tower, I consider myself under attack and enter the deffensive mode. This is only important against melee strategies or combined, and balancing this in conjunction with the safe range was one of the most decisive part of my strategy since being too conservative led to consistently being outfarmed, and being too aggressive led to consistently being attack-rushed.
When I'm in defensive mode, the hero closer to the rival heros (or the one hurt) tries to go for the bush closest to my tower which isn't occupied by a rival hero. The other hero (if alive) tries to hit the aggresors. This is combined with pulls, blinks, heals and shields to make the deffense more effective. I also compute some possible moves for each hero in different directions to get the position that is more distant to the rival heros. At the end I almost didn't use this, but at some point it did give good results when deffending near my tower.
Minion target assign
I assign target minions to my heros taking into account what @BrunoFelthes mentioned in his post. First I check if each of my heros individually can kill a rival minion in one shot and without moving (before minions attack). Then if no minion was found, I check if I can kill a minion with both attacks combined. Then I do the same considering I moved enough to let the minions perform their attacks. I did no distinction between ranged and melee minions, I just give enough time for them to both attack. I didn't test this at all and farming ended up not being that important in the end, so I don't know if this led to good results.
This was the game changing strategy and I think y_kawano was the one who discovered its power. Until this, my strategy was all about outfarming the opponent. From this point on, most of them ended in hero killing. The strategy is just to use the pull effect on a target, and combine it with an attack by my other hero. This would be followed by an attack by both my heros to the target on the next turn, and powered by attacks by my close minions.
I set Ironman to go for damage items and Doctor Strange for mana and manaregen items. This is to optimize the pull/attack strategy (Ironman have 2 attacks each pull), to maximize shield and to always have mana to pull enemies. I sell items when I can afford a better one with the current gold + sold item gold, or when I need to get a potion.
I use the annoying groot strategy (fireball a groot close to enemy heros). This is even a winning strategy against some AIs that try to kill them instead of running away (Wildum). As groots become increasingly strong if you kill them, they can be preety damaging in the mid to end game.
Thanks again to the creators !