Page 1 of 1

Escort Formations Question

Posted: Sat Oct 13, 2012 6:12 pm
by mandoman
I searched, but didn't see a thread that dealt with this. When the NPC ships are flying escort, and their group, or mother, is attack by multiple offenders, does each escort ship take on a different attacker, or do they all go after one at a time? It would seem logical that they each take on a separate attacker, unless there are fewer attackers than escorts. Just wondering.

Re: Escort Formations Question

Posted: Sat Oct 13, 2012 6:20 pm
by Thargoid
It depends on the AI they are flying under.

There are various AI commands which deal with this kind of thing, for example ESCORT_ATTACKED which is sent to the mother if her escorts are attacked, and groupAttackTarget which when send causes all AIs in the group to receive a "GROUP_ATTACK_TARGET" message. That can then be used to trigger an attack run.

Hence you can have "single combat" or you can have swarming behaviour, depending on how vicious the AI is set up to be. Examples of the latter are my Swarm.oxp and Killer Wolf's Wasps oxp (which I also wrote the AI for, and on which Swarm was based).

This of course has nothing to do with the escort formation itself by the way.

Re: Escort Formations Question

Posted: Sat Oct 13, 2012 7:14 pm
by mandoman
Okay. I had a feeling it was based on something of that nature. Is there a way to make an override for escorts designed to attend one's own NPC ships, that would have each ship taking on a different aggressor, if there are as many or more aggressors than escorts? Maybe that's the same question, I don't know.

Re: Escort Formations Question

Posted: Sat Oct 13, 2012 7:37 pm
by Thargoid
Only by writing a custom AI, possibly twinned with a script to give more detailed scanning etc. It would be quite a specialised pair.

Re: Escort Formations Question

Posted: Sat Oct 13, 2012 7:44 pm
by Tricky
I don't think JavaScript would need to be involved. Just a slight tweaking of the base AI used by the escort and also the intercept AI used by the escort.

Re: Escort Formations Question

Posted: Sat Oct 13, 2012 7:53 pm
by Thargoid
For each to take on a random available target it could be done that way, but if each needs to take a unique target as best as possible that would need JS. It depends how far it wants taking and how complex you want to make it.

JS + AI is a very powerful and flexible combination, and not too much of an additional stretch if you know how to code each separately. The JS scanning capabilities specifically can give some nice results.

It'll also be a nice prelude to the long-planned update to how AIs are done generally.

Re: Escort Formations Question

Posted: Sat Oct 13, 2012 8:13 pm
by mandoman
Would it be presumptuous to request such a thing be made into a new oxp? I don't think I could do it, more's the shame. It just seems like a logical, and neat idea, but that's just me. :)