Hi there,
Recently i've started programming an action-flight simulator, however i've hit a major snag with programming the AI.
The most effective way to 'dogfight' another fighter is to roll to the point where your enemy is 'infront and above' you relative to your current orientation, and then pitch upwards until the enemy fighter is in your sights. For instance: there is an enemy fighter approaching from your right, so instead of yawing right with the rudder (which would take too long to turn on an aircraft) you should roll right 90 degrees and then pitch upwards 90 degrees so you'll be facing your enemy and lined up for a shot.
Problem is I cant seem to get the enemy to 'think' like that. I've tried Deltayaw, deltapitch, pointentity and align to vector in different combinations to try to create a function which works but i've had no success, laregly because of the functions i've mentioned deal in yaw and pitch but not roll angles.
I need to be able to allow AI fighters to roll to the correct angle needed to be able to pitch to face the players figher and also allow the AI fighters to work out the delta-pitch in relation to its roll angle.
Any help would be very appreciated!
Many thanks,
Erik Hogan
Recently i've started programming an action-flight simulator, however i've hit a major snag with programming the AI.
The most effective way to 'dogfight' another fighter is to roll to the point where your enemy is 'infront and above' you relative to your current orientation, and then pitch upwards until the enemy fighter is in your sights. For instance: there is an enemy fighter approaching from your right, so instead of yawing right with the rudder (which would take too long to turn on an aircraft) you should roll right 90 degrees and then pitch upwards 90 degrees so you'll be facing your enemy and lined up for a shot.
Problem is I cant seem to get the enemy to 'think' like that. I've tried Deltayaw, deltapitch, pointentity and align to vector in different combinations to try to create a function which works but i've had no success, laregly because of the functions i've mentioned deal in yaw and pitch but not roll angles.
I need to be able to allow AI fighters to roll to the correct angle needed to be able to pitch to face the players figher and also allow the AI fighters to work out the delta-pitch in relation to its roll angle.
Any help would be very appreciated!
Many thanks,
Erik Hogan