[Home]Fire (bot)

Robo Home | Changes | Preferences | AllPages

A SampleBot that sits still shooting at everything it sees.

How come, when you have 2 Fires (modified so they don't move) shooting at eachother, the bullets go right through eachother? -- Tango

This is discussed elsewhere, but I'll answer it here as well. Bullets aren't treated as a single point, but as a line segment travelling from it's endpoint from the previous tick it's new endpoint one unit of velocity distant (at the angle it was fired at). Bullet collisions are determined by line segments intersecting one another during a tick (and line segments intersecting a tank's body scores a hit). Ok.. so now the answer I spoke of: Lines which are parallel do not intersect. Bullets fired directly at one another will not (usually) collide. I'm not saying it's right .. it's just the way it was programmed. Frankly it would make shooting bullets out of the sky pretty simple if it were not that way. You'd just sit still and fire at the point the enemy was last turn if you detect that he fired. I believe that you will see bullets collide on occasion due to some imprecision with doubles when checking for the intersection of the segments. --Martin Alan Pedersen

Robo Home | Changes | Preferences | AllPages
Edit text of this page | View other revisions
Last edited November 28, 2005 19:38 EST by Martin Alan Pedersen (diff)