Page 1 of 1

Pirate AI stalking?

Posted: Sat Jun 19, 2010 9:32 am
by Poro
Several times now, whilst flying my Rapier, I have noticed a group of between 1 and 3 pirates (usually Asp Mk.II) hanging back on my scanner screen, yet unerringly following my every move. They never do anything... until I start to use injectors (purely for convenience whilst mass-locked). Once I do that, they pounce: firing their own injectors and engaging me in combat.

What is the AI doing during this? Is it looking at my ship and calculating a mediocre chance of success against me, and then by injecting I am shifting the odds? As in 'Well if he's desperate to get away then he must be in trouble'? Is the AI that subtle?

Next time it happens, I'm going to inject towards them and see what happens.

Posted: Sat Jun 19, 2010 9:42 am
by Cmdr James
None of the standard AI is that subtle, I expect it is something like the distance triggering an event.

Posted: Sat Jun 19, 2010 9:48 am
by Svengali
I'd expect that they were already in attack mode, but out of weapon range.

Posted: Sat Jun 19, 2010 11:04 am
by Poro
Svengali wrote:
I'd expect that they were already in attack mode, but out of weapon range.
So by injecting away from them, I hit the 'outer edge' of the trigger point for them to use their injectors to keep up?

Posted: Sat Jun 19, 2010 9:39 pm
by Switeck
If they're chasing you and you're using a Cobra 3, they probably can't close the distance because they're too slow without injectors.

Posted: Sat Jun 19, 2010 10:06 pm
by Poro
Switeck wrote:
If they're chasing you and you're using a Cobra 3, they probably can't close the distance because they're too slow without injectors.
Yes, I understand that part, but why wouldn't they do that from the beginning? It's the fact that each time they only use injectors after I do. That's why I think it's me getting to a certain outer limit that triggers their injector use - and once they start using them they just keep using injectors until they have caught up. It's strange that they don't just use them from the beginning.

Posted: Sun Jun 20, 2010 12:10 am
by Switeck
They don't do it from the beginning because they have very limited fuel for injectors...and they have bad ai about when to use it.

Posted: Sun Jun 20, 2010 11:23 am
by Kaks
Switeck wrote:
...and they have bad ai about when to use it.
But somehow very good in a predator/prey sort of context! Not a bad deal altogether, is it? :)

Posted: Sun Jun 20, 2010 3:32 pm
by Cmdr James
If people dont like the AI, perhaps some suggestions might help improve it?

Posted: Sun Jun 20, 2010 4:09 pm
by Svengali
Cmdr James wrote:
If people dont like the AI, perhaps some suggestions might help improve it?
More options for performAttack would be pretty and it could also reduce the scriptload (workarounds).
https://bb.oolite.space/viewtopic.php?t=3296&start=325 :wink:

Posted: Sun Jun 20, 2010 5:11 pm
by Smivs
Svengali wrote:
Cmdr James wrote:
If people dont like the AI, perhaps some suggestions might help improve it?
More options for performAttack would be pretty and it could also reduce the scriptload (workarounds).
https://bb.oolite.space/viewtopic.php?t=3296&start=325 :wink:
As discussed before an 'aggression' factor would be good. There are times when a more forthright attack is desirable. Look at Pirates, sometimes they fire on you once or twice then seem to stop again. There is sometimes no real determination on their part.
Also their early shots are often inaccurate, usually from a distance, so it would be good perhaps to have them step up the firing rate as they get more accurate, just like we do...I will often take the odd shot at a very distant target until I know I've got it lined up nicely in the gun-sights, then I'll give it a good long burst of laser. Really the AIs should be trying to replicate the player actions as closely as possible.

Posted: Sun Jun 20, 2010 6:09 pm
by Switeck
I've heard that Random Hits has a coward-type aggression level logic ai.
Maybe it would be good reference material for making a better ai?

Posted: Sun Jun 20, 2010 7:54 pm
by Eric Walch
Switeck wrote:
I've heard that Random Hits has a coward-type aggression level logic ai.
Maybe it would be good reference material for making a better ai?
Yes, but that is only a decision between attacking and just ignoring the target.
Attack itself is not scriptable. Its all hard coded in the source. The only things a script can do is
- starting an attack. (Attack itself is hard coded)
- deciding to break of an attack on energy low conditions.

Aiming, firing laser shots and missiles is controlled by the main code.