Page 1 of 2
Mining AI
Posted: Thu May 26, 2011 1:33 pm
by Smivs
A quick question about the minerAI.plist.
Miners will look for and scoop splinters, but if no splinters are found the AI switches state to "LOOK_FOR_ROCKS" and when a 'rock' is found it switches state to "BREAK_ROCKS". In this state it destroys the rocks and starts looking for splinters.
My question is what are 'ROCKS'? Is it anything with SCAN_CLASS = ROCK? Or do they just seek out Boulders which break down into splinters. Asteroids, as far as I know, only break down into Boulders.
The question put simply is Do Miners break Asteroids if there are no splinters around, or will they just go for Boulders?
Re: Mining AI
Posted: Thu May 26, 2011 1:40 pm
by Commander McLane
Smivs wrote:My question is what are 'ROCKS'? Is it anything with SCAN_CLASS = CLASS_ROCK?
Yep, which includes asteroids and boulders.
So in effect miners go for all three in this order:
- priority: splinters
- priority: boulders
- priority: asteroids
Re: Mining AI
Posted: Thu May 26, 2011 1:49 pm
by Smivs
Thanks. When an asteroid field is spawned, do you get a mix of all three?
Re: Mining AI
Posted: Thu May 26, 2011 1:53 pm
by Commander McLane
Smivs wrote:Thanks. When an asteroid field is spawned, do you get a mix of all three?
No, you get asteroids.
When the miner destroys its first asteroid, you get boulders. When it destroys its first boulder, you get splinters.
Then it scoops all splinters and destroys the second boulder. After scooping the splinters it destroys the third boulder. Rinse, repeat. If no boulders are left, it destroys the second asteroid. Rinse, repeat.
Re: Mining AI
Posted: Thu May 26, 2011 1:58 pm
by Eric Walch
Smivs wrote:The question put simply is Do Miners break Asteroids if there are no splinters around, or will they just go for Boulders?
scanForRocks looks first for boulders and when not found it looks for asteroids. So yes, it will break asteroids. The wiki AI page gave this info but did not say what makes an object an asteroid. I just added that info. Any ship with 'asteroid' in its rolelist is seen as asteroid. And when you don't want your objects to spawn as asteroids, you can give it a role with zero weight: 'asteroid(0)'
Re: Mining AI
Posted: Thu May 26, 2011 2:11 pm
by Smivs
Do the miners choose based on scan_class, or role though?
Re: Mining AI
Posted: Thu May 26, 2011 2:14 pm
by Commander McLane
Smivs wrote:Do the miners choose based on scan_class, or role though?
Finally they choose based on roles, because they always go for boulders first, which have the same scan class as asteroids.
Re: Mining AI
Posted: Thu May 26, 2011 2:18 pm
by Smivs
Thanks for the info, guys. Helpful as always.
Re: Mining AI
Posted: Thu May 26, 2011 4:43 pm
by Staer9
Hmmm, I fear that this information could make miners hunt star-jellys and be blown to smitherenes by the quirium cloud they give off
Re: Mining AI
Posted: Thu May 26, 2011 4:50 pm
by Smivs
Re: Mining AI
Posted: Thu May 26, 2011 6:32 pm
by Commander McLane
Staer9 wrote:Hmmm, I fear that this information could make miners hunt star-jellys and be blown to smitherenes by the quirium cloud they give off
The risk of using a generic role for a non-generic entity, I'm afraid.
You could change their role to something unique in a small ship script:
Code: Select all
this.shipSpawned = function()
{
this.ship.primaryRole = "star_jelly";
}
would suffice.
Re: Mining AI
Posted: Thu May 26, 2011 6:42 pm
by Staer9
Commander McLane wrote:Staer9 wrote:Hmmm, I fear that this information could make miners hunt star-jellys and be blown to smitherenes by the quirium cloud they give off
The risk of using a generic role for a non-generic entity, I'm afraid.
You could change their role to something unique in a small ship script:
Code: Select all
this.shipSpawned = function()
{
this.ship.primaryRole = "star_jelly";
}
would suffice.
I did not say there was a problem with miners getting blown up, somethimes things like that just have to happen...
Re: Mining AI
Posted: Thu May 26, 2011 7:06 pm
by Smivs
Yeah, if they can't tell the difference between a rock and a huge bluey-green pulsating jellyfish type thing, they deserve to die!
Re: Mining AI
Posted: Thu May 26, 2011 7:21 pm
by Eric Walch
Commander McLane wrote:You could change their role to something unique in a small ship script:
Code: Select all
this.shipSpawned = function()
{
this.ship.primaryRole = "star_jelly";
}
would suffice.
It won't because the 'asteroid' role still stays on the roles list and the code looks not for primaryRole, but just checks if the role is on the role-list. As far as I know, you can add roles by defining a new primary role, but can't remove an existing role (like 'asteroid') because the array is read-only
Re: Mining AI
Posted: Thu May 26, 2011 7:45 pm
by Commander McLane
Eric Walch wrote:It won't because the 'asteroid' role still stays on the roles list and the code looks not for primaryRole, but just checks if the role is on the role-list. As far as I know, you can add roles by defining a new primary role, but can't remove an existing role (like 'asteroid') because the array is read-only
That is a complication, indeed.
In that case the best solution is to not spawn the star jellies as asteroids in the first place, but spawn one or two with a unique role wherever there is an asteroid field. Or create an additional asteroid field with one or two of them.