Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: When aiming, AI doesn't account for ship's own velocity added to projectiles?  (Read 1410 times)

StudentRadio

  • Ensign
  • *
  • Posts: 10
    • View Profile

Hi!

I edited ship_data.csv and gave the Paragon the max speed, acceleration, deceleration, max turn rate, turn acceleration, and mass of a Thunder fighter, just for fun. Then I tried the Forlorn Hope mission, and I refitted the Paragon to use plasma cannons, hypervelocity drivers, autopulse lasers, and advanced turret gyros (among other things). I let the AI pilot the ship.

The Paragon would often miss shots with its projectile weapons--even the ones on turrets--when it was strafing around an enemy ship. It seemed like the aiming AI wasn't accounting for the fact that the Paragon's velocity would be added to the projectiles' velocities. Or in other words, the target leading calculations were only considering the target ship's absolute velocity instead of its velocity relative to the firing ship. Sometimes, while backing away from a target quickly, the Paragon would fire shots that had no chance of hitting because the Paragon's backward velocity was added to them, which basically put the target out of range.

Maybe there's a parameter somewhere else to compensate for this, so it's not enough to edit the spreadsheet? But I can't help wondering if this is happening to a smaller extent all the time. If so, maybe battles don't feel quite as tight as they could?

I was using Starsector 0.95.1a-RC6 for Linux.

Thanks!
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile

Thank you for the report! Basically... the AI is only going to function well within a certain band of values for things; what you've done goes well outside of that and doesn't work. For this particular case: the AI does account for relative velocities for target leading, but does *not* account for it (or, at least, not in all cases?) for weapon range.
Logged

StudentRadio

  • Ensign
  • *
  • Posts: 10
    • View Profile

Hi Alex,

Thanks for the reply!

It's not just the range, though. When the modified Paragon is strafing around a target, its shots often miss in a way that seems correlated with the Paragon's movement. For example, in screenshot 13 the Paragon is moving to its left, and the plasma cannon shots are missing on the left of the Onslaught (from the Paragon's point of view). Likewise, in screenshot 17 the Paragon is moving to its right, and the shots are missing on the right. Seeing it in motion, the impression I get is that the Paragon isn't compensating for its own movement somehow when it aims.

I know the Paragon isn't supposed to have such high speed and maneuverability, but these numbers aren't outside the range of values that real ships have. And if this is happening very noticeably with large numbers, I figured it's probably happening less noticeably (but still happening) with smaller numbers.

Anyway, thanks again!

[attachment deleted by admin]
Logged

Serenitis

  • Admiral
  • *****
  • Posts: 1467
    • View Profile

You can replicate this behaviour without altering anything by using an Odyssey with Plasma Cannons.
Whenever you use the mobilty system, any shots will completely miss your target as the projectiles 'inherit' inertia from the firing ship.
It's the specific combination of big projectile + high speed + 'lateral' movement that creates these very noticeable misfires.

This effect is why I explicitly avoid Plasma on the Ody, because it does my head in.
Some people seem more susceptible to be bothered by this than others.

Logged

StudentRadio

  • Ensign
  • *
  • Posts: 10
    • View Profile

Here's another way to see this effect without modding the properties of any ships:

Create a variant of the Astral (or any carrier) that has no weapons, and just has Thunder wings. Add it to sim_opponents.csv. Take a Monitor into battle against it, activate its fortress shield, remain stationary, and watch the fighters. Sometimes, while they're circling around you, their shots will seem to drift in the same direction they're moving, like I described with the Paragon. The Thunder in the center of screenshot 19 was circling to its left, and its shots were all missing in that direction. At least one of the shots looks like it's going to hit, but the shots aren't actually moving in the direction that their trails would suggest. I'm pretty sure that shot missed.

And sometimes, if the Thunders fire at you while backing away, their shots don't reach you. (You already explained why that might happen, but I'm just noting that it happens with real ships too.)

Hope this helps!

[attachment deleted by admin]
Logged

itBeABruhMoment

  • Commander
  • ***
  • Posts: 158
    • View Profile

Better yet just look at how the ai aims torpedos. The failure to account for the firing ships velocity becomes really obvious with slower moving projectiles such as reapers
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7209
  • Harpoon Affectionado
    • View Profile

This is interesting - give it a shot with the CR of the paragon dialed up to 100, does it have as much of an issue? CR (and the gunnery implants skill) effects the autoaim accuracy and I suspect this is one of the things that improves.
Logged

StudentRadio

  • Ensign
  • *
  • Posts: 10
    • View Profile

Just ran a few tests with the modified Paragon in the simulator.

All were at 85% CR, because automatic targeting is already "excellent" at that level, and I figured the other effects, like increased speed and damage dealt, might be more significant than the aiming benefit.

I tried with and without gunnery implants, though. Subjectively, the Paragon seemed to hit more often with it than without it. And it took about 9% longer to kill without gunnery implants, on average. (It's worth noting that gunnery implants has side effects too, though.)

I guess the aiming "problem" I noticed is normal, because target leading is intentionally less-than-optimal without gunnery implants.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7209
  • Harpoon Affectionado
    • View Profile

I don't know how the target leading via CR works (motion of enemies being off? motion of self being off? projectile velocity? etc) but I do notice it has a large effect when I look for it.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile

I don't know how the target leading via CR works (motion of enemies being off? motion of self being off? projectile velocity? etc) but I do notice it has a large effect when I look for it.

It determines how accurately the AI estimates the "eta" of the shot. So for example with the worst-possible target leading, it assumes the shots would land instantly and naively aims right at the target. Taking a quick look, "Excellent" accuracy means the eta is 67% of the real eta or better.
Logged

StudentRadio

  • Ensign
  • *
  • Posts: 10
    • View Profile

Interesting! Does the "+100%" from gunnery implants set the ETA accuracy to 100%, then? Or does it "double" the accuracy by halving the distance between the old accuracy and 100%? Like, if it was 67% before, does gunnery implants increase it by (100% - 67%) / 2? Just curious.

Maybe it would make sense for target leading accuracy to scale somewhat with a ship's top speed, if it doesn't already? Thematically, you'd expect a fast ship's gunners to be used to their own ship moving fast, and you'd expect its targeting systems to be designed to work at high speeds. (Maybe more for high-tech ships than low-tech ones.) Of course, that would affect game balance.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24111
    • View Profile

The 100% from GI just ensures it always has the "best" leading - an accurate estimate of the eta.

(Re: the based on top speed idea, I suppose you could do that? To me it seems a bit fiddly, though, like an added complication without a good-enough reason behind it, if that makes sense.)
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7209
  • Harpoon Affectionado
    • View Profile

Thanks for the info! That makes sense and matches with my experience of high CR making guns hit fast, small targets much better.
Logged

StudentRadio

  • Ensign
  • *
  • Posts: 10
    • View Profile

Yes, thanks! And I suppose you're right that it wouldn't be worth it.
Logged