Hello, it's Jonathan, Lead Writer for ExtroForge, here to bring you a short technical article from the mind of our Lead Developer Jeff, on Auto Turrets and how our turrets will lead their targets.
"Hitting a moving target with a high-velocity, non-accelerating projectile is fairly trivial. Aim at where it is now - and the speed of the projectile negates any target movement.
Hitting a stationary target from a long distance with an accelerating (gravity) projectile is very do-able and somewhat commonly done using a little trig and vector math.
Applying generic 'lead' logic to hit a moving target with a projectile is also oft-done - but most implementations simply use the time-of-flight to the 'current' target location as the basis for the offset. However - this produces HORRID results when the target is moving even at a moderate speed and/or the time of flight between where the target 'was' and 'will be' is even minimally different.
The Extroforge implementation uses a recursive binary search technique to find closest approximation to when the aim point and time-of-flight of the projectile coincide with the target moving the same amount of time towards that same point. We've limited the iterations to 10 (bailing out with the closest value calculated at the moment)...
The results are spectacular."
Medium-speed air-born targets (15 m/s speed - or 33 MPH) tracked by the turret - from long (in some cases extremely long) distances, near 100% accuracy.
Slow moving ground targets...super deadly.