Loading...
 

PogamutUT2004


Raytracing Bug

There seems to be a bug with raytracing. I was using the RaycastingBot to learn about rays, and I noticed that although this bot defines 5 AutoTraceRays, it only references 3 of them in the flagChanged method of the listener that checks the rays. If you change the body of that method from:
-----------
left = raycasting.getRay(LEFT45);
front = raycasting.getRay(FRONT);
right = raycasting.getRay(RIGHT45);
------------
to
------------
System.out.println("traces");
AutoTraceRay temp = raycasting.getRay(LEFT90);
left = raycasting.getRay(LEFT45);
front = raycasting.getRay(FRONT);
right = raycasting.getRay(RIGHT45);
temp = raycasting.getRay(RIGHT90);
System.out.println("finished");
------------

Then the method hangs forever. I know this because the "finished" at the end never gets printed. Finding this bug was pretty annoying. This was all in 3.0.11 by the way.

On a related note, why isn't there a method like getAutoTraces() anymore that simply returns the current state of all previously defined autotraces?
Hi.
I've look into in quickly - it is a problem of the last ray that is added (RIGHT90), for some reason, if you query the last ray added by raycasting.createRay in flagChanged method, it will freeze there.
If you add another ray that will be added after RIGHT90, the code above will work.

I do not know where the bug is yet (I am suspecting GameBots2004), I'll look into this later.

Thx for bug report,
Michal
Still working on the issue. Seems it is not at the GameBots2004 side. If you want ray tracing to work properly, do not use flagChanged method and instead make a listener to AutoTraceRay objects. E.g.:

IWorldObjectListener<AutoTraceRay> myObjList = new IWorldObjectListener<AutoTraceRay>() {

        public void notify(IWorldObjectEventr<AutoTraceRay> event) {
            user.severe("Event: " + event.toString() + "; Id: " + event.getObject().getId().getStringId());
        }
    };


Do not forget to register this listener with worldview through:

getWorldView().addObjectListener(AutoTraceRay.class, myObjList);


Best,
Michal
Hi!

I'll look at this issue as well (this Friday).

Best!
Jimmy
It is fixed in the SVN. It was my fault ... wrong order of two method calls, one of them was latch.countDown() :-)
R
Great! Thanks Ruda :-)

Jakub
 

News

News RSS RSS feed for News link



Pogamut

Quarterly RSS RSS feed for quarterly reports

Acknowledgement

This work is supported by GA UK 1053/2007/A-INF/MFF (2007-8), GA UK 351/2006/A-INF/MFF (2006-8), the Ministry of Education of the Czech Republic (grant MSM0021620838) (2008-9), by the Program "Information Society" under project 1ET100300517 (2006-9), and the project Integration of IT Tools into Education of Humanities (2006-8) and by the project CZ.2.17/3.1.00/31162, which are financed by the European Social Fund, the state budget of the Czech Republic, and by the budget of Municipal House Prague.