I am very interested in artificial intelligence and machine learning. That’s why I joined the Halite Challenge. It was about developing a smart swarming intelligence. Many approaches have been found in the challenge. Also particularly interesting ones like Youtuber Sentdex’s solution (Machine Learning). My approach was classic, with heuristics and the so-called Boids algorithm.
What is Halite?
Halite is a programming challenge in designing a swarming intelligence. The gameplay is simple: two to four players start on a two-dimensional surface in different corners of the board. Each player starts with three ships of his color. These ships now have to fly to and dock on planets. Once a ship is docked on a planet, this planet produces ships of its own color, depending on the resources available. Crucial to the lucrativeness of a planet is also its size, the larger the planet, the more ships can dock and the more ships are produced. So the ship takes possession of the planet, much like a virus takes its host cell. The resulting ships can now go to other planets and populate them. If some ships have been produced, but instead of colonizing a new planet, they can attack other spaceships by flying nearby. The goal is simply to be the last living player, no matter how many ships or conquered planets. It is important that a victory before the time limit of 3 minutes is reached, otherwise the game is canceled. If the winner is determined, he gets points and rises in the global ranking. Thousands of programmers compete with each other, including experienced software engineers and students of all kinds, like me. The simplicity and complexity of the game convinced me why I participated in the last Halite Challenge.
Each player gets a simple starter algorithm at the beginning, which he can improve with the appropriate tactics.
Halite has many valuable tactics, some of which I think are superior. For example, my ships only strive for planets as long as their capacity is not exhausted. If no closer planet is available, my ships start attacking the enemy. Also the takeover of a hostile planet is possible, for example by the destruction of the there docked enemy ships.
Craig Reynolds Boids algorithm
During my research, I found a (somewhat older but still up to date) algorithm by Craig Reynolds. Reynolds had some time ago studied the behavior of birds in swarms and tried to replicate it in the form of an algorithm. The resulting algorithm worked impressively well and was barely in the wake of the real-life model. The operation of the algorithm is also quite easy to explain:
This article is still unfinished. An extension of this article may occur occasionally, or not. If you are interested in the continuation of this article, drop me a line via email@example.com!