What about the distance? -- AvihooI
Well, there are basically two approaches to targeting. You can either predict where the target is going to be (simple targeters, pattern matchers) or you can fire at the angle that is most likely to hit (based on past observations). The calculation Voidous gave comes from the latter approach, used when scaling prior successful angles to the range of possible angles that the target can get to. The location of impact (or distance to it) isn't really a direct concern for that targeting approach, just the angle (relative to dead-on) of fire.
If you want to predict where your opponent will be, you are going to have to assume a movement behavior (linear, circular, match to previous pattern) and plot out each tick's location one at a time, until the bullet has enough time to arrive at the target's location. Then you aim for that intercept point and fire (on the following turn). Even though predictive targeting is easier to code, it takes more time to process, at least for me. -- Martin
As I mentioned to AvihooI on ICQ, the distance doesn't factor in, because what really matters is the ratio of enemy speed to bullet speed; at any distance, those two sides of the right triangle, if you'll imagine it as one, form the same angle at the gun source. -- Voidious