Making the AI save its shots until nearby

even when submunitions have extra range

The EV: Nova AI will fire its weapons as soon as its target is within the combined range of the weapon and all its submunitions. This can be a problem when a weapon is designed not to submunition when the shots expire, or when it is desirable for the first shot to get close to the target for whatever reason. Here is an approach to making the AI not shoot at maximum range, but instead to save its ammunition until it gets closer.

Weapon 1 is fired by the AI ship with guidance as desired. It has high speed, short life, and subs into weapon 2.
Weapon 2 is a free-flight rocket. It has zero speed, medium life, and subs into weapon 3.
Weapon 3 continues toward the target, using whatever behavior and effects are desired.

The end. The trick is that the free-flight rocket inherits the speed of its parent shot, and slowly adjusts to its own speed. But the AI calculates its range normally, multiplying speed by count and dividing by one hundred. So the whole combined weapon gets extra range from the rocket’s initial velocity. You can adjust the amount of extra range as well as the total range of the whole weapon package, so you can make the AI hold off on wasting its shots when the target is at the edge of its range.

Another variation would give weapon 1 medium speed and medium life, and do away with weapon 3 altogether. That way the free-flight rocket would come at the end of the shot for a little extra bonus range.

Potentially better solution for certain guidance types: give the weapon a submunition with negative speed. The AI will calculate it as having negative range, and thus the sum total range of the weapon and its submunitions will be decreased. Here is what I saw in my testing:

Unguided Projectile: Works perfectly. AI firing range is decreased as expected.
Beam: Untested.
Guided Missile: Does not work. AI firing range is increased by the amount it should be decreased.
Beam Turret: Untested.
Projectile Turret: Works perfectly. AI firing range is decreased as expected.
Freefall Bomb: Untested.
Rocket: Partially works. Works partially. Range is decreased, but AI will fire from out of range if target is getting closer.
Front-quadrant Turret: Works perfectly. AI firing range is decreased as expected.
Rear-quadrant Turret: Untested.
Point-defense Turret: Works perfectly. AI firing range is decreased as expected.
Point-defense Beam: Untested.
Carried Ship: Untested.

Edit: It’s worth noting that, with any submunition setup, if you do not want the last submunition to actually appear you can flag the previous weapon not to sub when it expires. The AI will still count the last stage in its range calculations.

This post has been edited by Qaanol : 28 February 2011 - 12:38 PM

Log in to reply