Build the best - destroy the rest!

Sunday, 17 August 2008

Robocode 1.6.1 (final) has been released

The final version of Robocode 1.6.1 has finally been released after the beta versions that contained lots of changes and bugfixes.

Changes since Beta 3



  • The new options -DPARALLEL and -DRANDOMSEED introduced in Robocode 1.6.1 will have no effect when running RoboRumble, MeleeRumble, and TeamRumble.


Previous Beta versions


In order to get the full information about all changes and bugfixes since Robocode 1.6.0, please read the information provided for the 3 previous Beta versions:


Download 1.6.1 (final) from here

Tuesday, 12 August 2008

Robocode 1.6.1 Beta 3

More bugfixes were made to Robocode 1.6.1 (Beta 3) compared to the previous Beta 2.

Bugfixes



  • [2042289] Frequent errors stopping bots: This error was introduced in one of the 1.6.1 Beta versions, where some robots got this error message: "Waiting for robot XXX to stop. Robot XXX is not stopping. Forcing a stop.".
  • [2022774] Various usability issues: Preferences: If TPS was changed from the Preferences during a battle, the error "SYSTEM: pause game bug!" occurred.
  • [2024568] Sometimes the compiler window hangs: This bug occurred on some systems when compiling a robot - especially when a compiler error was returned by the compiler.
  • [2034395] Battles don't open again with selected robots: When opening and starting a battle from a .battle file with selected robots (in the .battle file) the New Battle dialog was showing the robots of the previous battle instead of the selected robots from the .battle file.


Changes


[2022774] Various usability issues:



  • Added "Enable all" and "Disable all" button in the View Options of the Preferences.
  • When the TPS slider is set to 0, the game is paused, and the Pause/Resume button set to paused mode. Now, if the Pause/Resume button is pressed, the game will resume at 1 TPS, and the TPS slider will now move to 1. Previously it will set to 0.
  • Improved some menus a bit with better names, and did some rearrangements of the order of the menu items here and there.
  • In the New Battle window, the focus is now kept in the list of available robots when one of the two 'Add' buttons has been pressed. Previously the focus was lost, and you had to reselect robots in the list of available robots in order to add more robots. It is now possible to add multiple robots using only the arrow keys with e.g. the Alt+A in order to add more robots to the battle.


Download: here

Wednesday, 9 July 2008

Robocode 1.6.1 Beta 2

Lots of bugfixes and changes were made for the Robocode 1.6.1 Beta 2 compared to the first beta of the coming version 1.6.1. Some of the bugfixes were non-trivial, and hence we have made this new Beta 2 release.

Bugfixes



  • [2009283] Error in bullet damage calculation: The bullets scoring was incorrect compared to version 1.6.0.1. It was too high.

  • The Battle Results showed scores that was doubled (in the 1.6.1 Beta) compared to the real results.

  • Fixed issue with robot paintings, which mirrored the paintings.

  • Fixed issue with painting with the alpha channel (translucent color).

  • The mouse y coordinate of the mouse events was not scaled correctly.

  • When starting up a new battle, the battle would sometimes appear to be paused, even though the user did not pause the game.

  • [2009432] Leaking System.out: outputting to System.out from the constructor of a robot would go to the actual console instead of being properly redirected.



Changes



  • The new TPS slider was readjusted, so the are more slower speeds, and less higher speeds.

  • The menu item for the Ranking Panel is now hidden when replaying a battle, and the panel is now being hidden, if it is visible, while the battle is being replayed. The reason for hiding the Ranking Panel is that the replay feature does not support displaying the current rankings during the replay, i.e. the current scores are not recorded.



Download: here

Saturday, 28 June 2008

Robocode 1.6.1 Beta

We are proud to present new version of Robocode for community testing.

Robot visible changes


  • We introduced new feature -DRANDOMSEED, which must be set to a specific random seed value. When this option is set, the random number generator used in Robocode becomes deterministic. So your robots will appear in exactly the same positions, when you rerun battles. This is very useful when testing and debugging your robot, because you will be able to repeat problematic situations again and again.

  • The new random number generator for the -DRANDOMSEED also overrides method e.g. Math.random(), so it will make robots based on this also deterministic. We are also looking for smart trick to replace instances of Random class used by robots in the future, but we didn't figured it out yet. Note that this random generator is only deterministic when the -DRANDOMSEED has been set. Otherwise we use same Java generator as before, making game pseudo-random.

  • We introduced new experimental feature -DPARALLEL (set to true or false). It allows robots run in parallel intended to take advantage of more CPU's available in the system. (Default is that for each turn robots are resumed sequentially). It may speedup battles with multiple CPU consuming robots. Time measuring is not per robot, so it cannot be used in contest, but might be nice for training. Please let us know if you like it or not.

  • We introduced new feature 1878233: onBattleEnded event. It is useful for learning robots, because event will always be sent at the end of each battle no matter if you won, lost or the battle was aborted. When the onBattleEnded event occur you could save your settings to disk. Also the battle results are dispatched to you.

  • Robot has new method getGraphics(). It allows you to draw your custom drawings to the battle view any time, not only during onPaint() event. Drawing will appear on end of turn.

  • Interactive events like onMouse*(), onKey*() and also onPaint() are now dispatched thru standard robot's event queue, so they will be called on robot's thread. So your robot will pay a bit of CPU time when using these.

  • Messages from robots to console are now dispatched on end of each turn.

  • AdvancedRobot and IAdvancedRobotPeer has got the new method getStatusEvents(), so a robot is now able to handle status events in the middle of an event handler.

  • Feature 1954853 : Name of robot's package was extended from 16 to 32 characters. The Robocode Repository is able to handle this (verified with Dan Lynn).


User interface changes


  • Robocode user interface was improved a bit. Also some dialogs are modal now.

  • The TPS slider has been redesigned to be more exponential, so it covers battle in slow speed (1-30 TPS), higher speed (30 - 120 TPS), and fast speed (120 - 1000 TPS). Move to zero will now pause the game.

  • New battle dialog and results dialog can be closed by pressing the Esc key.

  • The title on the Robocode window is now showing the current turn in a battle, and is updated every half second. In addition, the layout of the information shown in the title has been improved a bit.

  • The system log output has now been split, so that logged errors are sent to System.err and logged messages are sent to System.out. This makes it possible to filter out messages from errors when reading out the logs from Robocode. The system log now also includes a full stack trace when errors are logged, making it easier to determine where an error has occurred.

  • Battle view was redesigned and now it is redrawn at max 50 FPS, which saves CPU cycles, and thus allows the TPS (turns per second) to be even higher/faster.


Bug fixes


  • The field 'others' on the JuniorRobot was not updated properly when other robots dies.

  • Fixed issue with duplicate team name. The 'short name' in RobotPeer was same as 'name' for duplicate robots. Now, duplicate team named are dedupped.

  • The New Battle Dialog was resized after the robot selection.

  • After the intro battle, the Restart button was disabled.

  • InterruptedException are now being handled properly by interrupting the current thread, so it will keep its interrupted state after the InterruptedException has been caught.


Implementation details

What happened inside? Well, we were able to decouple UI and battle engine core. Till this version, the core of Robocode was tightly coupled to various components. For example, the battle thread was directly calling the BattleView to repaint each frame. We had the same issues with sounds, battle results dialog, window title and more.

On the other side, i.e. in UI, there were dependencies on the Battle class, which is the real core. The UI thread from the RobocodeFrame was calling it directly in order to stop or pause the battle. Also, the BattleView was making calls directly to the Battle to paint the battle field. Even worse, it was touching the RobotPeers (handles all logic of the individual robot) heavily causing a synchronization nightmare.

What we did? We cleaned up the mess. ;-) In the first step we introduced set of battle events, which are fired from the battle. These events are fired on the start and end of each battle, round and turn. They carry along a package of information, which is interesting for the specific type of battle event. For example, TurnEndedEvent contains all information about single turn, including current info about robots and score, and BattleCompletedEvent contains the final score, etc. The battle events are fired from the battle to a battle event dispatcher, which then dispatches these events to all registered battle listeners. Notice that the battle does not have to know know or deal with implementations of battle listeners, making the design cleaner. We implemented IBattleListener interface on all coupled UI components. And moved actions from core Battle to battle listener handlers. We also refactored components, so they now use data delivered by battle events, rather than calling the battle back to get this data.

Some of the battle listeners are just storing the event and processing it on the ATW/Swing thread. In case of the BattleView it helps us to speedup the battle, because painting is done asynchronously to the battle turns.

Next we also refactored various UI controls, so that they use the new IBattleManager interface to control the battle or robots, rather that calling these directly.

The implementation of most commands is sent to command queue on the battle and then processed on the battle thread, rather than directly on the ATW/Swing thread. This helps us to keep UI responsive while battle is being stopped and afterwards cleaned up. It also helps to gain synchronization purity.


Robocode 1.6.1

Both of the interfaces IBattleManager and IBattleListener are considered internal. They are not visible to robots (undoubtedly), but shouldn't be used by users of the RobocodeEngine as well. We plan to to make it more accessible as soon as these interfaces are stabilized.


JUnit tests

We have brand new JUnit test infrastructure based on -DRANDOMSEED feature and battle events. The current number of test is actually small, but we will continue to add more and more tests as we get along.
If you are interested to help us with creating unit tests, please drop us an email on robocode-devel group.
We will be able to provide you with test cases, which needs to be implemented. But we welcome your own test cases as well.



Update 3.7.2008: We are looking to hear your opinions about this release, bug reports, ideas for next releases. Please don't be shy and talk to us. Thanks!

For curious: I put together plan for next version 1.6.2. Comments welcome.

Tuesday, 3 June 2008

Robocode 1.6.0.1 fixes problem with debugging in Eclipse

Bugfixes:

- Fixed debug problem with Eclipse. It was not possible anymore to debug robots from Eclipse as TimeoutExceptions occurred when trying to resume from a breakpoint. Now, Robocode must be started by adding the option -Ddebug=true to the VM arguments when debugging Robocode from Eclipse (or any other IDE). The documentation (Wiki) about how to debug robots using Eclipse using the -Ddebug=true option will be updated.
- Fixed missing internal robot proxy layer introduced in Robocode 1.6.0.

Download: here Robocode 1.6.0.

Thursday, 1 May 2008

Robocode 1.6.0 (final) has been released

The final Robocode 1.6.0 has been released.

Download: here

Friday, 18 April 2008

Robocode 1.6.0 Beta 2 has been released

A new Beta 2 version of Robocode 1.6.0 has been released.

The reason for releasing this new Beta is that an additonal robot interface that needs to be tested before the final release of Robocode 1.6.0

The Beta 2 contains the additional robocode.robotinterface.IPaintRobot for robots that needs to receive paint events, meaning that it is now optional if a robot should deal with onPaint() notifications.

In addition, the Beta 2 release also contains the new sample.PaintingRobot for demonstrating the onPaint() method.

Download: here