As it comes up again and again that ai_accuracy only influences the rate of firing, but not the vector I've now made some real tests and experiments.
Here are the results:
The ai_accuracy does influence the aiming vector. Not only is the code there, but it also works.
I doubt anyone was able to play freespace properly if the AI would hit every time ... (even though on insane it almost hits every time if flying in a straight line.)
Of course the ai_accuracy is best felt on low levels like easy or very easy:
There are 4 exceptions for using the estimated enemy position and using the real enemy position instead:
- subsystems: AIM is always directly hitting at target
- enemy is not in field of view (so it won't even try to fire)
- The target was just acquired. For 1 sec its using the real enemy position.
- The fighter is trying to gain a lock on target, but then it also won't fire primaries.
So the AI has only an unfair advantage in case of subsystems and that 1 sec after target acquired, but I'm not even sure it uses those to shoot.
The Aiming is thrown really off when the object first appears in field of view and gets more precise the longer the object is in the field of view. (scale up to 17 or even 20 on lower levels)
I've tested with FS2 campaign without mods.
The accuracy in FS2 varies much depending on skill level, final scales by which the real vector is put off, ranging from:
2.0 very easy to 1.2.
To sum it all up:
- Accuracy is always perfect if AI aims for a subsystem.
- Accuracy really works as expected (unless for subsystems)
Accuracy does also influence the rate of firing a bit, because if the aim is off too much, it won't even try to fire.
Try setting the ai_accuracy in the corresponding table to feel the difference.
For example set it to 1.0f ... ;-) and wonder how good the AI is at aiming suddenly ...
Questions?
cu
Fabian
PS: If you don't believe me: Make a 1 on 2 mission in FS2, let your friendly AI play dead (ai-play-dead) and let the enemy attack first it, then you ... (make a ship-guardian sexp on yourself) ...
Then see how the enemy fails to first AIM properly at your still standing wingmate and how it shots get more accurate over time ...
Then put yourself in 3rd person view and fly in a straight line possibly on something like "very easy" (change _before_ loading the mission), then watch how the enemy misses quite a few shots on you.
Go head on and fly in a straight line again. Possibly view from enemy, the accuracy will be off again and gets more accurate in time.
PPS:
Here is a log output of the above scenario:
(first we are out of field of view as dot is below 0.25, so we can see the exact position)
Predicted enemy pos = exact enemy pos, real_dot_to_enemy = 0.23, aip->target_time = 90.42, aip->ai_flags & AIF_SEEK_LOCK) = 0
Predicted enemy pos = exact enemy pos, real_dot_to_enemy = 0.24, aip->target_time = 90.45, aip->ai_flags & AIF_SEEK_LOCK) = 0
Predicted enemy pos = exact enemy pos, real_dot_to_enemy = 0.25, aip->target_time = 90.47, aip->ai_flags & AIF_SEEK_LOCK) = 0
(Now we can almost see him, so we predict the position and throw the aim off ...)
Predicted enemy pos != exact enemy pos, real_dot_to_enemy = 0.26, aip->target_time = 90.50, aip->ai_flags & AIF_SEEK_LOCK) = 0
Throwing aim off by scale: 8.721652
Predicted enemy pos != exact enemy pos, real_dot_to_enemy = 0.27, aip->target_time = 90.54, aip->ai_flags & AIF_SEEK_LOCK) = 0
Throwing aim off by scale: 8.767686
(... enemy shoots at my wing man and scale slowly gets less and less)
Predicted enemy pos != exact enemy pos, real_dot_to_enemy = 1.00, aip->target_time = 100.21, aip->ai_flags & AIF_SEEK_LOCK) = 0
Throwing aim off by scale: 2.781154
Predicted enemy pos != exact enemy pos, real_dot_to_enemy = 1.00, aip->target_time = 100.27, aip->ai_flags & AIF_SEEK_LOCK) = 0
Throwing aim off by scale: 2.749156
Predicted enemy pos != exact enemy pos, real_dot_to_enemy = 1.00, aip->target_time = 100.28, aip->ai_flags & AIF_SEEK_LOCK) = 0
Throwing aim off by scale: 2.692149
(... well and here he destroyed the play-dead wing man ...)
You can also see this by looking from the enemy AI. He will AIM wrong first and you can clearly see this.
predict_position_delay from ai_profiles.tbl does determine how often he will try to adjust his aim and predicted enemy position.
Currently this seems to be set pretty high in FS2, so it seems that the AI is always on the same spot, but this is also due to this value.
It also is, because I think updating all the AI for each frame would have needed too much computing power back in 1998, so its only done sporadically, which also gives the impression that the AI is not using accuracy ... but it really is using it, it just aims for a longer time on the wrong spot ...