Installing and running Robocode
Introduction
This guide describes how to install and run Robocode Tank Royale.
Java 11 or newer
Robocode is running on a Java Runtime Environment (JRE) and needs Java 11 as a minimum. If you want to develop bots for Robocode in the Java programming language, then you need a JDK (Java Development Kit).
Note that you do not need to run version 11 of Java specifically to run the GUI, booter, server, or your Java/JVM-based bot. I encourage you to run the newest Java version. But you cannot use Java versions older than version 11.
Numerous Java distributions are available:
If you do not have java installed already (can be checked writing the command below), you should download and install Java first. Follow the installation instructions carefully, and make sure that you are able to run java
from the command line by writing:
java -version
This is a check that Java has been installed correctly and is available. Entering java -version
should write the version of the Java that is being used along with the vendor of the java distribution.
Running the Robocode GUI
Robocode has a GUI application that can be used for running and viewing battles on your local machine. You should use this application for observing how your bot(s) perform in the battle arena against other bots.
You can download the application from the Robocode releases.
You need the file named robocode-tankroyale-gui-x.y.z.jar
, where x.y.z is the specific version number of Robocode, e.g. version 0.14.1.
You might be able to simply start the application by (double)clicking it, depending on the OS and Java version you have. If you cannot start the Robocode application by clicking it, you should start it from the command line like this. You need to stand in the directory containing the .jar file of course.
java -jar robocode-tankroyale-gui-x.y.z.jar
I recommend that you create a directory for Tank Royale, and create a script file for starting up the GUI using the command line above.
The GUI application will automatically create and store .properties
files beside your robocode-tankroyale-gui-x.y.z.jar
file when running the application.
Sample bots
Next, you'll need to provide some bots for the game in order to start up bots that can battle against each other. For this purpose, the sample bots provided for Robocode come in handy. So you could download a zip archive from the Robocode releases, e.g. sample bots for Java that will run when Java has already been installed on your system.
So download and extract the sample-bots-java-x.y.z.zip
archive to a directory somewhere, and note the file path of the directory where all the sample bot directories are located.
Set up bot directories
Next, you should start up the Robocode application and select Config -> Bot Root Directories from the menu, and then add the directory to where you installed the sample bots.
The sample bots should show up under the Bot Directories when selecting Battle -> Start Battle from the menu. If not, you might have a misconfiguration with the root bot directory.
Installing sound files
Note: Installing the sound files is optional, but are provided if you want to add sounds to the game. 🙂
You download the sounds.zip
archive from the sounds releases, e.g. sounds.zip 1.0.0.
Unpack the sounds
directory from the zip archive, and copy the sounds
directory into the directory containing your robocode-tankroyale-gui-x.y.z.jar
file so that the sounds
directory is located next to the jar file for the GUI like this:
[your tank royale directory]
├── robocode-tankroyale-gui-x.y.z.jar
└── sounds/ <-- this directory
├── bots_collision.wav
├── bullet_hit.wav
...
└── wall_collision.wav
The sounds are automatically enabled, and you can enable/disable all sounds and the individual sound from the Sound Options in the GUI application.
Using your own sound files
If you want you replace one or more sounds, you can do this by simple overwriting the sound files with other WAV files as long as you stick to the existing file names. Also note that only WAV files are supported.