King of the Hill: Robot Battle
ProtectiveBot

A bunch of ideas rolled together to form something. There are a number of states that it can enter. Firstly, if there is no-one around them, it will build itself a cocoon which is just about indestructible, and sit in it for a while, killing anyone it can.

If there is someone close during startup, there is less then 200 turns left, or there is only one enemy bot remaining, the bot will enter a aggressive mode, which is essentially an enhanced pathfinder, attempting to trick its opponents. This mode uses a flood style pathfinding system at close range, and the same technique in the provided pathfinding example at long range.

If there are multiple instances of this bot in game, the bots will refrain from killing each other until the end.

Its big as well, weighing in at 527 741 lines. Compiling against Java 8. Also, have a graphic renderer of the battle system: https://github.com/j-selby/RobotBattleController


  I've reached the limit for how big these posts can be, see bot src at
  https://github.com/j-selby/RobotBattleController/blob/master/src/main/java/ProtectiveBot.java.
  Sorry...


Rev 3:


Threaded pathfinding. No more timeouts!
Detection of stalemates. TODO: Do something about them.
Full A* pathfinding. No more dumb stuff.
Checks OTHER bots positions for unfair play (trapping themselves in completely).


Rev 2:


Stopped bot being killed at corners
Smarter building logic
Will never do any move that could endanger us, excluding against other instances of ProtectiveBot.