Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . GitLab
* 2017-12-17 15:52:37
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Forums Operational.
 
   Home   Help Search Login Register  
Pages: [1]
 
Author Topic: Hitting the target  (Read 1752 times)
Ingar
Administrator
Commander
*****
Posts: 87


P-O-T-A-T-O


WWW
« on: 2016-08-20 16: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 Grin





* hitting-the-target.png (155.36 KB, 734x1039 - viewed 161 times.)
« Last Edit: 2016-08-20 16:50:23 by Ingar » Logged

OK Space Cadets, prepare to hurtle through the cosmos!
Ingar
Administrator
Commander
*****
Posts: 87


P-O-T-A-T-O


WWW
« Reply #1 on: 2016-08-24 17: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 Grin

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.
Logged

OK Space Cadets, prepare to hurtle through the cosmos!
Pages: [1]
 
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines
OSiRiON theme by Ingar, based on AF316 theme by Fedhog
Valid XHTML 1.0! Valid CSS!