Skip to content

0.30.0

Latest
Compare
Choose a tag to compare
@flemming-n-larsen flemming-n-larsen released this 07 Feb 18:52
· 53 commits to main since this release

πŸ“¦ 0.30.0 - Added Graphics Debugging

πŸš€ #116: Graphical Debugging Implemented Using SVG

Graphical debugging, known from the original game, has been implemented using SVG with the [JSVG] library. This allows you to paint graphics objects on the battlefield while the game is running, making it easier to visualize elements such as estimated target positions. This feature is available for both the Java API and .Net API.

Java API

  • Use the new getGraphics() method to return a java.awt.Graphics2D object for painting objects.
  • Thanks to Tobias Zimmermann for bringing this feature to the Bot Java API, for suggesting the use of SVG and [JSVG], and also adding transform-box to JSVG to mirror texts. ❀️
  • Thanks also to Jannis Weis for providing [JSVG] and helping fix an issue with using the correct libraries for JSVG. Make sure to buy him a coffee. 😊

.Net API

  • Get a SvnNet.SvgGraphics context for painting by using the Graphics getter.
  • The .Net API uses the SvgNet library. The SvgGraphics is context used similarly to System.Drawing.Graphics.

⚠️ Graphical Debugging must be enabled before anything is rendered to the battlefield.

Enabling Graphical Debugging

Graphical debugging can be enabled from the Properties pane of the bot console by toggling the Toggle Graphical Debugging button. Graphical debugging is not enabled per default, and must be applied to individual bots.

Sample Bots

A new sample bot, PaintingBot, has been introduced to showcase the use of debug painting in both Java and C#.

Schema changes

  • A new debugGraphics (string) field has been added to the bot-intent schema. This field allows you to provide SVG content as a string, which will be rendered if debugging graphics is enabled. Note that not all SVG functionality is supported by JSVG used for rendering SVG onm the battlefield.

  • A new isDebuggingEnabled (boolean) field has been added to the bot-state schema. This field specifies whether the debugging graphics feature is enabled for the bot. The debugGraphics field will only be used if isDebuggingEnabled is set to true.

🐞 Bug Fixes

  • Server:
    • Log messages printed out {} instead of content.
  • UI:
    • Fixed issue with the switch button in the Server Options for switching between using a local and remote server.

πŸ“„ Documentation

You find the Robocode Tank Royale documentation here. You should start out by reading Getting Started first.

πŸ”¨ Try it out

Please head over to My First Bot tutorial to learn how to set up your first bot for Robocode Tank Royale.

πŸ›  Installing Robocode

You need Java 11 as a minimum or newer, e.g. the newest version of Java available.

You can read the installation guide to get more details about installing both Java and Robocode.

β–Ά Running Robocode

The main application is the GUI Application which is a Java application. You can read about how to use the GUI Application here.

The Robocode GUI application is run from the command line (shell or command prompt) in order to start and view
battles:

java -jar robocode-tankroyale-gui-0.30.0.jar

πŸ€– Sample bots

If you are new to Robocode, you need to download some bots and extract those to directories on your system.
These bot directories can be added from the menu of the GUI: Config β†’ Bot Root Directories

These sample bots are currently available:

Platform Archive Requirements
C# sample-bots-csharp-0.30.0.zip Microsoft .Net SDK 6.0 or newer
Java sample-bots-java-0.30.0.zip Any Java SDK 11 or newer

All bots are put in zip archives, which should be installed in independent directories.
Each zip archive contains a ReadMe.md file with more information for the specific platform.

πŸ“¦ Bot API

In order to start developing bots for Robocode, the following APIs are available.

πŸ“¦ Java:

Available as:

πŸ“¦ .Net:

Available as: