[go: up one dir, main page]

ReadMe for Robocode

Updated June 2025 by Flemming N. Larsen

Robocode Home Page

TABLE OF CONTENTS

  1. What is Robocode?
  2. History of Robocode
  3. System Requirements
  4. Getting Started
  5. Robocode API
  6. Robocode Repository
  7. Community
  8. Challenges
  9. Enter the Competition
  10. Command Line
  11. Reporting Issues / Bugs
  12. Feature Requests
  13. News
  14. How to Contribute
  15. Robocode Tank Royale - The Next Evolution

WHAT IS ROBOCODE?

Robocode is a programming game where the goal is to code a robot battle tank to compete against other robots in a battle arena. The name "Robocode" is short for "Robot code." As the player, you are the programmer of the robot and have no direct control during the battle. Instead, you must write the AI that tells your robot how to behave and react to events occurring in the arena. Battles run in real-time and are displayed on-screen.

The motto of Robocode is: Build the best, destroy the rest! 🤖💥

Beyond being a programming game, Robocode is widely used for learning how to program, primarily in Java, though other JVM languages like Kotlin and Scala are also supported. 📚💻

Schools and universities around the world use Robocode as part of their programming curriculum and for studying artificial intelligence (AI). The concept is easy to understand and provides a fun, engaging way to learn programming fundamentals. 🎓🌍

Robocode offers a complete development environment and comes with an installer, a built-in robot editor, and the Eclipse Compiler for Java (ECJ). Robocode only requires that a Java Runtime Environment (JRE) already exists on your system. Everything a Robocode developer (Robocoder) needs to get started is provided with the main distribution file (robocode-xxx-setup.jar). Robocode also supports development using external IDEs such as:

An external IDE provides much better support for developers than the built-in robot editor in Robocode, which is intended only for making quick, small fixes.

Because Robocode runs on the Java platform, it can run on most operating systems that support Java, including Windows, Linux, macOS, and other UNIX variants. Note that Java 8 is the minimum version required, but you can use newer versions for both running Robocode and developing bots. See the System Requirements for more information.

Be aware that many Robocode users (aka Robocoders) find the game not only fun but also highly addictive! 🎮😄

Robocode is provided free of charge and is developed as a leisure project with no commercial involvement. The developers work on Robocode because they enjoy it.

Robocode is an Open Source project, which means all source code is available to everyone.

Robocode is provided under the terms of the EPL (Eclipse Public License).

HISTORY OF ROBOCODE

The Robocode game was originally started by Mathew A. Nelson as a personal project in late 2000. It became a professional endeavor when he brought it to IBM in the form of an AlphaWorks download in July 2001.

IBM recognized Robocode as an opportunity to promote Java programming in a fun and engaging way, which aligned with their goal of promoting the Java platform.

The inspiration for creating Robocode came from Robot Battle, a programming game written by Brad Schick in 1994. Robot Battle was, in turn, inspired by RobotWar, an Apple II+ game from the early 1980s.

Articles from IBM (such as "Rock 'em, Sock 'em Robocode," "Robocode Rumble," and "Secrets from the Robocode Masters") and the community behind the RoboWiki helped make Robocode extremely popular as a programming game. For many years, Robocode has been used for education and research at schools and universities worldwide.

At the beginning of 2005, Mathew convinced IBM to release Robocode as Open Source on SourceForge. At that point, development had somewhat stalled. The community began developing their own versions with bug fixes and new features, such as "Contributions for Open Source Robocode" and later the projects RobocodeNG and Robocode 2006 by Flemming N. Larsen.

Eventually, Flemming took over from Mathew as the administrator and lead developer of the Robocode project at SourceForge in July 2006 to continue development of the original game. The RobocodeNG project was discontinued, and Robocode 2006 was merged into the new official Robocode version 1.1, which contained many improvements. Since then, numerous versions have been released with increasing features and community contributions.

In May 2007, the RoboRumble client was built into Robocode. RoboRumble is widely used by the community to create up-to-date robot ranking lists for 1-vs-1, Melee, Team, and Twin Duel competitions.

In 2012, Julian Kent (known as "Skilgannon") created LiteRumble, a lightweight, easily deployable RoboRumble system designed to run on Google App Engine.

In May 2010, a .NET plugin was provided for Robocode using a .NET/Java bridge, which made it possible to develop robots for the .NET Framework version 3.5 in addition to Java. This feature was provided by Pavel Savara, a major Robocode contributor.

In April 2021, the .NET plugin was discontinued due to serious issues with the .NET Framework and the required toolchain for building both the plugin and its documentation files, making it very difficult to build and maintain.

Note: A new version of Robocode called Robocode Tank Royale now supports C# and multiple other programming languages through a WebSocket-based architecture. See the section below for more details.

SYSTEM REQUIREMENTS

To run Robocode, Java 8 or newer must be installed on your system. Both the Java Runtime Environment (JRE) and the Java Development Kit (JDK) can be used. Note that the JRE does not include the standard Java compiler (javac), which comes with the JDK. However, Robocode includes a built-in compiler, ECJ (Eclipse Compiler for Java), so it is sufficient to run Robocode with only the JRE.

Important: As of version 1.10.0 (June 2025), Robocode has been refactored to support Java 24 and newer versions, even after the retirement of the Security Manager in Java 24. Robocode remains fully functional on older Java versions from Java 8 onward.

Also note that it is important that these environment variables are set up before running Robocode:

You can read more details here:

GETTING STARTED

Most documentation about Robocode is provided through the RoboWiki, which is hosted by Julian Kent ("Skilgannon"). The RoboWiki is an amazing resource for information about Robocode development used by most Robocoders, and it also contains lots of official documentation.

It is recommended to read the articles on the RoboWiki to get started with Robocode. Begin with this article:

Make sure to read about the anatomy of a robot, game physics, scoring, and other fundamental concepts.

If you have questions or need help getting started, the Robocode Google Group is a great place to ask questions and get support from the community.

ROBOCODE API

The Robocode API is provided here:

The Robocode API consists of several components:

ROBOCODE REPOSITORY

If you want to try out new robots beyond the sample robots that come with Robocode, you should visit the LiteRumble home page, which contains a large collection of bots.

COMMUNITY

The Robocode community uses the RoboWiki as its primary communication channel. At the RoboWiki, people share new ideas, code snippets, algorithms, strategies, and much more about Robocode. New official documentation from the developers of Robocode is also published on the RoboWiki.

On the RoboWiki, you can find strategies for:

Code snippets are also available on the RoboWiki:

You can also connect with other Robocoders on:

CHALLENGES

A great way to improve your skills as a robot developer is to try out some real challenges. 🏆 On the RoboWiki, two famous types of challenges exist for testing and studying a robot's movement, targeting, and gun abilities:

Many other challenges are also available on the RoboWiki beyond those listed here.

ENTER THE COMPETITION

If you want to challenge your robot(s) and yourself as a Robocoder, LiteRumble is the best way to do it. 🥊 LiteRumble is the ultimate collaborative effort to maintain a live, up-to-date ranking of Robocode bots.

Don't hesitate to enter the RoboRumble competition! 🚀

COMMAND LINE

It is possible to specify options and predefined properties from the command line when running Robocode. You can list these options by typing the following in a command prompt or shell:

robocode -help

For example, you can:

You can read more details here:

REPORTING ISSUES / BUGS

If you discover an issue with Robocode, you are encouraged to report it as soon as possible. The sooner, the better.

Bug reports should be submitted on the Bugs page on the SourceForge site for Robocode. Each bug report will be prioritized based on its impact on the game.

It will be very helpful if you describe the steps needed to reproduce the issue. You are welcome to provide screenshots, source code, or anything else that will demonstrate the bug. It is also a good idea to include information about which operating system and versions of both Robocode and Java you are using.

If you are a registered user at SourceForge (register here), you will be able to add a "monitor" to your bug report. This way, you will receive notifications when someone adds comments to your report and be able to better track the current status of the bug, such as when it is fixed and in which version of Robocode the fix will be available.

If you are a developer and have a good idea of how the bug can be fixed, you are welcome to provide a pull request on GitHub. By fixing the bug, you will become a contributor to Robocode. You can learn more about how to contribute here. Note that we accept bug fixes under the terms of the EPL.

FEATURE REQUESTS

If you have an idea for a new feature or improvement for Robocode, you are welcome to share your idea by submitting a feature request or starting a discussion on the Robocode Application Developers group.

Feature requests should be submitted on the Feature Requests page on the SourceForge site for Robocode. Each feature request will be prioritized among other requests.

Note that if the feature represents a major change to the game (such as changing robot behavior), it might not be accepted, as Robocode is used for competitions like LiteRumble.

It will be very helpful if you describe your idea in detail and explain how you think it could be implemented in Robocode. For example, would it be possible to extend an existing feature with your idea?

If you are a registered user at SourceForge (register here), you will be able to add a "monitor" to your request. This way, you will receive notifications when someone adds comments to your request and be able to better track its status, such as when the feature has been implemented and in which version of Robocode it will be available.

If you are a developer and have a good idea of how the feature could be implemented, you are welcome to implement it if the feature is accepted. By implementing the feature, you will become a contributor to Robocode. You can learn more about how to contribute here. Note that we accept implementations under the terms of the EPL.

NEWS

News about Robocode is posted on the blog for Robocode. You can subscribe to an RSS feed to receive news about Robocode:

You can also follow Robocode on Facebook:

The RoboWiki can be followed on Twitter as well:

HOW TO CONTRIBUTE

If you want to contribute to Robocode with a new feature or bug fix, you should start by reading the Developers Guide for Building Robocode.

Note that we accept code changes under the terms of the EPL.

There is little documentation about the internals of Robocode, and the codebase will need to be examined as a contributor to gain insight into how Robocode is implemented. This requires a skilled Java developer to understand how Robocode is structured.

Robocode is divided into several modules. You can read Pavel Savara's blog post to get a good overview of Robocode here:

Help for Robocode internals can be provided through the Robocode Application Developers group, where you can register and start a new topic. This is the best way to get information and ask about details regarding Robocode internals.

If a contribution is a relatively small change involving fewer than 10 files, the preferred method is to create a pull request on GitHub.

Your pull request will be reviewed and tested before being accepted and merged into Robocode. Note that additional work might be done by other Robocode developers to finalize the contribution or make adjustments.

ROBOCODE TANK ROYALE - THE NEXT EVOLUTION

Robocode Tank Royale is a new version of Robocode that represents the next evolution of the game. 🎯 It features a completely redesigned architecture based on WebSocket communication, allowing bots to be written in multiple programming languages and to compete over the Internet. 🌐

Key differences from the original Robocode:

Resources for Robocode Tank Royale:

Tank Royale is not backward compatible with the original Robocode, but it offers a more flexible and modern platform for robot development and competition.

Robocode API Bridge: A bridge is currently under development that will enable original Robocode bots to run on the new Robocode Tank Royale platform. This bridge will help preserve existing bots and make it easier to transition to Tank Royale. You can follow the development here: