Build the best - destroy the rest!

Friday, 5 November 2010

Robocode 1.7.2.2 (final)

Robocode version 1.7.2.2 (final) has now been released, which only contains an issue with the Robot API documentation.

You can read about the previous bugfixes and changes made for the beta version here:

Bugfix


  • Fixed "3 * PI / 4 means West." in the Robot API, which should be "3 * PI / 2 means West.". Thanks goes to Gottl Johannes for pointing this out.


Download Robocode 1.7.2.2 (final) from here
Download Robocode .NET plug-in 1.7.2.2 from here
Download Robot testing plug-in 1.7.2.2 from here

Saturday, 2 October 2010

Robocode 1.7.2.2 Beta

This is the beta version of Robocode version 1.7.2.2 that now includes a Robocode Control API with the .NET plug-in, which makes it possible to run battles from a .NET application and retrieve the results etc. Help files are included with Robocode, and the documentation of the new API is available here.

Robocode has also been upgraded to use jni4net v0.8.0 that includes CLR 4.0 support for .NET. This means that robots can be written in e.g. the F# language. Actually, the .NET plugin includes sample robot written in F#.

A ReadMe has also been added for Robocode in both HTML and text (using Markdown syntax). The ReadMe should give the reader a good overview of Robocode.

We encourage everybody to test this new Beta version as much as possible and report any bugs found at our Bugs Tracker at SourceForge. Then we will do everything we can to fix issues before the final release of version 1.7.2.2.

In the following we list the bugfixes, new features, and other changes made with the 1.7.2.2 Beta version.

Bugfixes


  • Bug [3043944] - Robot PrintStream doesn't handle write in a portable fashion.

  • Bug [3077562] - Wrong headings with the JuniorRobot. Thanks goes to Mr. Kschan for finding and providing a fix for this bug. :-)

  • Bug [3043884] - Development Options remove wrong item.

  • Bug [3043932] - JavaDoc missing _Robot and similar.


New Sample robots


  • Tuan Anh Nguyen provided a modified version of the Interactive sample robot named Interactive_v2, which use absolute movement (up, left, down, right) on the screen, which can be easier to control than the original Interactive sample robot. Both Interactive robots now use both the arrow keys and the W, A, S, D key for moving the robot.

  • SampleFs (written for .NET with the #F langugage) has been added along with the Visual Studio 2010 project file for it. This is available with the .NET plug-in.


New features


  • Robocode has been upgraded to use jni4net v0.8 with CLR 4.0 support.

  • Implemented Robocode .NET Control API plug-in (robocode.control.dll) with documentation.

  • Req [2932291] - Added ReadMe.txt (using Markdown syntax) and ReadMe.html. The ReadMe is also available from the Help menu.

  • Req [2973605] - Enable/disable development paths.

  • Req [2974806] - Provide JuniorRobot template for inexperienced users.


Changes


  • It is not necessary to specify -Dsun.io.useCanonCaches=false anymore with the startup scripts for Robocode and RoboRumble as Robocode sets this internally when running under Windows. Hence, this property has been removed from all .bat, .sh, and .command files for Robocode.

  • Robocode will not notify about Beta versions anymore per default. However, a new option in the Common Options (under Preferences) makes it possible to enable/disable notifications about new Beta versions.

  • The tabs for the Common and Development Options in the Preferences window are now the first tabs.


Download Robocode 1.7.2.2 Beta from here
Download Robocode .NET plugin 1.7.2.2 Beta from here

Thursday, 5 August 2010

Robocode 1.7.2.1 (final)

Robocode version 1.7.2.1 (final) has now been released, which contains lots of bug fixes compared to the beta, but also a few changes.

You can read about the previous bugfixes and changes made for the beta version here:

In the following, the new bugfixes and changes made since the beta version are listed.

Bugfixes


  • Bug [3021140] - Possible for robot to kill other robot threads.

  • Bug [3029344] - Zipped robots data files are not extracted.

  • Bug [3026855] - Robot Packager doesn't package source file in Eclipse proj.

  • Bug [2828479] - Missed onRobotDeath events. Thanks goes to ForNeVeR for finding and solving this bug.

  • Bug [3019854] - Cannot see robot with no package in New Battle dialog.

  • Bug [3026856] - Robot Packaging Wizard doesn't save value for Next & Back.

  • Bug [3028102] - ClassNotFoundException at RobotClassLoader.java:271.

  • Bug [3032423] - "skipped" turns at start with -Ddebug=true

  • Bug [3032843] - Exclude filters not working.

  • Sometimes the compiler window was hanging for several seconds, even though the compiler had finished compiling.


Changes


  • The Robot Packing Wizard will now only allow word characters (letters, digits, dots, but no spaces) with the version field.

  • Added robocode.annotation.SafeStatic, which can be used to suppress warnings in the robot console for a robot uses static reference to a robot on a field. Note that this means that you need to clean the static field, when a new round is started. This annotation was suggested by Nat Pavasant. The annotation is used like this:


  • @SafeStatic
    private static AdvancedRobot robot;

  • Added syntax highlightning on Java annotations for the Robot Editor.


Download Robocode 1.7.2.1 (final) from here
Download Robocode .NET plug-in 1.7.2.1 from here
Download Robot testing plug-in 1.7.2.1 from here

Saturday, 19 June 2010

Robocode 1.7.2.1 Beta

This is the beta version of Robocode version 1.7.2.1, where the Jikes 1.22 compiler has been replaced with the Eclipse Compiler for Java (ECJ) 3.5.2.

We encourage everybody to test this new Beta version as much as possible and report any bugs found at our Bugs Tracker at SourceForge. Then we will do everything we can to fix issues before the final release of version 1.7.2.1.

In the following we list the new bugfixes and changes made with the 1.7.2.1 Beta version.

Bugfixes


  • Bug [2867326] - Lockup on start if too many bots in robots dir (cont'd).

  • Fixed some issues with the robot repository when file URLs contains spaces, where robots were sometimes disappearing from the repository.


Changes


  • Req [2815450] - Move away from Jikes towards ECJ. Jikes 1.22 has been replaced with the Eclipse Compiler for Java (ECJ) 3.5.2.


Download Robocode 1.7.2.1 Beta from here
Download Robocode .NET plugin 1.7.2.1 Beta from here

Friday, 28 May 2010

Robocode 1.7.2.0 (final)

The final version of Robocode version 1.7.2.0 has finally been released. As usual, lots of bugs have been found and fixed.

If you are new to Robocode 1.7.2.0 then please note that this version is the first version of Robocode that supports robots written for .NET. With the .NET plugin for Robocode, Java and .NET robots can participate in the same battles in the same time.

You can read our two first articles on the RoboWiki about
how to create and how to debug a .NET robot with Visual Studio.

If you want to know the differences between the Robot API for Java and the new one for .NET, you should read this article.

You can read about the bugfixes and changes with the previous beta versions here:

In the following, the new bugfixes and changes made since the 1.7.2.0 Beta 3 version are listed.

Bugfixes


  • Bug: Robots were disabled when skipping 30 skipping non-consecutive turns (or 120 turns when performing I/O operations). Now, Robocode is only disabling robots when the robot skips 30 consecutive turns, which is the original behavior, and which has been broken since version 1.6.1.4.

  • Bug [2994724] - Duplicate version numbers prevents uploading.

  • Bug [2994732] - tzu.TheArtOfWar 1.2 gets NullPointerExceptions.

  • Bug [3003721] - Attempting to install Robocode over an existing install NPEs.

  • Bug [3005547] - The robocode.command is missing the execute permissions bit.

  • Bug [2999719] - Problems with Graphics2D.fill/draw(Shape).

  • Bug [3005111] - NPE when uploading results.

  • Bug [2994560] - "Ignoring" messages in rumble is duplicated.

  • Bug [2975871] - Minor visual bug - Currently selected robot gets covered.

  • Bug: A security exception was thrown with development robots trying to access their data directory.


Changes


  • Robocode will now only install batch files relevant to the hosting system, e.g., .bat files are not installed under Unix/Linux/Mac OS X, and .sh files are not installed under Windows. Furthermore, .command files are only installed under Mac OS X, and has now the execution permission bit set (due to bug [3005547]).

  • Robocode will now write out a warning in the robot console when a robot is detected that uses static references to a robot, i.e. static fields that are declared as e.g. a Robot, AdvancedRobot, TeamRobot etc. (typically references to the robot itself). A static reference to a robot can cause unwanted behavior with the robot accessing these. Hence, it is strongly recommended that static robot references in a robot class or within its helper classes are changed into non-static references and that the robot is recompiled afterwards. In every round, Robocode is creating new instances of the individual robot, meaning that static references to former Robot objects points to "dead" objects that are not used anymore in the game, and which cannot be garbage collected during the battle when there is static references to these.


Download Robocode 1.7.2.0 (final) from here
Download Robocode .NET plugin 1.7.2.0 from here
Download Robot testing framework 1.7.2.0 from here

Friday, 30 April 2010

Robocode 1.7.2.0 Beta 3

This is the 3rd and last beta for Robocode version 1.7.2.0, where lots of bugs found in Beta 2 have been fixed.

We need to have the fixes verified and also let you check if we have introduced some unwanted side-effects with all the bug fixes we made. So if you have made a bug report for Robocode, please verify the fix the bug if it has been marked as "fixed", and update the tracker with a comment. That is, if the bug was fixed or not.

If you discover a new issue, then don't hesitate reporting it on SourceForge here with a note of which system and Java version you are running under.

If you are new to Robocode 1.7.2.0 then please note that this version is the first version of Robocode that supports robots written for .NET. With the .NET plugin for Robocode, Java and .NET robots can participate in the same battles in the same time.

You can read our two first articles on the RoboWiki about
how to create and how to debug a .NET robot with Visual Studio.

If you want to know the differences between the Robot API for Java and the new one for .NET, you should read this article.

We encourage everybody to test this new Beta version as much as possible and report any bugs found at our Bugs Tracker at SourceForge. Then we will do everything we can to fix issues before the final release of version 1.7.2.0.

You can read about the bugfixes and changed made with the first beta here and the second beta You can read about the bugfixes and changed made with the first beta here.


In the following we list the new bugfixes and changes since the 1.7.2.0 Beta 2 version.

Bugfixes


  • Bug [2976754] - Battle engine consumes more CPU power over time

  • Bug [2972932] - Strange issue first time running roborumble in 1.7.2.0 Beta 2.

  • Bug [2978825] - isTeammate() sometimes returns false with teammates.

  • Bug [2964562] - Cannot extract downloaded robot for editing in Robot Editor.

  • Bug [2976258] - Strange thread exceptions with kid.DeltaSquad in 1.7.

  • Bug [2974178] - Krabb.sliNk.Garm 0.9u freezes often in 1.7.

  • Bug [2970414] - Occasionally losing the bit of text in the robot console.

  • Bug [2954723] - java.lang.Error: Interrupted attempt to aquire read lock.

  • Bug: Teams with versions could not be found in a development path.

  • Bug: Files in /robots/.data or /robots/.robotcache dir were put into a underscore sub-directory.

  • Bug: The "Kill Robot" button in the robot console windows was often disabled.



Changes


  • The robot console now uses a rolling buffer so when the number of lines in the robot console exceeds the max number of lines (500), the oldest lines are removed, and "^^^ TEXT TRUNCATED ^^^" is written in the top. Previously half of the text was truncated when the max number of lines was reached.


Download Robocode 1.7.2.0 Beta 3 from here
Download Robocode .NET plugin 1.7.2.0 Beta 3 from here

Sunday, 14 March 2010

Robocode 1.7.2.0 Beta 2

This is the second Beta for Robocode version 1.7.2.0. Many issues were reported and found with the first Beta. We fixed many of these issues - especially regarding RoboRumble (also MeleeRumble and TeamRumble).

We need to have the fixes verified and also let you check if we have introduced some unwanted side-effects with all the bug fixes we made. So if you have made a bug report for Robocode, please verify the fix the bug if it has been marked as "fixed", and update the tracker with a comment. That is, if the bug was fixed or not.

If you discover a new issue, then don't hesitate reporting it on SourceForge here with a note of which system and Java version you are running under.

If you are new to Robocode 1.7.2.0 then please note that this version is the first version of Robocode that supports robots written for .NET. With the .NET plugin for Robocode, Java and .NET robots can participate in the same battles in the same time.

You can read our two first articles on the RoboWiki about
how to create and how to debug a .NET robot with Visual Studio.

If you want to know the differences between the Robot API for Java and the new one for .NET, you should read this article.

We encourage everybody to test this second Beta version as much as possible and report any bugs found at our Bugs Tracker at SourceForge. Then we will do everything we can to fix issues before the final release of version 1.7.2.0.

You can read about the bugfixes and changed made with the first beta here.

In the following we list the new bugfixes and changes since the first 1.7.2.0 Beta version.

Bugfixes


  • Bug [2953599] - Roborumble doesn't upload with EXECUTE=NOT.

  • Bug [2960836] - Team RoboRumble uploading is broken.

  • Bug [2964559] - TeamRumble: Cannot find robot in nested .jar files.

  • Bug [2930266] - Robot static data isn't being GCed after battle. More fixes were made.

  • Bug [2960870] - isTeammate() called on null gives NullPointerException.

  • Bug [2961489] - ArrayIndexOutOfBoundsException when starting team battle.

  • Bug [2952496] - Installer installs AutoExtract$1.class.

  • Bug [2952549] - yk.JahRoslav 1.1 throws WinException.

  • Bug [2960894] - jlm.javaDisturbance loses substantial score in 1.7.2 Beta.

  • Bug [2962846] - (.NET) condition tested on concurrently modified collection.


License Change


  • We have changed license from Common Public License (CPL) v1.0 into Eclipse Puplic License (EPL) v1.0.


Download Robocode 1.7.2.0 Beta 2 from here
Download Robocode .NET plugin 1.7.2.0 Beta 2 from here

Monday, 22 February 2010

Get started with Robocode for .NET robots

The biggest news for Robocode in a long time is the support for .NET robots.
So if you want to get started with .NET programming in a fun way, here is your chance to try it out and challenge your skills.

Get started by reading our two tutorials for .NET robots here:These two tutorials contains everything needed to get started with programming .NET robots for Robocode.

If you are already familiar with programming Robocode robots in Java, you might be interested in extending your skills into .NET as well. You can read about the differences between .NET and Java robots here.

Download Robocode 1.7.2.0 Beta from here
Download Robocode .NET plugin 1.7.2.0 Beta from here

Monday, 15 February 2010

Robocode .NET - introduction

Visible Robot differences


between Java and brand new .NET API for Robocode robots.

  • Namespaces start with uppercase Robocode.AdvancedRobot instead of robocode.AdvancedRobot from Java.

  • Methods start with uppercase AdvancedRobot.Execute() instead of AdvancedRobot.execute() from Java.

  • Getter and setter methods are represented by properties BulletHitEvent.VictimEnergy instead of BulletHitEvent.getVictimEnergy() from Java.

  • Droids are marked with Robocode.IDroid interface instead of robocode.Droid from java.

  • Painting robot uses Robocode.IGraphics interface, which is similar to System.Drawing.Graphics.

  • Robocode.Condition could be implemented by delegate, see SampleCs.Target.

  • Interactive robot should use Robocode.Keys constants, see SampleCs.Interactive.

  • team Robot messages should be binary serializable and marked with [Serializable] attribute.

  • .NET robot pays more work to submit each turn into battle (to overcome the interop layer). We will probably adjust CPU time given to robot to keep fair competition. The ratio Java/.NET is for discussion yet.

  • Access to files is done thru AdvancedRobot.GetDataFile() which returns System.IO.Stream

  • there is difference in implementation of floating point between CLR & JVM. The JVM uses strictfp - rounding after each operation, which is more portable. Whereas CLR uses FPU wide registers to achieve better speed and precision. If you recursively recompute same numbers, it will produce a little bit different result. Nothing to worry about.

  • System.Threading.Thread is banned, use Robocode.Thread instead.


About the implementation


Two years ago, when we came with the idea of introducing .NET for Robocode we had no idea what so ever how much work it would require from us. :-O
We had raw idea that the main problem is speed. Robocode version 1.6 and below used shared state in RobotPeer between Battle thread and Robot thread.
Each call on the Robot API was synchronized to one big mutex. Now imagine that each call from a .NET robot will come through interop layer and then through synchronization in Java. Our estimate was that we would need 10.000 calls per second across CLR/transport/JVM boundaries to satisfy all calls which robot does on RobotAPI. That's not very realistic!


After several trials and failures we came to idea that we will make communication between robot and battle chunky rather than chatty. We cache all commands from robot till end of turn (Execute) and then we send it to battle as a message.
The other way around it's the same. At end of turn, the battle produces a message for each robot. The message contains all the information a robot could ever ask for, i.e., all the events, positions - everything. The message is used by robot as cache for all queries on the Robot API.
And that's big success. The Java version of Robocode speedup about 10x in version 1.6.2. This design as well allows for .NET robot to cross the CLR/JVM boundary just once per turn! The messages are serializable to binary form, so the interface between robot and battle could be reused for C++/Delphi/Python/Ruby/Basic/Foxpro :-D robots in the future.


So now, how to connect two virtual machines? Webservice or tcp - slooow, named pipe - slow, COM - yeah maybe, but COM registration, JNI & PIvoke & C++ & in same process - that would be almost it.
In the end as by-product of need for Robocode, I started off new opensource project - jni4net. It's is fast intraprocess bridge, without any native code and it's object oriented. It's generally useful for .NET+Java solutions.


There were challenges about sandboxing the robot in .NET. We use AppDomain, CAS security and static code analysis to prevent you from cheating.


There is plenty of work ahead. I would not name it now, because we would like to hear from you, what you think we should improve?

Enjoy!

Robocode 1.7.2.0 Beta - The ".NET robots are now supported" release

We are proud to announce the 1.7.2.0 Beta release of Robocode, which is the first version to support .NET robots via using a plugin for Robocode. A lot of hard work has been put into the .NET support by Pavel Savara.

With the .NET plugin for Robocode, Java and .NET robots can participate in the same battles in the same time.

You can read our first article on the RoboWiki about
how to create a .NET robot with Visual Studio and run it in Robocode.

If you want to know the differences between the Robot API for Java and the new one for .NET, you should read this article.

We have also added lots of pending features and of course made some changes to Robocode as well.

We encourage everybody to test this Beta version as much as possible and report any bugs found at our Bugs Tracker at SourceForge. Then we will do everything we can to fix issues before the final release of version 1.7.2.0.

Bugfixes


  • Bug [2930266] - Robot static data isn't being GCed after battle.

  • Bug [2931445] - Removing directories from "development options" doesn't work.

  • Bug in RobotClassLoader causing ClassNotFoundException for some robots during robot class load.

  • Fixed a NullPointerException occuring when Robocode is (re)loading the robot repository after a developer path has been removed.

  • Bug [2935451] - Version ordering is somewhat strange with letters.

  • Bug [2930256] - Robot console text sometimes disappears.

  • Bug [2928688] - morbid.MorbidPriest_1.0 fails to load.

New features


  • .NET Robocode plugin. It is now possible to code robots in .NET and let them engage in Robocode battles.

  • Req [2816882] - onRoundEnded(). It is now possible for robots to get notified when a round has ended. The onRoundEnded() event handler received a new RoundEndedEvent that contains information about the number of turns in the round and total turns in the whole battle when the event occurred.

  • The robocode.control.RoundEndedEvent in the Control API has been extended with a new method named getTotalTurns() similar to the new robocode.RoundEndedEvent for the Robot API.

  • Req [2931696] - RateControlRobot vs. TeamRobot. The RateControlRobot is now a TeamRobot meaning that it can participate in team battles.

  • Req [2931684] - Skipped turn events. Added getSkippedTurn() method on the SkippedTurnEvent class, which returns the turn that was skipped. The getTime() returns the time when the SkippedTurnEvent was processed by the robot, which is always later when the robot is skipping turns. The message "SYSTEM: you skipped turn" has been improved, so it will tell which turn that was skipped like "SYSTEM: john.Doh skipped turn 43".

  • Req [2342293] - Screenshot of battleview. Press Ctrl+T on Windows and Linux, and Command+T for Mac OS in order to take a screenshot of the battleview. The screenshot will be saved in the Robocode folder named "screenshots", and the filename will be a timestamp for when the screenshot was taken.

  • Req [2496661] - Launch Robocode from .battle (battle specification) and .br (battle record) files.

  • Req [2659612] - Add option to prevent speedup when minimized. This new View Option can now be set in the Preferences by putting a check mark into "Prevent speedup when minimized".

  • Req [2643438] - Renamed /robots/.robotcache to /robots/.data

Changes


  • Browser support has been improved for Mac OS, Unix and Linux, which in most cases did not work properly.

    • In previous versions of Robocode, the browser.sh was used to start up the user's prefered browser. The browser.sh file is not being used anymore. Hence, this file can safely be removed from your robocode installation dir.

    • Now, Robocode will start up a browser under Mac OS, Unix and Linux with no use of scripts.

  • The Development Options dialog in the Preferences has been improved:

    • Changed from using single interval selection to multi selection interval.

    • Adding an existing path is ignored.

    • The list of path is automatically sorted.


Download Robocode 1.7.2.0 Beta from here
Download Robocode .NET plugin 1.7.2.0 Beta from here

Wednesday, 6 January 2010

Robocode 1.7.1.6

Happy New Year to everybody!

This is the final release of 1.7.1.6 which contains one new feature, some bug fixes, and a few changes compared to the beta.

Bugfixes


  • Bug [2912942] - Mac OS X 10.6: Cannot run Robocode from robocode.sh. It must be run from the new robocode.command file instead.

  • Bug [2912944] - Mac OS X 10.6: The editor cannot see the JDK. It must be run from the new robocode.command file instead.

  • The onDeathEvent(DeathEvent) method was called too late, when a new round was about to start. Not when the robot has died.

  • Bug [2867326] - Lockup on start if too many bots in robots dir (cont'd). Additional fix was made to locate multiple robots under the same package.

  • Changed the robot painting so that everything that goes into the painting buffer is always painted, and remaining painting operations exceeding the buffer capacity are always dropped. Previously, only the last painting operations exceeding the painting buffer were executed.


New Features


  • The amount of used memory and total memory is now shown in the title bar of Robocode. This is useful to see how much memory your robots are consuming.


Changes


  • If the robot paints too much between actions, an improved error message is written out in the robot console. But from this version of Robocode this message is only written out a single time.

  • A SecurityException is now thrown if a robot exceeds its max. data file quota, meaning that it uses more than 200.000 bytes its data files in total.


Download Robocode 1.7.1.6 from here