Mining AI

General discussion for players of Oolite.

Moderators: winston, another_commander

User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Mining AI

Post 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?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Commander McLane
---- E L I T E ----
---- 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

Post 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:
  1. priority: splinters
  2. priority: boulders
  3. priority: asteroids
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Mining AI

Post by Smivs »

Thanks. When an asteroid field is spawned, do you get a mix of all three?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Commander McLane
---- E L I T E ----
---- 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

Post 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.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Mining AI

Post 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)'
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Mining AI

Post by Smivs »

Do the miners choose based on scan_class, or role though?
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Commander McLane
---- E L I T E ----
---- 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

Post 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.
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Mining AI

Post by Smivs »

Thanks for the info, guys. Helpful as always.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Re: Mining AI

Post 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
Image
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Mining AI

Post by Smivs »

:twisted: :twisted: :twisted:
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Commander McLane
---- E L I T E ----
---- 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

Post 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.
User avatar
Staer9
---- E L I T E ----
---- E L I T E ----
Posts: 570
Joined: Fri Feb 18, 2011 4:53 pm
Location: Hatfield, Hertfordshire (poor industrial)

Re: Mining AI

Post 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...
Image
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Mining AI

Post 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! :evil:
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
Eric Walch
Slightly Grand Rear Admiral
Slightly Grand Rear Admiral
Posts: 5536
Joined: Sat Jun 16, 2007 3:48 pm
Location: Netherlands

Re: Mining AI

Post 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 :(
User avatar
Commander McLane
---- E L I T E ----
---- 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

Post 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.
Post Reply