performAttack and Missiles

General discussion for players of Oolite.

Moderators: winston, another_commander

metatheurgist
Competent
Competent
Posts: 63
Joined: Fri Dec 14, 2012 9:42 am

performAttack and Missiles

Post by metatheurgist »

Not sure if this should be in Expansion Packs, it's really more of a general script question.

I was playing around with scripting, and I created an object that would shoot ships and beacons.

When I set the target of the object to a missile, it would track the missile but wouldn't attack, no laser fire at all.

Is this behaviour by design?
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: performAttack and Missiles

Post by submersible »

metatheurgist wrote:
Not sure if this should be in Expansion Packs, it's really more of a general script question.

I was playing around with scripting, and I created an object that would shoot ships and beacons.

When I set the target of the object to a missile, it would track the missile but wouldn't attack, no laser fire at all.

Is this behaviour by design?
Interesting - I cannot really tell you, however i noticed something earlier today playing 1.77 - enemies targeting my missiles with their missiles. Which is odd - or at least unusual and not something I had seen before.
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: performAttack and Missiles

Post by Cody »

submersible wrote:
... however i noticed something earlier today playing 1.77 - enemies targeting my missiles with their missiles. Which is odd - or at least unusual and not something I had seen before.
No, I've not seen that before either - interesting!

Welcome aboard, metatheurgist.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: performAttack and Missiles

Post by cim »

metatheurgist wrote:
Is this behaviour by design?
No, they shouldn't have anything against firing at a missile, and I've seen it happen before. (Though, it's a small fast-moving target, so they may well not be tracking it well enough to actually get a hit, so not opening fire)
User avatar
Mad Dan Eccles
Deadly
Deadly
Posts: 196
Joined: Tue Sep 07, 2004 8:54 pm
Location: The Greatest City in the Ooniverse
Contact:

Re: performAttack and Missiles

Post by Mad Dan Eccles »

El Viejo wrote:
submersible wrote:
... however i noticed something earlier today playing 1.77 - enemies targeting my missiles with their missiles. Which is odd - or at least unusual and not something I had seen before.
No, I've not seen that before either - interesting!
Woah. That changes things. Probably not worth having a pylon for a soft missile just in case, but when you're out of fuel and low on shields and somebody chucks a hard head at you…
Master of Mayhem

"The name's derived from Object Oriented eLite so you could say "Oh! Oh! Leet!", but that might sound too much like g33k sex."
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: performAttack and Missiles

Post by Cody »

Mad Dan Eccles wrote:
... but when you're out of fuel and low on shields and somebody chucks a hard head at you…
Laser it!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Mad Dan Eccles
Deadly
Deadly
Posts: 196
Joined: Tue Sep 07, 2004 8:54 pm
Location: The Greatest City in the Ooniverse
Contact:

Re: performAttack and Missiles

Post by Mad Dan Eccles »

I've managed that exactly once! :lol:
Master of Mayhem

"The name's derived from Object Oriented eLite so you could say "Oh! Oh! Leet!", but that might sound too much like g33k sex."
User avatar
submersible
Commodore
Commodore
Posts: 264
Joined: Thu Nov 10, 2011 7:49 am

Re: performAttack and Missiles

Post by submersible »

cim wrote:
metatheurgist wrote:
Is this behaviour by design?
No, they shouldn't have anything against firing at a missile, and I've seen it happen before. (Though, it's a small fast-moving target, so they may well not be tracking it well enough to actually get a hit, so not opening fire)
Might the AI launch a missile at another missile ? Particularly if unable to laser it?
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: performAttack and Missiles

Post by cim »

AIs low on health will often launch a missile at their current target. If a missile has been launched at them recently, they could certainly try to counter-missile it.

Doing it deliberately because it's a good idea? No, not yet.
User avatar
Rorschachhamster
---- E L I T E ----
---- E L I T E ----
Posts: 274
Joined: Sun Aug 05, 2012 11:46 pm
Contact:

Re: performAttack and Missiles

Post by Rorschachhamster »

cim wrote:
Doing it deliberately because it's a good idea? No, not yet.
Depends. What if your missile misses the other missile and follows it... :shock: :wink:
metatheurgist
Competent
Competent
Posts: 63
Joined: Fri Dec 14, 2012 9:42 am

Re: performAttack and Missiles

Post by metatheurgist »

cim wrote:
No, they shouldn't have anything against firing at a missile, and I've seen it happen before. (Though, it's a small fast-moving target, so they may well not be tracking it well enough to actually get a hit, so not opening fire)
This may be the answer. I reconfigured the object to target cargo containers and, erm, "opened" a couple of Pythons. When I flew the object into the mass of cargo it didn't start shooting until it was well into point blank range (<1 km). If it's having that much trouble locking onto stationery cargo it's probably not going to successfully target missiles. *sigh*
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: performAttack and Missiles

Post by cim »

metatheurgist wrote:
This may be the answer. I reconfigured the object to target cargo containers and, erm, "opened" a couple of Pythons. When I flew the object into the mass of cargo it didn't start shooting until it was well into point blank range (<1 km). If it's having that much trouble locking onto stationery cargo it's probably not going to successfully target missiles. *sigh*
Hmm... they should generally be getting a lock - or at least a "worth a try" - before that sort of range. I wouldn't expect them to necessarily hit the missile/cargo very often, but I'm surprised they aren't even trying. A few questions:
- what Oolite version?
- what is your typical frame rate? (Shift-F to display)
- have you set "accuracy" in shipdata.plist, and if so, what to?
- what are the max pitch/roll rates of the ship?
metatheurgist
Competent
Competent
Posts: 63
Joined: Fri Dec 14, 2012 9:42 am

Re: performAttack and Missiles

Post by metatheurgist »

Oolite version 1.76.1
FPS 74-75
Accuracy for the object is set to 10
Max Pitch and Roll are set to 25

It does track the target object, I can see it changing orientation to face it, it just doesn't seem to shoot until it's close. I repeated the test with cargo containers today and got a better result. It started shooting cargo between 2-3 kms. I may have changed the laser setting between tests.

I have the object tethered to the top of my Cobra (via some ugly code to force its position). It's pretending to be a CIWS (close in weapons system). It's free to choose it's orientation, just not to move away. Don't know if that would affect it's aim.
User avatar
cim
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 4072
Joined: Fri Nov 11, 2011 6:19 pm

Re: performAttack and Missiles

Post by cim »

metatheurgist wrote:
Max Pitch and Roll are set to 25
This is probably the problem. Spins a full circle in a quarter of a second, but terrible for precision aim. Start at around 2 roll and 1 pitch (which is typical for a ship, so what the AI is optimised for) and then slowly increase them.
metatheurgist wrote:
Oolite version 1.76.1
It would probably work a bit better in 1.77, since the accuracy of 10 would then enable some additional precision aiming routines that didn't exist in 1.76, but this is probably not the main problem.
metatheurgist
Competent
Competent
Posts: 63
Joined: Fri Dec 14, 2012 9:42 am

Re: performAttack and Missiles

Post by metatheurgist »

OK. Tried pitch and roll at 1,2 and went to 5,6 increasing both by 1 each time. The range for shooting cargo is still within the 2-3 kms range, though at pitch 2 roll 3 it did take a shot at 5kms and hit. I'm waiting for a stable release before comitting to an update.
Post Reply