Battle Bot Bonanza
© 2002-2004 by Luke Ehresman

Game Rules:

Table of Contents
  • Introduction and Overview
  • Rules of the Game
  • Components
  • The Arena
  • Actions
  • Bonus Boxes
  • Damage Dice
1. Introduction and Overview

Welcome to the BattleBot Bonanza programming contest. In this document you will find the rules for the game and explanations of how the game works. This document is intentionally vague on implementation details. Please refer to the online reference documentation for detailed API specifications. If after reading this document, you are still unclear on some aspect of the game, please feel free to contact me (

This contest is a bit different than typical ACM programming contests. In those, contestants are judged on their coding speed and quick comprehension of complex algorithms. In this contest, rather than having a set of problems to solve, each team will be working together to design and create an artificial intelligence that will control a bot during a simulated battle. The intended purpose is to test your ability to design and create under reasonable time constraints. At the end of the allotted programming time, all of the bots will be thrown into an arena and will fight it out to see who is the smartest bot. Whoever is left standing at the end of the game will be the winner.

The game is played in a turn-based environment. This means that during each round, you have a chance to execute one action. Every other bot can also execute one action. In this way, during each round, each bot gets to execute a single action. Actions are described in greater detail in section 5, but in general there are four actions: generate, buy, move, and attack. It is your task to intelligently execute these actions at the appropriate time in order to stay alive.

2. Rules of the Game

This version of the game (v2.0) is a complete rewrite from the original version. As such, several fundamental rules have changed. If you are familiar with the first version, you should still read through this document to understand the changes that have taken place. This section describes in an, overview fashion, the way the game is played.

The game is played in rounds. During each round, every bot that is alive will get to issue an action when it is their turn. You can only issue one action during each turn. Since there are four actions (move, attack, generate, buy), you must design your bot to be intelligent enough to know which action to execute at any point during the game, taking into account your surroundings and past actions. For instance, if another bot attacked you during the last round, you might want to retaliate and attack him back. But if your health and shields are low, you will probably want to run away.

Bots start off with 100 power, but each action will drain the power. In order to get the power level back up, you must issue the generate action. This is very inconvenient, especially if you are in the middle of a battle, or if you are trying to run away because it allows your opponent to get an extra action in when you must just sit there and generate. Having a good generation strategy is something that you might want to consider when building your bot. Here is a list of how much power each action takes:

Buy 2
Attack 8
Move (Mountains) 20
Move (Swamp) 16
Move (Hills) 12
Move (Forest) 8
Move (Grass) 4
Move (Store) 2
Generate (creates power)

The fitness of a bot is measured by its health and shields. You can have a maximum of 100 health and 100 shields. Health is the actual health status of the bot, and when this reaches zero, the bot is completely destroyed and eliminated from the game. Since health points cannot be replenished during the game (except through bonus boxes), there needs to be something that can help protect the precious health. This is where shields come in. Shields work essentially the same as health when it comes to defending, but the difference is that shields can be replenished by purchasing more of them at a store. When an attack occurs against your bot, shield points will be taken away first before the health is touched. When no shield points are left, then the health points will be taken until your bot's health is zero.

At the end of the programming time, we will all get together and watch the bots fight. Each battle will only last a certain number of rounds, so there are two ways of winning. The most obvious is by destroying all the other bots and being the last one standing. The other way of winning is to have the most points after the last round has been played. Points are interesting because in order to purchase new components, you must spend your points.

When an attack occurs, there are two parties involved: the attacker and the defender. The damage dice (see section 7) for the attacker's weapon are rolled to get the damage that is issued. The dice for the defender's armor are also rolled to see how much of the attack was deflected. These values are subtracted from each other to calculate the actual amount of damage that was incurred upon the defender. (note: if the defender's dice roll higher than the attacker's dice, 0 damage is dealt, not a negative number)

Here are a couple examples:

Bot1 (3d4 weapon) attacks Bot2 (2d2 armor)
Bot1 attacks with 9 damage
Bot2 defends 3 of those damage points
The actual damage incurred is 6

Bot1 (3d4 weapon) attacks Bot2 (2d2 armor)
Bot1 attacks with 7 damage
Bot2 defends 2 of those damage points
The actual damage incurred is 5

Bot2 (2d3 weapon) attacks Bot1 (4d4 armor)
Bot2 attacks with 5 damage
Bot1 defends with a roll of 9, but only 5 damage points are deflected
The actual damage incurred is 0.

3. Components

Each bot is outfitted with four components: generator, weapon, armor, and vision. Each component gives a different benefit, and they can all be upgraded by purchasing them when you are standing on top of a store. This section gives a summary of the different components. It is important to have a good purchasing strategy because having better components for your bot can give you a large advantage over all the other bots. Likewise, falling behind and not upgrading your components during the game can be fatal.


A generator is used to create more power for your bot. However, in order to use a generator you must issue the 'generate' action. A better generator will create more power during one 'generate' action. Thus, having the best generator will make it so you do not have to waste turns generating as often.


This component is what is used to calculate the damage when attacking an opponent. The damage is calculated based on the damage dice of the weapon. For information on damage dice, please read section 7.


Armor will protect your bot against attacks from other bots. The strength of the armor is also based upon the concept of damage dice. For more information on damage dice, please read through section 7.


Your bot knows the terrain of the entire board, but it can only see other bots that are within its vision radius. A better vision component will have a higher vision radius and will let you see more of the bots around you. In previous versions of this game, there was a 'scan' action, but in this version, you always see all the bots that are within your vision radius. No extra actions need to be performed to see them.

4. The Arena

Each game can have a different arena configuration. You will be provided with several different arenas with which to test your bot. You can also easily make your own arenas to test with through the 'bots.conf' file. The arena is composed of a grid of terrain types. Each terrain type has a different cost to move across. For instance, grass is a lot easier to travel across than mountains.

Here is an example arena:


5. Actions

There are four different actions that can be performed during the game. Each will drain your power a certain amount, except of course for the 'generate' action which boosts your energy. Here is a summary of the different actions:


The other three actions take power to perform. Different actions take different amounts of power. Once your power level gets too low, you will need to take a turn and generate. Generating creates more power. The better your generator component, the more power will be created during a generate turn.


Issuing a move command will move you in any one of four directions: north, south, east, and west. It is not possible to move into an area that already occupied by another bot. Movement will consume power differently depending on the terrain type that your bot is moving into. For instance, moving onto a mountain takes more power than moving onto a grassy meadow.


Attacking is one of the most fundamental actions of the game. By attacking other bots, you will be able to gain points and also hopefully conquer the entire board by destroying all the other bots that are playing. To attack, you must be adjacent to the victim, meaning that you must be able to touch the victim in any one of the four directions mentioned earlier in the Move section. When an attack occurs, the server will calculate the damage issued based on the attack strength of the attacker and the defensive strength of the defender.


In order to issue a 'buy' action, your bot must be on top of one of the store terrain types. Buying, like all the other actions, will take power. However, power only deducted for each 'buy' action that was issued. Thus, in the case of shields where you can specify the quantity of shields to purchase, power is only deducted for each 'buy' action, not for the quantity of shields purchased. When purchasing shields, if you cannot afford the amount you specified, the maximum amount you can afford will be purchased.

6. Bonus Boxes

There is always a bonus box located somewhere on the game board. The first bot to move on top of the position of a bonus box will receive that bonus. These are the possible bonuses:

+25 Shields (up to your max shield capacity)
+10 Health (up to your max health capacity)
Upgrade weapon (bumps your weapon up a level)
Upgrade armor (bumps your armor up a level)

There will always be a bonus box. As soon a bot takes a bonus, another one will appear somewhere else on the board. They appear randomly on the board, but they will never appear adjacent to a a bot in order to be more fair.

7. Damage Dice

Many games use the concept of damage dice to calculate the damage of a weapon, or the defense power of a piece of armor. It is essentially a controlled way of generating random damage or defense points. The same concept can apply to both weapons and armor, even though the term is still technically damage dice. This appendix will explain how damage dice work in case you are not familiar with the concept.

Think of rolling damage dice as the input and output of a function. The input is a formula in the form of 4d3 or 1d12, and the output is an integer such as 6 or 12. The output of the function is what is used to calculate damage (i.e. 6 points of damage). Damage dice are read from left to right like this: 4 rolls of a 3-sided die, or 1 roll of a 12-sided die. As this expanded English form hints at, the first number is the number of rolls of the die, and the second number is the number of sides of that die. A 3-sided die will have the numbers {1, 2, 3}, and a 12-sided die will have the numbers {1, 2, 3, ..., 12}.

So a roll of a 4d3 damage dice would look like this:
Randomly choose a number from the set {1, 2, 3} = 2
Randomly choose a number from the set {1, 2, 3} = 1
Randomly choose a number from the set {1, 2, 3} = 2
Randomly choose a number from the set {1, 2, 3} = 3
Total the numbers = 8

From this example, the output of the damage dice function would be 8, and eight points of damage would be issued against the opponent, or 8 points will be deflected in the case of armor.

Having higher first number means the weapon is more consistent. For instance, a damage dice of 6d3 has a minimum hit of 6 (6x1), and a maximum of 18 (6x3). However, if this were changed to a damage dice of 3d6, the minimum is now 3 (3x1), but the maximum is still 18 (3x6). Keep this in mind when considering the price of weapons.