Alright I'm taking a stab at harvesting and here's how I was thinking of implementing:
We add a command H
that works like M
but targets ore voxels. E
takes precedence (so you can have military harvesters...) and if we ever implement a "flee" functionality that would take precedence too.
H
can be called with no arguments to target all ore types besides stone, or a prioritized list of ore types by periodic symbol i.e. Co, Si, Ag, Au, Ni
. If you wanted to actually harvest stone, you'd need to specify this list and include it (maybe as So
or St
) like Co, Si, So
. Clearly this should require a connected ore detector, but we could also eventually add the ability to run it with just a sensor and ignore the ore type arguments.
Harvesting would occur whenever a targeted ore is detected within the range of the currently used detector and would continue every time such ores exist until inventory is full or another command takes over.
Example - Fly out to an asteroid at 1000,1000,1000, stopping to mine any Uranium that comes into detector range everywhere between here and there until full. Once there and full or no more U detected, fly back to 0,0,0, dock, unload, and repeat.
[H U : C 1000,1000,1000 : C 0,0,0 : L Connector : B Connector : G Platform : W60 ]
Do the same thing, but engage detected enemies 1km away along the way:
[E 1000 : H U : C 1000,1000,1000 : C 0,0,0 : L Connector : B Connector : G Platform : W60 ]
@Rynchodon What do you think?
In terms of implementation, I'd add a case for 'h'
into Navigator.addInstruction
that would hook into the CNS at a lower priority than E or M (or F for flee later?), and would function very similarly to a missile but with different search and engagement algorithms.
I haven't gotten much farther than trying to get my arguments parsed and logged (not very experienced with C#), but I'm working on it. : )
I think engagement will be moderately straight forward - approach voxel at range, then slowly go forward towards it with drills on, pulsing forward so as to minimize shake due to asteroid collision. Remember vector in, follow it directly out when voxel no longer in front or inv full, resume unless inventory full.
But search - that's a bit of a mystery to me. How can I find the part of an asteroid voxel that is of a particular type of ore? The ore detector does it and finds their centers, so I know it's possible. I see we get voxels a few different ways and IMyVoxel exists, but I can't find any examples of finding parts of an asteroid by material. Are the ore patches seperate voxels? How do I get material type?
@Rynchodon Any guidance on implementation at this point would be highly appreciated.