Energy Drop

From Robowiki
(Redirected from Energy drop)
Jump to navigation Jump to search

A decrease of energy observed in another robot. Because Robocode robots cannot see mid-air bullets, the only way to detect that a bullet was fired is by noticing a change in the opponent's energy level.

How it works

The following events impact a robot's energy level between scans:

  1. Getting hit by a bullet
  2. Hitting another bot with a bullet
  3. Running into another robot
  4. Running into a wall
  5. Firing a bullet
  6. Inactivity energy drop

In a duel, bullet damage (#1), life gained (#2), and robot collisions (#3) can be fully accounted for - i.e., you are made aware of them through other events before onScannedRobot . Another bot running into a wall (#4) can only be approximated: he can change speed, hit the wall, receive damage based on speed, and come to a stop, without his opponent ever knowing what speed he used. This is largely moot, though, since such wall collisions are rare and gun heat tracking can often prove that no bullet was fired.

Since it is possible to account for nearly every other energy-changing event happening to your opponent, any remaining energy drop is the firepower of a bullet that he fired.

See also