Some area has 50% chance of colliding
The highlighted comment was created in this revision.
I used to think that bullet collide detection works like:
1. all bullets move 2. detect every collection
but it actually works like this: (can be found in robocode BulletPeer.java)
1. first bullet move, and detect collision with the rest 2. second bullet move, and detect collision with the rest 3. etc.
as the order is randomized each tick, each moved bullet has 50% chance of colliding with a bullet that is not yet moved.
This sounds as a bug in the game logic.
I was about to go crazy trying explain why there are bullets in my precalculated bullet's shadows.
Well, I don’t think this is a bug, since everything in robocode is handled like this.
And this behavior wont’t affect the shadow we calculated — such area still have 100% collision probability.
Don’t mind there are still bullets in your shadows, if anything got deviation from your prediction, this could happen.
Anyway, make sure that you marked the actual area that two bullets collide, and your bullet is still alive when doing so. This very easy to get an area larger than the real, or off by 1 tick, shifting the shadows.