Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git

Author Topic: Hitting the target  (Read 26411 times)

Ingar

  • Administrator
  • Commander
  • *****
  • Posts: 91
  • P-O-T-A-T-O
    • Project::OSiRiON
Hitting the target
« on: 2016-08-20 18:26:17 »
The AI currently doesn't lead its aim. This means it will aim at the player's current position
instead of trying to predict where the player will be when the bullet reaches its target.

I don't really intend to change this behaviour, a decent aim would probably make the AI unbeatable.

Station turrets on the other hand, should be rather nasty and could seriously benefit from aim correction.
Without it, they're rather useless because they're too easy to dodge.

To solve this, we need some mathematics.

I wrote down the problem in the attached document and found some interesting lecture
in this post on reddit, now I need some time to wrap my head around it ;D



« Last Edit: 2016-08-20 18:50:23 by Ingar »
OK Space Cadets, prepare to hurtle through the cosmos!

Ingar

  • Administrator
  • Commander
  • *****
  • Posts: 91
  • P-O-T-A-T-O
    • Project::OSiRiON
Re: Hitting the target
« Reply #1 on: 2016-08-24 19:28:00 »
The solution from the reddit post works perfectly.
I just had to brush up on my dot product properties and
quadratic equation solutions.

Turrets are mean now ;D

I wanted to use this on the HUD to draw an aim indicator,
but unfortunatly I don't have the weapon stats client-side,
and those are required to solve the equation.
OK Space Cadets, prepare to hurtle through the cosmos!