robocode.Bullet instances not being synchronized

Jump to navigation Jump to search
Revision as of 10 February 2013 at 19:26.
This is the thread's initial revision.

robocode.Bullet instances not being synchronized

I've been trying to track down a weird bug that makes DrussGT occasionally not be able to identify one of its bullets in an onBulletHitBullet situation. The bullet I get in the onBulletHitBullet handler gives a getX() and getY() to a point which is one tick behind the one I have stored from fire time. This only happens rarely, once every ~100 or so bullets, but it's enough to make DrussGT crash with some new optimizations I've added, and enough to prevent the wave shadows from being cleared in certain circumstances.

I'm also not sure which one is giving the incorrect results, the setFireBullet Bullet or the BulletHitBulletEvent Bullet; if it's the former, it means that every so often my bullet shadows are incorrect, which would also explain why I get hit by a bullet which is inside of a bullet shadow several times a battle against Diamond.

So, any ideas of how on earth this might be happening, or the best way to mitigate it? Would somebody please check if this happens to them as well? I'm using 1.7.3.2 as a dev environment.

    Skilgannon20:26, 10 February 2013