VbRoboCode: Physics
The physics for VbRoboCode are lifted directly from the original Robocode physics. In VbRoboCode, many parts of the physics are configurable thru the VbRoboCode project settings, but if you are competing against other players, you’ll probably want to leave them alone.
Most values in VbRoboCode are calculated in floating point single precision.
For purposes of detecting collisions, a robot is a circle with a radius of 20 pixels. Note that this has nothing to do with how the robot is painted on the screen.
Robots are placed into the arena in a random unoccupied location, with their chassis, radar, and gun pointing in independent random directions. Robots start a battle with their energy level at 100 and gun heat set at 3.
Bullets can be fired at any power > 0 and <= 10. The robot’s energy is reduced by the amount of firepower; when a robot’s energy reaches zero it dies. The pixels per step a bullet travels at is 20 - (3 * firepower), but no slower than 1. Bullets cause firepower * 4 damage to any robot it collides with. If the firepower is > 1, there is a 2 * (firepower - 1) damage bonus. When a bullet collides with a robot, 3 * firepower is added back to the firing robot’s energy level.
Robots cannot fire their gun until the gun heat reaches zero. When a bullet is fired, the gun heats up by 1 + (firepower / 5). The guns cool at a rate of 0.1 per step.
Robots accelerate at a rate of 1 pixel per step, up to a max of 8. They decelerate at 2 pixels per step.
Guns turn at a rate of 20 degrees per step. Radars turn 45 degrees per step. Robots turn a maximum of 10 - (speed * 0.75) degrees per step.
If a robot hits a wall, its energy is reduced by 0.5 * speed - 1, but not less than zero. If two robots collide, they each have their energy reduced by 0.6.






