Skip to content

kuanawanda/battlecode-server-1

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Battlecode Server Build Status

Basic Guide to Building

Java 1.8 is required.

  1. ant retrieve - fetches dependencies
  2. ant - will build and compile
  3. ant jar - generates the battlecode jarfile (needed by battlecode-client)

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.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%