cwgreene / battlecode-server

Official Battlecode game engine.

Home Page:http://www.battlecode.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Battlecode Server Build Status

Basic Guide to the Codebase

Inside src/main/battlecode you'll find all the important code for the engine:

  • common: the simple classes available to all competitors, such as Direction, Team, and RobotController.
  • world: the folder that contains most of the gameplay implementation. Here are the most important files:
    • GameMap: information about the game's map.
    • GameWorld: holds the map as well as all the robots on the map, and information about teams (such as team score). The core gameplay code (processing events by visiting signals and keeping track of global team stats) is here.
    • InternalRobot: the class that describes a single Robot and its properties (health, delays, location, etc.).
    • RobotControllerImpl: this implements RobotController. If you're wondering what happens when you call a RobotController. method, check the method's implementation here. RobotControllerImpl interacts heavily with GameWorld.
    • XMLMapHandler: reads the map from the XML file.
  • world/signal: the Signals are objects that hold information about events in a game of Battlecode. These are serialized and then transferred to the client, which processes these events and performs the necessary updates.
  • analysis: deprecated code that would be cool to bring back.
  • doc: tells Javadocs how to create the documentation. RobotDoc is pretty important.
  • instrumenter: handles instrumenting player code so that it is isolated, deterministic, and counts bytecodes.
    • instrumenter/bytecode: the actual bytecode-modification code.
    • instrumenter/inject: classes we replace various parts of java.lang with. Also contains RobotMonitor, which counts bytecodes.
  • server: contains the main class that starts up the engine.
  • serial: contains some information that gets sent to the client as part of every match, such as who won.

Tests

Tests can be run locally with "ant test", and are also run continuous-integration style on CircleCI.

About

Official Battlecode game engine.

http://www.battlecode.org/

License:GNU General Public License v3.0


Languages

Language:Java 100.0%