Hi,
17t Legend
I spent half of the contest hesitating between a pure simulation solution and a heuristic one (with a little simulation in micro-situations).
For both solutions, I needed the engine, so I started with this. Took me 2 days to write an bugged engine. After the initial draft, I spent a few days trying to figure out why the engine was slow and innacurate.
Pro-tip : re-read carrefuly the referee code when translating, and OVERTEST your engine in every possible corner case. Long story short, I lost shitloads of time with hidden bugs (the referee helped, as you can now run a local game with breakpoints in both your own code and the referee, and compare simulation steps on both sides to spot deltas).
Meanwhile, I was still hesitating between the two types of solutions and spent some time on both, in parallel; perfect time-wasting strategy.
The information given by the referee was once more incomplete, but it was pretty easy to guess enemy gold/income (assuming a queen standing still next to a mine is upgrading it).
Friday I finnally managed to fix most of my bugs and started focusing on a genetic algorithm, dismissing the heuristic version of my AI.
My evaluation function is rather classic :
- Big bonus for health (overrides everything else)
- Malus for destructed buildings (exemple : I build a mine over a tower)
- Malus for each enemy knightās health and squared distance to my queen
- Gold income difference
- Small malus for distance to the closest available site
- Defense score (struggled with this one, and the result sucked) :
defScore = (MIN(enKnights, 6) * (myTurretNumber * 4 + turrSize * 0.01));
- enKnights = the number of enemy knights (those on the maps, those who are being produced, and 3 virtual knights for every 80 golds the enemy has)
- myTurretNumber = sum(turrets) { 1.0 + (turret.distToMyCorner / 2800.0) } (I tried to favor turrets that are closer to the enemy corner, thus further away from my own corner)
-
turrSize = sum of turrets radiuses
Itās linear and it doesnāt have the notion of ātoo much defenseā. In lots of scenarios, my AI will build only towers. I tried to use log() and shit to make my AI stop doing that, without success.
It also lacks a position component; for both the turretsā positions on the map, and my queenās position regarding the turrets. Often, my AI is making a pretty tower maze, then goes in the corner to make another one and gets stuck in there, trying to avoid incoming waves of knights, not taking advantage of the previously mentioned maze.
I added a position score (mean of distances between my queen and my turrets), that didnāt work very well.
I also wanted to add something that says āyou will lose some life, but in the long run thatās okā, but didnāt succeed.
Like in lots of other contests, my evaluation is poorly-balanced and lacks tons of stuff, but thatās the best I could come up with in 10 days.
On the game itself, it is quite unbalanced but very interesting nonetheless; simple inputs/outputs, easy naive solutions but enough depth to really scratch your head. Congratz CC team.
Alos, kudos to CG for introducing swapped matches in the rerun.
Neumann