Mining AI

Been playing around with mining and the AI.

Was having some interesting results by giving the AI a mining scoop and no weapon, and it would endlessly circle around asteroids, which is kind of neat.

However, I then started trying different weapon parameters to see what kind of interesting effects I could get. And I can't get the AI to fire any weapons at the asteroids. It just circles them.

I tried checking the following flags and parameters.

That the weapon was in range, and the ship has the correct weapon. The weapon works fine for the player.

Weapon parameters:
'Asteroid Weap' = yes
'Passes over asteroids' = no
'2nd trigger' = tried both
'AI won't use' = no
Tried unguided and beams
Damage = tried various
ProxSaftey = 0
Decay = 0
Corona Falloff = 0
Prox and blast = tried various

AI flags:
'Destroy Asteroids'
Scoop Bits'
'Trader behavior'

The weapon does not fire, let alone something else funky causing it not to hit.
It should also be noted that the AI has no problems firing the same weapon when told to attack me.
In a different plug, the AI mins asteroids just fine, and I'm not sure what the difference is.

My first suggestion would be to double-check all of the AI settings of a ship that you know will mine asteroids and from there ensure that your ship matches those specifications. Then, if it still doesn't work, try just copying the good resource over (in fact, you could probably just do this anyways). From there you can start changing different settings until you break the behavior or get the effects you want.

Out of curiosity, the "asteroid weap" flag you're talking about, is that the 10x damage one?

QUOTE (GutlessWonder @ Sep 19 2009, 02:36 AM) <{POST_SNAPBACK}>

Out of curiosity, the "asteroid weap" flag you're talking about, is that the 10x damage one?

Yes it is, that's just what it happens to be called in Rezilla.

Ok, are you ready for this?

The problem was turn rate of the ship.

As it happens, turn rate seems to control how close to the center of the asteroid the AI wants to get before it will fire. With 100 being dead center, and getting further away as turn rate decreases, to about 150 pixels at turn rate 5.
So anything above 100, and the AI will completely fail at asteroid mining. In fact, the range of the weapon is completely disregarded. The AI will happily fire a weapon even if it is out of range.

This number doesn't seem to change with differing top speed, acceleration, and inertialess flag, but these properties can determine the success rate of the AI getting as close as it would like. (Note that the AI will fire if it accidentally happens to gets closer)

It is uncertain if this is a by-product of the positioning algorithm, or an undocumented feature.

Related, the AI will not fire if the weapon passes over asteroids.
It will fire a weapon if the 10x to asteroids flag isn't checked.

This post has been edited by Desprez : 19 September 2009 - 12:03 AM

Weird! Good job catching that.

That's kind of crazy, but I imagine it was probably designed that way so that the 'roid miners did what the dev team wanted them to whenever the mining AI was engaged.