CodeBuster - Feedback & Strategy

I finished 13th and here is my strategy.

I select each buster’s move according to the following priority list:

  • If in stun range with the cooldown available, stun, while making sure no other buster has planned a stun on that target.
  • If carrying a ghost, go home in a straight line.
  • If I know of an enemy carrying a ghost, intercept his straight line trajectory home if you can and if one of my busters will be able to intercept and stun before the enemy reaches home.
  • Go bust a ghost according to the following eval: -endurance-dist/800-5e-3*distToCenter, the third term encourages getting the most often contested middle ghosts first
  • Explore fog by going towards an unexplored point according to the following eval: distToOtherBusters+distToWalls-distanceToUnexploredPoint-1e-3*distToCenter. When looking at distance to walls and busters be careful to take min(dist,2200). A distance larger than the line of sight is not useful.

Exploration map is stored as a boolean array representing 50x50 squares in the map.

I store ghosts I have seen in the past and delete them from the array if I don’t see them at their last known position. For this to work well it was important to model ghost movements otherwise I would get their position wrong and wrongfully delete them from the array, potentially losing knowledge of a nice 3HP ghost. So at the end of every turn I simulate ghost movements.

I also store enemy busters carrying a ghost and model their movement as a straight line to their base. I delete enemy busters not carrying a ghost from my array if they are not in sight, I can’t model their behavior and having wrong buster positions causes wrong ghost movements.

At the beginning of a game I do not bust any ghosts until I have seen ghost 0, the one in the middle. This takes ~7 turns and has the effect of me contesting the middle ghosts and getting the ghosts close to my base later. It also allows me to see and store alot of ghosts so my busters can choose lower HP ghosts instead of going for the first 40HP ghost they see.

The day I implemented the interception of enemy busters carrying a ghost I went from ~120 to ~20. I have two remarks about this:

  • Stealing a ghost not only give you a +1 score but it gives a -1 to the enemy. It is one of the best things you can do.
  • Doing this counters campers as they will have to walk from your base to their base, which takes ~23 turns. In that time, revenge shall be sweet, and they will have wasted all their time camping at your base instead of getting ghosts.

I feel like the main weakness of my AI was that it had no smarts whatsoever in contesting ghosts, so against the other AIs at the top of legend it would often lose the busting duels. At the top some players would bait out early stuns and stun at the right time to get the ghost, this easily makes the difference between victory and defeat. As I said earlier stealing a ghost is twice as interesting as getting one.

Feedback

  • The graphics were probably the best ever on CG.
  • I kind of like the game but its complexity, for a programming game, causes a high barrier to entry where it takes maybe a few hours to get out of wood league. I think this is the cause of the “low” population on this contest, 2000 vs 2500 in the previous one.
  • This complexity also has the effect of forcing people to rely heavily on heuristics. Now some people don’t like games like Smash The Code because they rely heavily on bruteforce search, describing them as “just bruteforce”. However, is it very much better to have an AI which is “just ifs”? This is a programming website after all, it is nicer to learn about Simulated Annealing than if statements.

Congrats on another nice contest and see you at the next one.

15 Likes