This page will explain how to use the Robot Console for your robot.
The Robot Console
The Robot Console is a window that first and foremost contains information dedicated to an individual robot. The information is printed out by the robot itself or from the Robocode game. Information is printed out by the robot using e.g.
out.println(), and similar.
But information can also be printed out from the game about events that involves the robot. Such information will be prefixed with "System:", so you know that the information comes from the game itself. NOTE: If exceptions occur in a robot that is not catched/handled inside the robot, the game will catch the exception of the robot and dump the stack trace of the exception to the console. This is done to notify the developer of the robot that something went wrong inside the robot, but also where in robot it went wrong (can be seen using the stack trace).
Thus, if your robot does not behave as you expect, it might be a very good idea to open the console window for your robot and see if the robot is causing an exception, is skipping turns, or something else.
How to open the Console Window
So, when you want to read the output for your robot, you just have to open the console window of your robot. NOTE: In order to be able to open a console window of a robot, the robot must first be added to the current battle as participant.
The console window of a robot is opened by clicking on the button on the right side of the battle view, which contains the name of the robot you want to open the console window for:
Usage of the Console Window
When you have clicked on the button for the robot, the following console window will pop up:
As you can see on the image above, the Robot Console window contains some buttons, which are described here:
|OK||Closes the window|
|Clear||Clears all the text printed in the console|
|Kill Robot||Kills the robot|
|Paint|| Enables/disables painting the robot (using the |
|Robocode SG||Enables/disables compability mode with a robot coded for Robocode SG|
|Pause/Debug||Pauses/resumes the game. The pause mode can be used when debugging|
- System Requirements for Robocode
- How to download and install Robocode
- The anatomy of a robot
- Getting started with Robocode
- My First Robot Tutorial
- Robocode Game Physics
- Scoring in Robocode
- Downloading other robots
- Learning from other robots
- Package your robot
- Frequently Asked Questions (FAQ)
- Articles about Robocode
- Starting Robocode from the command line
- Graphical debugging
- Using Eclipse as IDE
- Creating a project for your robots
- Creating a robot in Eclipse
- Running your robot from Eclipse
- Debugging your robot with Eclipse