Exploring Data From Battlesnake Tournament Games

Daniel Steuernol
Battlesnake
Published in
4 min readMar 21, 2019

On March 2nd, 2019 the 5th Annual Battlesnake tournament was held in Victoria BC. Battlesnake is a programming competition where developers build a web server to play the game snake against other teams. During the tournament we run a series of games involving 6–8 snakes in each game, and narrow down the top 6 snakes. Every year we are amazed at the depth of technology and strategy used to compete in this deceptively simple game.

Our team thought it would be interesting to look at various stats across all games run during this year’s tournament. This year there were three divisions, Beginner, Intermediate, and Expert. Participating teams can self-select their division, and there were substantially larger prizes for those competing in the more advanced divisions.

Tournament Breakdown

During the entire tournament there were 189 games played across the 3 divisions. The tournament operated as follows:

Group Stages of 6–8 Snakes

We took all the teams that registered in each division and divided them into groups of 6–8 snakes. Each group played two games, and the winner from each game moved on to the next round (with the winner of the first game removed from the second game).

Final 6 Snakes

The group stages repeated until we got down to only 6 snakes. At this stage we played 3 games, with the winner of each game moving on to the Final 3. Remaining snakes all tied for 4th place and received equal prizes.

The Final 3

This stage played two games to determine the Final 2, with the remaining snake winning 3rd place.

Head to Head Final

One final head-to-head game to determine the winner of the tournament!

Food Available Per Turn

The current food spawn algorithm uses a geometric series to determine the chance of food spawning on any given turn. This chance starts at 0.5% and will hit 100% at a configured value, which was set to 12 for the tournament games. This means on average food will spawn every 7–9 turns, and at maximum every 12 turns. The number of food that spawns is equal to the number of snakes still alive on the board divided by 2, rounded up. Let’s take a look at how much food was on the board during a given turn.

Something that jumps out in the beginner bracket is that most games had very little food on board. This could be because eating food is often one of the first strategies new participants implement. As teams evolve their snake other strategies start to emerge that involve being more selective about food.

Length of Winning Snakes

Let’s take a look at the length of snakes that won games.

We can see a big difference between the divisions. In the beginner division the majority of winning snakes were the shortest lengths, but in both the intermediate and expert divisions, all the winning snakes were longer, with 1 exception. The exception is actually the winner of the expert division, “Undefined Behaviour”, who made a very conscious decision to avoid food and remain smaller. View the exciting expert division final here!

Cause of Snake Deaths

Finally let’s take a look at the different causes of snake deaths.

We actually don’t want to see a lot of starvation deaths as we feel snake starvation is a boring (and can be a random) way to lose the game. Looking at this chart we see that only 2.16% of snake deaths were due to starvation — great. The number of head collisions (snakes taking out other snakes) is an interesting point here. Close to 50% of all deaths were due to being eaten by other snakes. This ties into the length of winning snakes, as a good winning strategy is to target the heads of other snakes if you are larger.

Conclusion

As Battlesnake grows and more developers participate worldwide, we’re super excited to continue digging into stats to see what inventive strategies evolve over time and to learn the impact of specific rules and game mechanics.

If you’d like to try building your own snake and participating in the next tournament, head on over to play.battlesnake.io to get started.

--

--