I’ll be speaking at GDC 2017 on Monday about the math behind projectiles in Orcs Must Die! I will post the slides some time shortly after GDC.
Here’s the description of the talk I sent in:
In games, AI must lead the player with a projectile–simply firing directly at the player won’t do. This talk will explore how to have the AI lead the player for both linear and ballistic projectiles. We’ll walk through the derivation of the equations for projectile motion and the intersection with a moving player so programmers can understand how the math behind the technique works.
After walking through the basics, additional features that are built on top of the basic math will be discussed, including: avoiding ceilings, what to do when using a ballistic trajectory when the player is too close for a good arc, and what to do when there’s no intersection. Frequently, games will also want the AI to be able to miss convincingly, so we’ll discuss ways to handle that. Finally, we’ll want to expose values to designers that they can easily understand and tweak. All of the additional features discussed will be illustrated by experiences implementing projectiles in the Orcs Must Die! series.