Page 1 of 2
performAttack and Missiles
Posted: Sat Feb 16, 2013 10:11 am
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?
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 11:04 am
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.
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 11:10 am
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.
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 11:52 am
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)
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 12:02 pm
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…
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 12:18 pm
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!
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 12:53 pm
by Mad Dan Eccles
I've managed that exactly once!
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 12:57 pm
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?
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 1:03 pm
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.
Re: performAttack and Missiles
Posted: Sat Feb 16, 2013 5:51 pm
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...
Re: performAttack and Missiles
Posted: Sun Feb 17, 2013 1:29 pm
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*
Re: performAttack and Missiles
Posted: Sun Feb 17, 2013 5:36 pm
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?
Re: performAttack and Missiles
Posted: Mon Feb 18, 2013 4:55 pm
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.
Re: performAttack and Missiles
Posted: Mon Feb 18, 2013 5:09 pm
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.
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.
Re: performAttack and Missiles
Posted: Tue Feb 19, 2013 5:26 pm
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.