Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: Passive/Distracted AI  (Read 6669 times)

Sotales

  • Ensign
  • *
  • Posts: 16
    • View Profile
Passive/Distracted AI
« on: October 17, 2013, 03:29:05 PM »

I was wondering if anyone else has had this problem. Often, I have fighter wings and/or frigates under AI control be a little too passive in taking out their targets or being distracted by other enemies/missiles that aren't a threat. Even when setting fighters to Intercept, which, according to the tooltip, states that they will ignore other targets and put themselves at risk, they get distracted by missiles that aren't targeting them, they often do not close to engagement range, attack another target, or oftentimes, back off from engagement range when they have the advantage. Now, I'm nowhere near an AI coding expert, so I'm not sure if this is working as intended or is the best that can be expected. I only know I have been frustrated on many occasions when fighter wings and/or frigates could have easily destroyed their targets if only they had continued to pursue them and actually fight according to their assignments.

Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Passive/Distracted AI
« Reply #1 on: October 17, 2013, 03:36:38 PM »

Hi - pretty sure there's an issue with the fighter AI; need to take a look at that. Frigate AI is, as far as I know, pretty much ok.
Logged

Sotales

  • Ensign
  • *
  • Posts: 16
    • View Profile
Re: Passive/Distracted AI
« Reply #2 on: October 17, 2013, 03:40:45 PM »

Thanks for the quick reply. Have been enjoying the game the last year or so and love the interaction that you have with the community. I'm always looking forward to what's in your next blog posting and announcements.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Passive/Distracted AI
« Reply #3 on: October 17, 2013, 03:49:48 PM »

Thanks, appreciate your support :)
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 758
    • View Profile
Re: Passive/Distracted AI
« Reply #4 on: October 17, 2013, 06:21:02 PM »

Frigate AI is, as far as I know, pretty much ok.

Sorry to plug but might want to have a look at this, some of us are really having some annoyances with them: http://fractalsoftworks.com/forum/index.php?topic=7205.0
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Passive/Distracted AI
« Reply #5 on: October 17, 2013, 06:34:43 PM »

Frigate AI is, as far as I know, pretty much ok.

Sorry to plug but might want to have a look at this, some of us are really having some annoyances with them: http://fractalsoftworks.com/forum/index.php?topic=7205.0

I've seen that thread. IIRC, that aspect of the AI hasn't changed. They'll try to stay out of your line of fire while escorting you but not in general (though they do flank etc). In general, if you're actually hitting friendly ships regularly, you mostly have yourself to blame. Right? I mean, yeah, it may have gotten in the way, and that's not good, but shooting it isn't going to improve the situation, and stopping firing for a second or two won't usually result in an overall drop in damage as that tends to be flux capped.

Autofire really shouldn't be hitting friendly ships except very, very rarely, though. Unless it's with a long chargeup-time weapon such as the Gauss Cannon and your ship turns after it decided to fire. In that case there's nothing a ship can do about it; putting slow-turning weapons with a non-negligible chargeup time on autofire is a bad idea. Autofire actually accounts for the chargeup time when deciding what the risk of friendly fire is, but it can't account for the ship deciding to turn in the meantime.
« Last Edit: October 17, 2013, 06:45:30 PM by Alex »
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 758
    • View Profile
Re: Passive/Distracted AI
« Reply #6 on: October 17, 2013, 07:17:10 PM »

Alex, took me two or three battles but got the perfect video:

After i turned off the recording i STILL nailed one or two shots in the same frigate. Basically i got it down from full health to 45% hull just on my own. As you can see, ship standing almost perfectly still, no movement minus some tiny drift. Still, one Gauss and one Hephaestus shot smack dab into it.

Still this isn't /really/ indicative of the other cause i was having issues about, the frigates actually staying in your firing line. Will try and see if i can document that as well tomorrow.

LE: Lol, said i'd finish the battle, ended up shooting up my frigates even more. Vid here, same thing, leave it a few mins, still upping/processing:

And one more:  this one was shooting at the Doom now, so i don't think it's related to shooting fighters. Offtopic, this is a ship with full range skill bonuses and integrated targeting unit, so that /might/ be screwing things up.

Last last one: This one shows clearly popping three shots in my own frigate: Notice the last videos are all with 0 drift, no manual fire and just shooting autofire from a fixed position.

And this was all /one/ battle.

For the sake of completness here's my save: https://dl.dropboxusercontent.com/u/4037018/save_SeeronNorvar_94979586624160517.zip just fight the big fleet with the Doom/Astral i think on the Tritach planet.

Either way, if there is a 80% chance i'll kill my own frigates with my own guns on autofire, either i'll quit using omnishield frigates, quit using autofire, or quit using frigates? Though i've heard a lot of people have problems with other ships aswell.
« Last Edit: October 17, 2013, 07:38:32 PM by Cosmitz »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Passive/Distracted AI
« Reply #7 on: October 17, 2013, 07:57:35 PM »

Thanks for the videos; that helps. This is definitely a bug, it should not be doing that - a brief look through the code doesn't yield anything, though. I wonder if it's somehow related to the skills/hullmods used (though that seems to be taken into account by the code as well). Haven't been able to reproduce it so far (but haven't tried your save yet), will take a close look at this tomorrow.
Logged

Kiloman

  • Ensign
  • *
  • Posts: 35
    • View Profile
Re: Passive/Distracted AI
« Reply #8 on: October 17, 2013, 10:32:53 PM »

I've seen this a good bit too - mostly of the 'flightiness' or getting distracted, but they do also seem to get in my way more than they used to.

The unnecessary backing off seems to happen the most with continuous beam (laser) weapons; the AI seems to hang right at the edge of firing range, and will sometimes even stand just out of range firing the beams but not hitting anything, or the autofire ai will fire weapons that can't actually hit. It's almost like they are counting on the extra bit of carryover range that you get from non-instantaneous weapons, or maybe they are just firing close enough to hit where the shield would be if it was up.

I could provide videos as well if that would help.
« Last Edit: October 17, 2013, 10:47:22 PM by Kiloman »
Logged

Nooblies

  • Lieutenant
  • **
  • Posts: 72
    • View Profile
Re: Passive/Distracted AI
« Reply #9 on: October 18, 2013, 01:57:28 AM »

Regarding fighters, it seems to be that they are very averse to attacking anything head on, even retreating ships, and will instead opt to circle around outside range of the enemy weapons to get to the back. This causes problems when the enemy ship is moving and particularly turning, as it means that the fighters are almost perpetually moving around the ship to try and get to the sweet spot behind it, and hence end up contributing very little in the way of firepower or damage.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7231
  • Harpoon Affectionado
    • View Profile
Re: Passive/Distracted AI
« Reply #10 on: October 18, 2013, 11:14:41 AM »

Yup, I've noticed that too with both fighters and frigates - sometimes the flanking is amazing but when:

1) The enemy ship is near the speed of the fighters or faster. Or:
2) The enemy ship is running away and not extremely slow.

The flanking behavior is very very much worse than "Fly at enemy: Shoot. Repeat."
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24155
    • View Profile
Re: Passive/Distracted AI
« Reply #11 on: October 18, 2013, 01:01:11 PM »

Spoiler
Alex, took me two or three battles but got the perfect video:

After i turned off the recording i STILL nailed one or two shots in the same frigate. Basically i got it down from full health to 45% hull just on my own. As you can see, ship standing almost perfectly still, no movement minus some tiny drift. Still, one Gauss and one Hephaestus shot smack dab into it.

Still this isn't /really/ indicative of the other cause i was having issues about, the frigates actually staying in your firing line. Will try and see if i can document that as well tomorrow.

LE: Lol, said i'd finish the battle, ended up shooting up my frigates even more. Vid here, same thing, leave it a few mins, still upping/processing:

And one more:  this one was shooting at the Doom now, so i don't think it's related to shooting fighters. Offtopic, this is a ship with full range skill bonuses and integrated targeting unit, so that /might/ be screwing things up.

Last last one: This one shows clearly popping three shots in my own frigate: Notice the last videos are all with 0 drift, no manual fire and just shooting autofire from a fixed position.

And this was all /one/ battle.

For the sake of completness here's my save: https://dl.dropboxusercontent.com/u/4037018/save_SeeronNorvar_94979586624160517.zip just fight the big fleet with the Doom/Astral i think on the Tritach planet.

Either way, if there is a 80% chance i'll kill my own frigates with my own guns on autofire, either i'll quit using omnishield frigates, quit using autofire, or quit using frigates? Though i've heard a lot of people have problems with other ships aswell.
[close]

Alright! Took a good look at this and fixed a bunch of issues.

First of all, there was a bug where if a ship's engines were flamed out, it would be much more likely to hit it. (It was using the ship's maximum speed as a factor in deciding how much room for error to allow. When that was 0 due to the engines being offline, things got bad. (Looking at the videos, this appears to be the cause of all but two incidents.)

Second, doubled how frequently it re-calculates the risk.

Third, I was wrong about the chargeup time being considered - it was, but only for burst weapons. It wasn't considering it for 1-shot weapons like the Gauss Cannon. So, fixed that too.

Finally, it now also allows for the possibility of a ship being out of range but moving into range while the shot is en route (previously, it only accounted for potential sideways movement).

After all these changes, I took the save out for a spin, deploying 3 Tempests and the Conquest, and sitting by and "Defending" an objective so that the Conquest was providing close fire support for the Tempests as much as possible. Basically, trying to get it to shoot them as much as possible, while playing the battle through to the end :)

The end result was 0 friendly-fire incidents, with every Tempest surviving until the end. It's still possible for friendly fire to occur, of course, but it should be a great deal less likely, especially for ships that have disabled engines.


The unnecessary backing off seems to happen the most with continuous beam (laser) weapons; the AI seems to hang right at the edge of firing range, and will sometimes even stand just out of range firing the beams but not hitting anything, or the autofire ai will fire weapons that can't actually hit. It's almost like they are counting on the extra bit of carryover range that you get from non-instantaneous weapons, or maybe they are just firing close enough to hit where the shield would be if it was up.

That's a little different; the game uses the collision radius of the target ship (multiplied by various factors as appropriate) as a shortcut for some range computations. What you're seeing tends to show for long and narrow ships; it's especially visible in some mods.


@Thaago, Nooblies: Yeah, definitely something I'm aware of. It's non-trivial to fix since it still needs to do some flanking if it's not the only thing pursuing the ship.
Logged

Thaago

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7231
  • Harpoon Affectionado
    • View Profile
Re: Passive/Distracted AI
« Reply #12 on: October 18, 2013, 01:19:29 PM »

Wow! Productive bugfixing.

...
@Thaago, Nooblies: Yeah, definitely something I'm aware of. It's non-trivial to fix since it still needs to do some flanking if it's not the only thing pursuing the ship.

For frigates I agree because you want to avoid collisions, but I'm not sure if I agree with fighters. Its more combat effective to flank, but a lot of the time all I want the fighters to do to a fleeing enemy is make it lose its 50 speed bonus so I can catch up in a destroyer or something - basically trading combat effectiveness for 'time to intercept'.  When thats needed though is definitely non-trivial.
Logged

ciago92

  • Admiral
  • *****
  • Posts: 577
    • View Profile
Re: Passive/Distracted AI
« Reply #13 on: October 18, 2013, 01:45:30 PM »

For frigates I agree because you want to avoid collisions, but I'm not sure if I agree with fighters. Its more combat effective to flank, but a lot of the time all I want the fighters to do to a fleeing enemy is make it lose its 50 speed bonus so I can catch up in a destroyer or something - basically trading combat effectiveness for 'time to intercept'.  When thats needed though is definitely non-trivial.

What if you changed the behavior of harass to making the target keep its shields up rather than dealing real damage? would that be too intensive of a change?
Logged

Cosmitz

  • Admiral
  • *****
  • Posts: 758
    • View Profile
Re: Passive/Distracted AI
« Reply #14 on: October 18, 2013, 03:55:28 PM »

Spoiler
Spoiler
Alex, took me two or three battles but got the perfect video:

After i turned off the recording i STILL nailed one or two shots in the same frigate. Basically i got it down from full health to 45% hull just on my own. As you can see, ship standing almost perfectly still, no movement minus some tiny drift. Still, one Gauss and one Hephaestus shot smack dab into it.

Still this isn't /really/ indicative of the other cause i was having issues about, the frigates actually staying in your firing line. Will try and see if i can document that as well tomorrow.

LE: Lol, said i'd finish the battle, ended up shooting up my frigates even more. Vid here, same thing, leave it a few mins, still upping/processing:

And one more:  this one was shooting at the Doom now, so i don't think it's related to shooting fighters. Offtopic, this is a ship with full range skill bonuses and integrated targeting unit, so that /might/ be screwing things up.

Last last one: This one shows clearly popping three shots in my own frigate: Notice the last videos are all with 0 drift, no manual fire and just shooting autofire from a fixed position.

And this was all /one/ battle.

For the sake of completness here's my save: https://dl.dropboxusercontent.com/u/4037018/save_SeeronNorvar_94979586624160517.zip just fight the big fleet with the Doom/Astral i think on the Tritach planet.

Either way, if there is a 80% chance i'll kill my own frigates with my own guns on autofire, either i'll quit using omnishield frigates, quit using autofire, or quit using frigates? Though i've heard a lot of people have problems with other ships aswell.
[close]

Alright! Took a good look at this and fixed a bunch of issues.

First of all, there was a bug where if a ship's engines were flamed out, it would be much more likely to hit it. (It was using the ship's maximum speed as a factor in deciding how much room for error to allow. When that was 0 due to the engines being offline, things got bad. (Looking at the videos, this appears to be the cause of all but two incidents.)

Second, doubled how frequently it re-calculates the risk.

Third, I was wrong about the chargeup time being considered - it was, but only for burst weapons. It wasn't considering it for 1-shot weapons like the Gauss Cannon. So, fixed that too.

Finally, it now also allows for the possibility of a ship being out of range but moving into range while the shot is en route (previously, it only accounted for potential sideways movement).

After all these changes, I took the save out for a spin, deploying 3 Tempests and the Conquest, and sitting by and "Defending" an objective so that the Conquest was providing close fire support for the Tempests as much as possible. Basically, trying to get it to shoot them as much as possible, while playing the battle through to the end :)

The end result was 0 friendly-fire incidents, with every Tempest surviving until the end. It's still possible for friendly fire to occur, of course, but it should be a great deal less likely, especially for ships that have disabled engines.


The unnecessary backing off seems to happen the most with continuous beam (laser) weapons; the AI seems to hang right at the edge of firing range, and will sometimes even stand just out of range firing the beams but not hitting anything, or the autofire ai will fire weapons that can't actually hit. It's almost like they are counting on the extra bit of carryover range that you get from non-instantaneous weapons, or maybe they are just firing close enough to hit where the shield would be if it was up.

That's a little different; the game uses the collision radius of the target ship (multiplied by various factors as appropriate) as a shortcut for some range computations. What you're seeing tends to show for long and narrow ships; it's especially visible in some mods.


@Thaago, Nooblies: Yeah, definitely something I'm aware of. It's non-trivial to fix since it still needs to do some flanking if it's not the only thing pursuing the ship.
[close]

Wow, i'm glad that solved so many things. :) Heres to 0.6.2a!
Logged