Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: zookeeper on September 05, 2011, 02:12:56 am

Title: What subsystem paths do
Post by: zookeeper on September 05, 2011, 02:12:56 am
I haven't found an exact description of what an AI ship will actually do when it attacks a pathed subsystem, so I figured I'd try to collect the collective wisdom on the matter here in one thread.

This is my understanding of how the movement is supposed to work:

1. The AI heads to the location of the first path point (the one farthest away from the subsystem).
2. When it gets within the radius of the first path point, it turns to the next path point, and again when it gets within the radius of that one, it picks the next one, and so on.
3. ???

Firstly, assuming the above is otherwise correct, then what happens when it gets to the last path point (and the subsystem isn't destroyed)? Will it head back to the first path point again and start over, or what?

Secondly, are there exceptions? If the ship passes through the third path point while it's heading for the second point, will it continue onto the second one or will it head straight for the fourth? Does the ship ram into the target if the last point of the path is on the location of the subsystem? Does the ship actually make an attempt to reach the next path point, or might it (if it feels it isn't threatened) make a full stop and just sit there shooting at the subsystem, if the path already brought the subsystem within its weapon range and crosshairs?

I have a couple questions more about other details, but I'd like to get these basics down first.
Title: Re: What subsystem paths do
Post by: Sushi on September 05, 2011, 09:49:37 am
The code around it is a bit confusing. How does it behave in-game when you experiment with it?

The answers to your questions, AFAICT:

what happens when it gets to the last path point (and the subsystem isn't destroyed)? Will it head back to the first path point again and start over, or what?
I think so. It will fly away, then reset for another attack.

If the ship passes through the third path point while it's heading for the second point, will it continue onto the second one or will it head straight for the fourth?
Not sure. The code even has a comment saying that only the first point is even used, which would be something to look out for while experimenting.

Does the ship actually make an attempt to reach the next path point, or might it (if it feels it isn't threatened) make a full stop and just sit there shooting at the subsystem, if the path already brought the subsystem within its weapon range and crosshairs?
I *think* the ship won't make a full stop when using waypoints to attack subsystems, but I'm not sure. I think that anytime the subsystem is under the crosshairs and the fighter has a clean shot, it will take it, though.
Title: Re: What subsystem paths do
Post by: MatthTheGeek on September 05, 2011, 10:02:51 am
Switching camera to an AI craft easily shows that the AI tends to fire even if the target is visibly nowhere near the crosshair.
Title: Re: What subsystem paths do
Post by: pecenipicek on September 05, 2011, 11:53:28 am
Does the ship actually make an attempt to reach the next path point, or might it (if it feels it isn't threatened) make a full stop and just sit there shooting at the subsystem, if the path already brought the subsystem within its weapon range and crosshairs?
I *think* the ship won't make a full stop when using waypoints to attack subsystems, but I'm not sure. I think that anytime the subsystem is under the crosshairs and the fighter has a clean shot, it will take it, though.
Ya wish. With TAP testing stuff, i've had numerous occurences of bombers standing still and retarded there while shooting until something started shooting at them. (either me or the enemy AI...)

i need to check if the ships attacked had the subsys path data tho...

[edit] yup, they did.
Title: Re: What subsystem paths do
Post by: zookeeper on September 05, 2011, 01:52:09 pm
The code around it is a bit confusing. How does it behave in-game when you experiment with it?

It's hard to tell. In one mission the ships won't actually attempt to fly directly towards the first path point when they get the order to attack that subsystem, or they only do it sometimes, but I'm not sure what it is that they try to do: possibly they're attempting to fly straight towards the subsystem, which is a problem since it makes them crash into the rest of the target ship. However, the ships also start within the bounding box and radius of the target ship when they get the order, which I suppose could affect it (the subsystem paths are also completely within the bounding box as well), so maybe that affects it.

Does the ship actually make an attempt to reach the next path point, or might it (if it feels it isn't threatened) make a full stop and just sit there shooting at the subsystem, if the path already brought the subsystem within its weapon range and crosshairs?
I *think* the ship won't make a full stop when using waypoints to attack subsystems, but I'm not sure. I think that anytime the subsystem is under the crosshairs and the fighter has a clean shot, it will take it, though.

Like pecenipicek, I can confirm that ships do make full stops even when the subsystem they're attacking has a path, unless something is shooting at them.
Title: Re: What subsystem paths do
Post by: Droid803 on September 05, 2011, 04:45:13 pm
That's actually smart though...if there's nothing shooting at them, why not line up a shot?
Of course, they should probably break as soon as the 'enemy is targeting you" warning starts going for a second or two.
Title: Re: What subsystem paths do
Post by: pecenipicek on September 06, 2011, 12:18:12 am
That's actually smart though...if there's nothing shooting at them, why not line up a shot?
Of course, they should probably break as soon as the 'enemy is targeting you" warning starts going for a second or two.
its not lining up a shot, its "stop at certain distance away from target no engines whatsoever, then spin around towards it, then start shooting it"
Title: Re: What subsystem paths do
Post by: Dragon on September 06, 2011, 07:11:20 am
Well, if no one is shooting at them, they could as well just sit there and pound the subsystem. Players do that too (until they get bored, that is).
Title: Re: What subsystem paths do
Post by: zookeeper on September 06, 2011, 07:17:53 am
Well, if no one is shooting at them, they could as well just sit there and pound the subsystem. Players do that too (until they get bored, that is).
Yes, but when someone does start to shoot at them, it can easily be impossible for them to get moving quickly enough to evade.
Title: Re: What subsystem paths do
Post by: Dragon on September 06, 2011, 07:22:21 am
True, they should react to being targeted, not to being fired upon.
Title: Re: What subsystem paths do
Post by: headdie on September 06, 2011, 08:45:29 am
True, they should react to being targeted, not to being fired upon.

the problem with that is all the player has to do is cycle through each bomber in a wing or order at least one fighter per bomber and they will not be able to fire a torpedoes at their target as often if at all because they are constantly evading.
Title: Re: What subsystem paths do
Post by: MatthTheGeek on September 06, 2011, 08:53:41 am
Targeted for more than three seconds then.
Title: Re: What subsystem paths do
Post by: Commander Zane on September 06, 2011, 09:23:55 am
Well, if no one is shooting at them, they could as well just sit there and pound the subsystem. Players do that too (until they get bored, that is).
For mods like TAP and JTH that isn't what bombers should be doing. It would be pretty cool if they stayed on the move during an attack more often anyway, despite being able to get less shots out that way.
Title: Re: What subsystem paths do
Post by: pecenipicek on September 06, 2011, 09:37:03 am
Well, if no one is shooting at them, they could as well just sit there and pound the subsystem. Players do that too (until they get bored, that is).
For mods like TAP and JTH that isn't what bombers should be doing. It would be pretty cool if they stayed on the move during an attack more often anyway, despite being able to get less shots out that way.
Yeah. Our bombers both dont use any missile type weapons, so strafing runs should be standard, not "drift in close, stay still, get ripped apart to shreds when enemies notice "
Title: Re: What subsystem paths do
Post by: zookeeper on September 07, 2011, 01:19:12 am
Even if there aren't completely definitive answers to the previous questions, here's the next one:

What if the subsystem has multiple paths? Will the attacking ship pick the one which starts closest to its current position, or will it pick one at random, or are multiple paths unsupported and it'll just pick the same one every time?
Title: Re: What subsystem paths do
Post by: Sushi on September 10, 2011, 11:33:43 am
Does the ship actually make an attempt to reach the next path point, or might it (if it feels it isn't threatened) make a full stop and just sit there shooting at the subsystem, if the path already brought the subsystem within its weapon range and crosshairs?
I *think* the ship won't make a full stop when using waypoints to attack subsystems, but I'm not sure. I think that anytime the subsystem is under the crosshairs and the fighter has a clean shot, it will take it, though.
Ya wish. With TAP testing stuff, i've had numerous occurences of bombers standing still and retarded there while shooting until something started shooting at them. (either me or the enemy AI...)

i need to check if the ships attacked had the subsys path data tho...

[edit] yup, they did.

Were they attacking a specific subsystem? If not, I don't think the subsystem paths would have been used at all.


Even if there aren't completely definitive answers to the previous questions, here's the next one:

What if the subsystem has multiple paths? Will the attacking ship pick the one which starts closest to its current position, or will it pick one at random, or are multiple paths unsupported and it'll just pick the same one every time?

No clue. Experiment and see what happens? :) My guess is that the third option is most likely.
Title: Re: What subsystem paths do
Post by: headdie on September 10, 2011, 05:40:35 pm
Even if there aren't completely definitive answers to the previous questions, here's the next one:

What if the subsystem has multiple paths? Will the attacking ship pick the one which starts closest to its current position, or will it pick one at random, or are multiple paths unsupported and it'll just pick the same one every time?

if that is the case how much of a pita would implementing multiple paths be?

No clue. Experiment and see what happens? :) My guess is that the third option is most likely.
Title: Re: What subsystem paths do
Post by: pecenipicek on September 10, 2011, 07:27:01 pm
Does the ship actually make an attempt to reach the next path point, or might it (if it feels it isn't threatened) make a full stop and just sit there shooting at the subsystem, if the path already brought the subsystem within its weapon range and crosshairs?
I *think* the ship won't make a full stop when using waypoints to attack subsystems, but I'm not sure. I think that anytime the subsystem is under the crosshairs and the fighter has a clean shot, it will take it, though.
Ya wish. With TAP testing stuff, i've had numerous occurences of bombers standing still and retarded there while shooting until something started shooting at them. (either me or the enemy AI...)

i need to check if the ships attacked had the subsys path data tho...

[edit] yup, they did.

Were they attacking a specific subsystem? If not, I don't think the subsystem paths would have been used at all.
point. i'll check it out.