/RobocodeTemplate

A template to create your first Robocode robot and automate the battles.

Primary LanguageJavaBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

Robocode - Template

This little project can be used as template for your first Robocode robots and automated battles.

For example it should be a good starting point for a tournament in your company...

Development preparations or how to build a new robot

  1. Set the robotlocation property in the pom.xml to your Robocode robots folder
    In a tournament this could be a network fileshare or some other shared location.
  2. Import the Maven project into an IDE of your choice
  3. Change the name of the de.fhdw.FirstRobot Java and properties file to the name of your robot
  4. Set the new classname of your robot in the properties file
  5. Implement a superior robot
  6. Build the robot jar with the Maven command mvn clean install

The name of the output file/jar is generated using the user.name Maven variable. You could also set your own artifact name just make sure it is a unique name.

Battle preparations or how to start a war

  1. Make sure the robots are deployed into your Robocode robots folder
    If you use a network fileshare to exchange the robots you could create a link to that folder
  2. Copy misc/battles.battle into your Robocode battles folder
  3. Add the classnames of the participating robots to the selectedRobots property in the battle file
  4. Run the following command in your Robocode folder java -Xmx1024M -cp libs/robocode.jar robocode.Robocode -battle battles\battles.battle -results results.txt
  5. Watch the fight!

Documentation and other links