Discussion:
RobotDeath Event Only Seems to Fire When visible = false
mbesney
2012-04-08 01:41:30 UTC
Permalink
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?

As usual, thanks in advance.



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2012-04-08 21:29:42 UTC
Permalink
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.

I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).

Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
mbesney
2012-04-09 00:06:30 UTC
Permalink
Hi Flemming,

Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.

The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.

It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.

Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2012-04-09 11:31:10 UTC
Permalink
Hi Mike,

Okay. The onRobotDeath() might be a general bug then, perhaps only when used with the RobocodeEngine or when the battle view is visible. I will create a bug report, if I find out that this is indeed a bug.
When the issue has been fixed, I should like you to test the Alpha version with the bug fix, and you can get rid of this issue for your project. I will report back when I have found the root cause of the onRobotDeath() event, and perhaps fixed it. :-)

I am happy to hear that you try to use IDL for Robocode. I should like to hear more about that, and also see how this language looks like etc. Perhaps that is something I should provide better support for in Robocode beside the (new) robot interfaces. But we could discuss this in the Robocode Developers Discussion Group (https://groups.google.com/forum/?fromgroups#!forum/robocode-developers) so that more people can come with suggestions, ideas etc. than just me. ;-)

Thanks and regards,
- Flemming
Post by mbesney
Hi Flemming,
Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.
The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.
It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.
Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
Mauricio Noda
2012-04-09 20:09:11 UTC
Permalink
I remember one of my bots using the onRobotDeath event to manage outgoing waves against dead bots. And I remember it working fine together with the GUI.

Maybe it doesnŽt work with interactive bots? Or maybe some graphical debug in your bot onRoboDeath event is aborting its execution.


To: ***@yahoogroups.com
From: ***@gmail.com
Date: Mon, 9 Apr 2012 11:31:10 +0000
Subject: [Robocode] Re: RobotDeath Event Only Seems to Fire When visible = false




























Hi Mike,



Okay. The onRobotDeath() might be a general bug then, perhaps only when used with the RobocodeEngine or when the battle view is visible. I will create a bug report, if I find out that this is indeed a bug.

When the issue has been fixed, I should like you to test the Alpha version with the bug fix, and you can get rid of this issue for your project. I will report back when I have found the root cause of the onRobotDeath() event, and perhaps fixed it. :-)



I am happy to hear that you try to use IDL for Robocode. I should like to hear more about that, and also see how this language looks like etc. Perhaps that is something I should provide better support for in Robocode beside the (new) robot interfaces. But we could discuss this in the Robocode Developers Discussion Group (https://groups.google.com/forum/?fromgroups#!forum/robocode-developers) so that more people can come with suggestions, ideas etc. than just me. ;-)



Thanks and regards,

- Flemming
Post by mbesney
Hi Flemming,
Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.
The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.
It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.
Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
flemmingnlarsen
2012-04-09 21:41:22 UTC
Permalink
So far, I have not been able to find anything in Robocode that seems to be broken. Are you sure that your method signature for onRobotDeath() is like this:

public void onRobotDeath(RobotDeathEvent e) {
}

Do you clear the list of event using e.g. clearAllEvents()?
Have you tried to use getAllEvents() to check if the RobotDeathEvent is there? The getAllEvents() can be used as an alternative to all the onXXX() event handlers.

I tested this with a simple robot with and without a GUI. And it receives the RobotDeathEvent events from onRobotDeath() just fine. The robot will only receive this event, when an other robot has died, and it has not been killed itself.

Have you set some specific settings for the RobocodeEngine, e.g. -Ddebug=true etc.?
Post by Mauricio Noda
I remember one of my bots using the onRobotDeath event to manage outgoing waves against dead bots. And I remember it working fine together with the GUI.
Maybe it doesn´t work with interactive bots? Or maybe some graphical debug in your bot onRoboDeath event is aborting its execution.
Date: Mon, 9 Apr 2012 11:31:10 +0000
Subject: [Robocode] Re: RobotDeath Event Only Seems to Fire When visible = false
Hi Mike,
Okay. The onRobotDeath() might be a general bug then, perhaps only when used with the RobocodeEngine or when the battle view is visible. I will create a bug report, if I find out that this is indeed a bug.
When the issue has been fixed, I should like you to test the Alpha version with the bug fix, and you can get rid of this issue for your project. I will report back when I have found the root cause of the onRobotDeath() event, and perhaps fixed it. :-)
I am happy to hear that you try to use IDL for Robocode. I should like to hear more about that, and also see how this language looks like etc. Perhaps that is something I should provide better support for in Robocode beside the (new) robot interfaces. But we could discuss this in the Robocode Developers Discussion Group (https://groups.google.com/forum/?fromgroups#!forum/robocode-developers) so that more people can come with suggestions, ideas etc. than just me. ;-)
Thanks and regards,
- Flemming
Post by mbesney
Hi Flemming,
Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.
The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.
It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.
Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
mbesney
2012-04-09 23:34:52 UTC
Permalink
Hi Guys,

I am sorry for all the trouble I have caused you. I'm sure there is no bug in Robocode. I am using it for a purpose it wasn't intended for and therefore things are bound to get a little crazy. Here is the code I am using, when I commented out the two lines I saw the println message in the robot console a couple of times but it is inconsistent. Most of the time I get the old "Round 2 of 5" but sometimes I get my "RobotDeath" message without the "Round 2 of 5". So there is some sort of conflict there which I don't think any of us really need to think about anymore. For me, it is not that important.

public void onRobotDeath(RobotDeathEvent e) {
//String selection = "RobotDeath," + e.getName ();
System.out.println ("****************************************RobotDeath");
//ToClipboard (selection);
}
private void ToClipboard (String selection)
{
StringSelection data = new StringSelection(selection);
clipboard.setContents(data, owner);
}

I cannot believe the level of support you provide Flemming, keep up the great work.

Regards,
Mike
Post by flemmingnlarsen
public void onRobotDeath(RobotDeathEvent e) {
}
Do you clear the list of event using e.g. clearAllEvents()?
Have you tried to use getAllEvents() to check if the RobotDeathEvent is there? The getAllEvents() can be used as an alternative to all the onXXX() event handlers.
I tested this with a simple robot with and without a GUI. And it receives the RobotDeathEvent events from onRobotDeath() just fine. The robot will only receive this event, when an other robot has died, and it has not been killed itself.
Have you set some specific settings for the RobocodeEngine, e.g. -Ddebug=true etc.?
Post by Mauricio Noda
I remember one of my bots using the onRobotDeath event to manage outgoing waves against dead bots. And I remember it working fine together with the GUI.
Maybe it doesn´t work with interactive bots? Or maybe some graphical debug in your bot onRoboDeath event is aborting its execution.
Date: Mon, 9 Apr 2012 11:31:10 +0000
Subject: [Robocode] Re: RobotDeath Event Only Seems to Fire When visible = false
Hi Mike,
Okay. The onRobotDeath() might be a general bug then, perhaps only when used with the RobocodeEngine or when the battle view is visible. I will create a bug report, if I find out that this is indeed a bug.
When the issue has been fixed, I should like you to test the Alpha version with the bug fix, and you can get rid of this issue for your project. I will report back when I have found the root cause of the onRobotDeath() event, and perhaps fixed it. :-)
I am happy to hear that you try to use IDL for Robocode. I should like to hear more about that, and also see how this language looks like etc. Perhaps that is something I should provide better support for in Robocode beside the (new) robot interfaces. But we could discuss this in the Robocode Developers Discussion Group (https://groups.google.com/forum/?fromgroups#!forum/robocode-developers) so that more people can come with suggestions, ideas etc. than just me. ;-)
Thanks and regards,
- Flemming
Post by mbesney
Hi Flemming,
Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.
The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.
It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.
Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2012-04-10 22:26:25 UTC
Permalink
Hi Mike,

You don't need to apologize. It could easily have been a bug in Robocode.

The event handling for the RobotDeathEvent is actually quite simple, and works this way in Robocode, here represented in pseudocode:

for each robot alive {
for each dead robot {
add new RobotDeathEvent to (alive) robot's event queue
}
}
...
end end of turn {
dispatch all pending RobotDeathEvent events by calling onRobotDeath(RobotDeathEvent) to (alive) robot
}

----
I will check Robocode for the inconsistent messages, and fix it if I find the inconsistent parts. I guess it would be safer to count on the RobotDeathEvent instanses instead of the messages provided on the individual robots console messages. This way your code will not be depending on the messages. :-)
----

Will your code become public at some point in the future?
I should love to see your work, and I am anxious to learn how you deal with the IDL. :-)

Thanks,
- Flemming
Post by mbesney
Hi Guys,
I am sorry for all the trouble I have caused you. I'm sure there is no bug in Robocode. I am using it for a purpose it wasn't intended for and therefore things are bound to get a little crazy. Here is the code I am using, when I commented out the two lines I saw the println message in the robot console a couple of times but it is inconsistent. Most of the time I get the old "Round 2 of 5" but sometimes I get my "RobotDeath" message without the "Round 2 of 5". So there is some sort of conflict there which I don't think any of us really need to think about anymore. For me, it is not that important.
public void onRobotDeath(RobotDeathEvent e) {
//String selection = "RobotDeath," + e.getName ();
System.out.println ("****************************************RobotDeath");
//ToClipboard (selection);
}
private void ToClipboard (String selection)
{
StringSelection data = new StringSelection(selection);
clipboard.setContents(data, owner);
}
I cannot believe the level of support you provide Flemming, keep up the great work.
Regards,
Mike
Post by flemmingnlarsen
public void onRobotDeath(RobotDeathEvent e) {
}
Do you clear the list of event using e.g. clearAllEvents()?
Have you tried to use getAllEvents() to check if the RobotDeathEvent is there? The getAllEvents() can be used as an alternative to all the onXXX() event handlers.
I tested this with a simple robot with and without a GUI. And it receives the RobotDeathEvent events from onRobotDeath() just fine. The robot will only receive this event, when an other robot has died, and it has not been killed itself.
Have you set some specific settings for the RobocodeEngine, e.g. -Ddebug=true etc.?
Post by Mauricio Noda
I remember one of my bots using the onRobotDeath event to manage outgoing waves against dead bots. And I remember it working fine together with the GUI.
Maybe it doesn´t work with interactive bots? Or maybe some graphical debug in your bot onRoboDeath event is aborting its execution.
Date: Mon, 9 Apr 2012 11:31:10 +0000
Subject: [Robocode] Re: RobotDeath Event Only Seems to Fire When visible = false
Hi Mike,
Okay. The onRobotDeath() might be a general bug then, perhaps only when used with the RobocodeEngine or when the battle view is visible. I will create a bug report, if I find out that this is indeed a bug.
When the issue has been fixed, I should like you to test the Alpha version with the bug fix, and you can get rid of this issue for your project. I will report back when I have found the root cause of the onRobotDeath() event, and perhaps fixed it. :-)
I am happy to hear that you try to use IDL for Robocode. I should like to hear more about that, and also see how this language looks like etc. Perhaps that is something I should provide better support for in Robocode beside the (new) robot interfaces. But we could discuss this in the Robocode Developers Discussion Group (https://groups.google.com/forum/?fromgroups#!forum/robocode-developers) so that more people can come with suggestions, ideas etc. than just me. ;-)
Thanks and regards,
- Flemming
Post by mbesney
Hi Flemming,
Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.
The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.
It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.
Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
mbesney
2012-04-11 15:33:10 UTC
Permalink
Hello Flemming,

Since you are interested, I recorded a video of the robot in battle with sample.Crazy and posted it on YouTube
Alternatively search YouTube for "Robocode Besney". The robot can actually beat each one of the sample robots which is not surprising considering it is cheating. Check it out. I would also be more than happy to share the code with you as it is a research project and the more interest I can garner the better, especially amongst the Robocode community. I can really use some fresh ideas regarding the cognitive modeling aspect of the project which involves determining a learners natural aptitude towards programming.

Regards,
Mike
Post by flemmingnlarsen
Hi Mike,
You don't need to apologize. It could easily have been a bug in Robocode.
for each robot alive {
for each dead robot {
add new RobotDeathEvent to (alive) robot's event queue
}
}
...
end end of turn {
dispatch all pending RobotDeathEvent events by calling onRobotDeath(RobotDeathEvent) to (alive) robot
}
----
I will check Robocode for the inconsistent messages, and fix it if I find the inconsistent parts. I guess it would be safer to count on the RobotDeathEvent instanses instead of the messages provided on the individual robots console messages. This way your code will not be depending on the messages. :-)
----
Will your code become public at some point in the future?
I should love to see your work, and I am anxious to learn how you deal with the IDL. :-)
Thanks,
- Flemming
Post by mbesney
Hi Guys,
I am sorry for all the trouble I have caused you. I'm sure there is no bug in Robocode. I am using it for a purpose it wasn't intended for and therefore things are bound to get a little crazy. Here is the code I am using, when I commented out the two lines I saw the println message in the robot console a couple of times but it is inconsistent. Most of the time I get the old "Round 2 of 5" but sometimes I get my "RobotDeath" message without the "Round 2 of 5". So there is some sort of conflict there which I don't think any of us really need to think about anymore. For me, it is not that important.
public void onRobotDeath(RobotDeathEvent e) {
//String selection = "RobotDeath," + e.getName ();
System.out.println ("****************************************RobotDeath");
//ToClipboard (selection);
}
private void ToClipboard (String selection)
{
StringSelection data = new StringSelection(selection);
clipboard.setContents(data, owner);
}
I cannot believe the level of support you provide Flemming, keep up the great work.
Regards,
Mike
Post by flemmingnlarsen
public void onRobotDeath(RobotDeathEvent e) {
}
Do you clear the list of event using e.g. clearAllEvents()?
Have you tried to use getAllEvents() to check if the RobotDeathEvent is there? The getAllEvents() can be used as an alternative to all the onXXX() event handlers.
I tested this with a simple robot with and without a GUI. And it receives the RobotDeathEvent events from onRobotDeath() just fine. The robot will only receive this event, when an other robot has died, and it has not been killed itself.
Have you set some specific settings for the RobocodeEngine, e.g. -Ddebug=true etc.?
Post by Mauricio Noda
I remember one of my bots using the onRobotDeath event to manage outgoing waves against dead bots. And I remember it working fine together with the GUI.
Maybe it doesn´t work with interactive bots? Or maybe some graphical debug in your bot onRoboDeath event is aborting its execution.
Date: Mon, 9 Apr 2012 11:31:10 +0000
Subject: [Robocode] Re: RobotDeath Event Only Seems to Fire When visible = false
Hi Mike,
Okay. The onRobotDeath() might be a general bug then, perhaps only when used with the RobocodeEngine or when the battle view is visible. I will create a bug report, if I find out that this is indeed a bug.
When the issue has been fixed, I should like you to test the Alpha version with the bug fix, and you can get rid of this issue for your project. I will report back when I have found the root cause of the onRobotDeath() event, and perhaps fixed it. :-)
I am happy to hear that you try to use IDL for Robocode. I should like to hear more about that, and also see how this language looks like etc. Perhaps that is something I should provide better support for in Robocode beside the (new) robot interfaces. But we could discuss this in the Robocode Developers Discussion Group (https://groups.google.com/forum/?fromgroups#!forum/robocode-developers) so that more people can come with suggestions, ideas etc. than just me. ;-)
Thanks and regards,
- Flemming
Post by mbesney
Hi Flemming,
Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.
The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.
It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.
Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
flemmingnlarsen
2012-04-12 21:59:26 UTC
Permalink
Hehe.. that is some chase that your robot is doing on the Crazy robot. :-)

I am sure that other Robocoders would also be interested in seeing the sources, as using the RobocodeEngine to get detailed information about opponent robots is a great way to study the behavior of the enemy robots. :-)

It might be a cool feature for the RoboReseach (http://robowiki.net/wiki/RoboResearch) project as well. :-)

Cheers,
- Flemming
Post by mbesney
Hello Flemming,
Since you are interested, I recorded a video of the robot in battle with sample.Crazy and posted it on YouTube http://youtu.be/_rnzQH7btrU Alternatively search YouTube for "Robocode Besney". The robot can actually beat each one of the sample robots which is not surprising considering it is cheating. Check it out. I would also be more than happy to share the code with you as it is a research project and the more interest I can garner the better, especially amongst the Robocode community. I can really use some fresh ideas regarding the cognitive modeling aspect of the project which involves determining a learners natural aptitude towards programming.
Regards,
Mike
Post by flemmingnlarsen
Hi Mike,
You don't need to apologize. It could easily have been a bug in Robocode.
for each robot alive {
for each dead robot {
add new RobotDeathEvent to (alive) robot's event queue
}
}
...
end end of turn {
dispatch all pending RobotDeathEvent events by calling onRobotDeath(RobotDeathEvent) to (alive) robot
}
----
I will check Robocode for the inconsistent messages, and fix it if I find the inconsistent parts. I guess it would be safer to count on the RobotDeathEvent instanses instead of the messages provided on the individual robots console messages. This way your code will not be depending on the messages. :-)
----
Will your code become public at some point in the future?
I should love to see your work, and I am anxious to learn how you deal with the IDL. :-)
Thanks,
- Flemming
Post by mbesney
Hi Guys,
I am sorry for all the trouble I have caused you. I'm sure there is no bug in Robocode. I am using it for a purpose it wasn't intended for and therefore things are bound to get a little crazy. Here is the code I am using, when I commented out the two lines I saw the println message in the robot console a couple of times but it is inconsistent. Most of the time I get the old "Round 2 of 5" but sometimes I get my "RobotDeath" message without the "Round 2 of 5". So there is some sort of conflict there which I don't think any of us really need to think about anymore. For me, it is not that important.
public void onRobotDeath(RobotDeathEvent e) {
//String selection = "RobotDeath," + e.getName ();
System.out.println ("****************************************RobotDeath");
//ToClipboard (selection);
}
private void ToClipboard (String selection)
{
StringSelection data = new StringSelection(selection);
clipboard.setContents(data, owner);
}
I cannot believe the level of support you provide Flemming, keep up the great work.
Regards,
Mike
Post by flemmingnlarsen
public void onRobotDeath(RobotDeathEvent e) {
}
Do you clear the list of event using e.g. clearAllEvents()?
Have you tried to use getAllEvents() to check if the RobotDeathEvent is there? The getAllEvents() can be used as an alternative to all the onXXX() event handlers.
I tested this with a simple robot with and without a GUI. And it receives the RobotDeathEvent events from onRobotDeath() just fine. The robot will only receive this event, when an other robot has died, and it has not been killed itself.
Have you set some specific settings for the RobocodeEngine, e.g. -Ddebug=true etc.?
Post by Mauricio Noda
I remember one of my bots using the onRobotDeath event to manage outgoing waves against dead bots. And I remember it working fine together with the GUI.
Maybe it doesn´t work with interactive bots? Or maybe some graphical debug in your bot onRoboDeath event is aborting its execution.
Date: Mon, 9 Apr 2012 11:31:10 +0000
Subject: [Robocode] Re: RobotDeath Event Only Seems to Fire When visible = false
Hi Mike,
Okay. The onRobotDeath() might be a general bug then, perhaps only when used with the RobocodeEngine or when the battle view is visible. I will create a bug report, if I find out that this is indeed a bug.
When the issue has been fixed, I should like you to test the Alpha version with the bug fix, and you can get rid of this issue for your project. I will report back when I have found the root cause of the onRobotDeath() event, and perhaps fixed it. :-)
I am happy to hear that you try to use IDL for Robocode. I should like to hear more about that, and also see how this language looks like etc. Perhaps that is something I should provide better support for in Robocode beside the (new) robot interfaces. But we could discuss this in the Robocode Developers Discussion Group (https://groups.google.com/forum/?fromgroups#!forum/robocode-developers) so that more people can come with suggestions, ideas etc. than just me. ;-)
Thanks and regards,
- Flemming
Post by mbesney
Hi Flemming,
Thanks for the quick response. When I mentioned an "interactive" robot I did not mean one from the sample directory (i.e. keyboard/mouse). I meant my own interactive robot that sends robot events to the external application (which are not normally available to the external app)and interprets command sent by the external application to the robot. Since the external app also gets control snapshots it knows the opponents coordinates on each turn and with a little trigonometry can turn to face the opponent robot and give chase.
The reason I need onRobotDeath is because when the opponent dies there are no more valid coordinates and my robot makes ridiculous movements at the end. I want to post movies on YouTube and it just doesn't look professional.
It's all part of a research project I am involved in regarding learners. Part of it is about lowering the Robocode learning curve and have the learner control the robot through an easier domain specific language (DSL) in the external application. If the learner does not have to actually learn Robocode but can use the easier DSL, then we can assess their cognitive programming abilities that much quicker. It's the cognitive assessment part that I am struggling to get an idea for.
Regards,
Mike.
Post by flemmingnlarsen
Regarding the onRobotDeath(). It could be a bug in Robocode. I will need to check the code in detail and fix it if it is a bug.
I am curious. Why are you using an InteractiveRobot for sending events to the external application. Any other robot type like the AdvancedRobot might be a better option as it does not depend on getting mouse and key event from the user interface (battle view). The problem with the onRobotDeath() might be related to the engine.setVisible(false), but I am not sure (yet).
Regards,
- Flemming
Post by mbesney
I am running Robocode from Eclipse. The external application communicates with an interactive robot through the clipboard. The robot send events (e.g. onScannedRobot) and the external app sends advanced robot commands (e.g. setFire). The onRobotDeath doesn't seem to get through unless engine.setVisible (false). I need the event with a visible battlefield, any ideas out there?
As usual, thanks in advance.
------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Robocode/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Robocode/join
(Yahoo! ID required)

<*> To change settings via email:
Robocode-***@yahoogroups.com
Robocode-***@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Robocode-***@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

Loading...