Re: RobotDeath Event Only Seems to Fire When visible = false

"flemmingnlarsen" <[email protected]>
Newsgroups gmane.comp.java.robocode
Message-ID <[email protected]>
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.?

--- In [email protected], Mauricio Noda <mauricio_noda@...> wrote:
>
> 
> 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: [email protected]
> From: flemming.n.larsen@...
> 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
> 
> 
> 
> --- In [email protected], "mbesney" <mbesney@> wrote:
> 
> >
> 
> > 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.   
> 
> > 
> 
> > --- In [email protected], "flemmingnlarsen" <flemming.n.larsen@> wrote:
> 
> > >
> 
> > > 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
> 
> > > 
> 
> > > --- In [email protected], "mbesney" <mbesney@> wrote:
> 
> > > >
> 
> > > > 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:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.