I've noticed that sometimes while dogfighting, an enemy AI craft will manage to disengage, either due to manouvers or speed, and will then be face to face with the player. Everything is normal so far. What is not normal is the fact that it can sometimes get an aspect lock in what appears to be under a second and instantly kill you.
So I decided to do some testing and the results are... interesting to put it mildly.
--------------------------------------------------
TEST Mission SETUP:
- NO mod FSO, 3.7.2 SSE2 -
player Hercules, default primary banks, 1 tornado bank, 2nd empty bank. - coordinates 0,0,0 - Initial velocity: 0
Enemy Hercules, default primary banks, 1 tornado bank, 2nd empty bank. - coordinates 0,0,3000 - Initial velocity: 0
Player in wing Alpha
Enemy in wing Aries (wing order, attack Alpha 1)
I literally lift my hands off the keyboard when the mission starts.
As expected the enemy will close in on the player and start launching missiles.
@insane difficulty:
- The AI will launch missiles at aprox. 1850-1875 metters away from the player. With no lock warning. It goes straight to incoming missile warning. (these missiles appear to have no lock)
- At the above distance the player doesn't even have an aspect lock.
- The player will start getting a lock at aprox 1600-1625 metters.
-
And here is where it gets really weird.
If the player continues to do nothing. The first 3 or so volleys of tornados will detonate (from running out of fuel) in front of the player with the 4th set correctly impacting the player.
Instead, if the player decides to try and evade the missiles once they are launched by setting a course perpendicular to the enemy fighter's vector. Those same missiles that would've detonated in front of the player will instead hit him.
Furthermore if the player accelerates, then stops, well before the enemy missiles are fired (i.e. D > 2500), the missiles will now lock correctly.
If the mission is modified to set the initial velocity of the player to > 1, missiles will hit the player, although the AI will still fire without a lock.
@hard same problem
@medium same problem, but (see at the end) staying at coordinate origin (0,0,0) will still allow these missiles to hit, even though they lack lock.
----------------------------------------------
2nd test mission
The enemy fighter is now at 1000 metters away facing away from the player. His wing ordered to play dead until 5 seconds into the mission and set to immobile via SEXP . 5 seconds in, his orders cleared and ordered to attack the player's wing.
The AI will face the player (for some reason there is a short warning lock as the enemy ship starts to turn, yet never faces me directly). And as soon as a lock is acquired by the enemy fighter it will start firing its tornados at me, except not a single one will ever reach me. Presumably from the initial velocity 0 bug mentioned above.
Should the player try to evade these missiles that would otherwise never hit him, they will connect. Modifiying your speed by only a few m/s will make the missiles hit correctly. It's almost like if they were smartly seeking your thrusters! (except I'm pretty sure they arent!)
----------------------------------------------
3rd test mission
Enemy fighter starts with its engine disabled at 3000 metters, facing away from the player, its wing ordered to attack the player. 5 seconds in, its engine is repaired via repair subsystem sexp. The fighter will turn, face the player and once again shoot from 1850-1875 metters. Missiles will not connect at the difficulties the same problem presented itself in test1 (insane/hard)
----------------------------------------------
What do all of these have in common?
The player is at 0,0,0 in the world grid. Moving the player out of that magical spot allows missiles to actually lock on to him.
Another mission I tried with an enemy fighter disabled, at 0,0,0 will allow the player to get a lock, but missiles will never head towards it until you hit it with a primary that pushes it from exactly 0,0,0
------------
Conclusions:
- Coordinate origin breaks things.
- The ai seems to be able to ignore aspect locks, but not always.
- The ai can fire missiles further away than the player at insane difficulty and have its missiles lock mid flight, which could cause some unpredictable behavior at closer range.
- This is not something critical, but someone might want to take a look at the code.