Mining AI
Moderators: winston, another_commander
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Mining AI
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?
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?
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Mining AI
Yep, which includes asteroids and boulders.Smivs wrote:My question is what are 'ROCKS'? Is it anything with SCAN_CLASS = CLASS_ROCK?
So in effect miners go for all three in this order:
- priority: splinters
- priority: boulders
- priority: asteroids
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Mining AI
Thanks. When an asteroid field is spawned, do you get a mix of all three?
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Mining AI
No, you get asteroids.Smivs wrote:Thanks. When an asteroid field is spawned, do you get a mix of all three?
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.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Mining AI
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)'Smivs wrote:The question put simply is Do Miners break Asteroids if there are no splinters around, or will they just go for Boulders?
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Mining AI
Do the miners choose based on scan_class, or role though?
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Mining AI
Finally they choose based on roles, because they always go for boulders first, which have the same scan class as asteroids.Smivs wrote:Do the miners choose based on scan_class, or role though?
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Mining AI
Thanks for the info, guys. Helpful as always.
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Staer9
- ---- E L I T E ----
- Posts: 570
- Joined: Fri Feb 18, 2011 4:53 pm
- Location: Hatfield, Hertfordshire (poor industrial)
Re: Mining AI
Hmmm, I fear that this information could make miners hunt star-jellys and be blown to smitherenes by the quirium cloud they give off
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Mining AI
The risk of using a generic role for a non-generic entity, I'm afraid.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
You could change their role to something unique in a small ship script:
Code: Select all
this.shipSpawned = function()
{
this.ship.primaryRole = "star_jelly";
}
- Staer9
- ---- E L I T E ----
- Posts: 570
- Joined: Fri Feb 18, 2011 4:53 pm
- Location: Hatfield, Hertfordshire (poor industrial)
Re: Mining AI
I did not say there was a problem with miners getting blown up, somethimes things like that just have to happen...Commander McLane wrote:The risk of using a generic role for a non-generic entity, I'm afraid.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
You could change their role to something unique in a small ship script:would suffice.Code: Select all
this.shipSpawned = function() { this.ship.primaryRole = "star_jelly"; }
- Smivs
- Retired Assassin
- Posts: 8408
- Joined: Tue Feb 09, 2010 11:31 am
- Location: Lost in space
- Contact:
Re: Mining AI
Yeah, if they can't tell the difference between a rock and a huge bluey-green pulsating jellyfish type thing, they deserve to die!
Commander Smivs, the friendliest Gourd this side of Riedquat.
- Eric Walch
- Slightly Grand Rear Admiral
- Posts: 5536
- Joined: Sat Jun 16, 2007 3:48 pm
- Location: Netherlands
Re: Mining AI
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-onlyCommander McLane wrote:You could change their role to something unique in a small ship script:would suffice.Code: Select all
this.shipSpawned = function() { this.ship.primaryRole = "star_jelly"; }
UPS-Courier & DeepSpacePirates & others at the box and some older versions
- Commander McLane
- ---- E L I T E ----
- Posts: 9520
- Joined: Thu Dec 14, 2006 9:08 am
- Location: a Hacker Outpost in a moderately remote area
- Contact:
Re: Mining AI
That is a complication, indeed.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
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.