Halite is an artificial intelligence challenge that players from all around the world can compete in. There have currently been a total of 3 different games and I’ve participated in 2 of those, although my first one was the most dedicated one. In this particular game, the goal was to capture tiles on a grid and destroy the enemy colors. You can read more about Halite here, more about this game here and view my profile here.

I’m blue in this replay. The tile size is its strength and the background intensity is it’s production value.

My approach was to create a “grid of influence” that would calculate how desirable each tile was for any given tile I owned. The lower the value the more desirable. The most important points of consideration were:

  • Is the tile owned by someone?
  • What is the strength of the tile?
  • What is the production value of the tile?
  • How far away is the tile from my current tile?
  • What is the difference in strength between me and an enemy?
  • Are there any vulnerable spots in the opponents defense?

How these points were combined was constantly changed through many iterations to see what worked best. For example: to decide what neutral tiles to capture, per tile I would divide its strength by it’s production value. Then I would consider an area around that tile based on it’s production and take an average. This would give me areas of high production values, seen as green in the image below. Because of this my bot would move considerably fast towards these areas and expand. If you look at the GIF above, there is an area of tiles with relatively white backgrounds in the bottom center.

Example of the influence grid at the start of a game. X marks my starting location.
  • Language used C#