BlitzProg - 490th
Quite possibly the most try-hard I’ve been in all of the contests I’ve been participating in - ever. We’re talking about 50-60 hours of the most inefficient and frustrating coding I’ve ever packed in a week. My immediate feeling is something of being completely and utterly deflated… Which is pretty sad because the overall concept was interesting and the game assets were really cute.
Wood 2 to Bottom Bronze: Complete my trees, easy enough!
Bottom Bronze to Gold: Some testing heuristics with a lot of if/else, and a lot of programming errors resulting in my AI performing much better than it should. In a blink, I was in the top 50. The above took some hours of coding and was completed during Sunday night.
Gold to Higher up Gold: I’ve made a very late fix (like 30 minutes before the end of the contest) - removing obvious commands such as trying to grow a complete tree by the end of the game, and a less obvious attempt at economy flexing by waiting out before completing trees when the opponent can’t score much any more and I have better economy (for extra sun points) (example : https://www.codingame.com/replay/557478930 )
The current PHP script I use take the set of commands and attribute score to them. Namely, favor seed placement with bonus tiles but apply a large penalty if near a tree I have, and even larger if fully grown. This also helps deciding which tree should be grown or cut first.
Complete, Grow and Seed always are used in this order of priority, the heuristic is here to find which of the same command should be used.
Grow commands are strongly favored the more the tree I’m trying to grow is itself expensive to grow. (I’m trying to describe what one of my glitch actually does here… It was supposed to favor cheap GROW commands but I realized much later in the contest this is what it does instead)
Complete commands are simply made whenever I exceed a preset cap of tree for a given day, and remove tree with heuristic over shadow and richness to figure which is bet to cut first.
Things I tried:
Improved heuristics, correcting bugs and fixes - Several versions of my PHP code were made, such as move ordering, and avoiding useless grow/complete near the end of a game, but always ending up much worse than the original.
Monte Carlo. Prepared a full SP version of the game for simulation in C++. When the MC part came in, I could not figure any decent heuristic that would get my AI to play anything better than a simple random bot.
Genetic factor search with Brutal tester - Magus wrote a nice java app allowing you to test offline, so I took my original AI and spent a day coding some Genetic approach to tweak my factors over several hours of testing. I eventually gave up because it couldn’t yet again find anything that would score anything better than my original AI.
Monte Carlo Tree Search - This is what gave the most hopes at some point, sometimes scoring in the high 90s with some awkward combinaison of moves. After pruning the move search and improving it, I eventually realized my sim would never be fast enough to stand a chance in the Gold league. After tweaking without many idea of what I was doing, I eventually realized this was probably not going to be of any help.
Opening book - Looking at the best players, which moves were most often performed at the start of the game? I have tried using some opening books for my Heuristic AI, only for it to be squashed by my sunday PHP script that didn’t have any.
My Monte Carlo Tree Search being slow is mostly due to my poor experience in building optimized AI, even though I’ve put some thinking in the simulation.
For example my state was a bitboard made of 5 Uint64 and 8 Uint8, conveniently small for fast copies, but I had a lookup table on the side to find cell neighbors because I didn’t come to my mind it would be possible for the hexagonal field to be processable with bit-shifting. Clearly, after reading a few post-contest strategies, I didn’t think enough.
In the end, I scrapped up everything and just sent over my Original AI in hope to reclaim the position it first had, before I fixed its flaws and sent the new one over. Hence my very late push.
Perhaps this is a sign I am meant to stay in the gold league and have reached my limit, and cannot perform any better?
Thanks for the contest and congratulation to everyone, some AI are really outstanding! Looking forward reading the post mortem of other players!