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...
- Set the
robotlocation
property in thepom.xml
to your Robocode robots folder
In a tournament this could be a network fileshare or some other shared location. - Import the Maven project into an IDE of your choice
- Change the name of the
de.fhdw.FirstRobot
Java and properties file to the name of your robot - Set the new classname of your robot in the properties file
- Implement a superior robot
- 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.
- 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 - Copy
misc/battles.battle
into your Robocode battles folder - Add the classnames of the participating robots to the
selectedRobots
property in the battle file - Run the following command in your Robocode folder
java -Xmx1024M -cp libs/robocode.jar robocode.Robocode -battle battles\battles.battle -results results.txt
- Watch the fight!