Mekanism

Mekanism

111M Downloads

Adding a "scan time" to the Digital Miner

kc7zzv opened this issue ยท 2 comments

commented

Compared to just about every other quarry-like device, the Digital Miner is far more powerful. I believe that it is too powerful. I have no objections to its speed when told to harvest "ore*" in a big pack. I think it is too good at collecting one type of block when that block is very rare and very valuable.

(I previously mentioned this idea in 1474, but I don't want to keep hijacking that ticket)

I am willing to make a pull request if there is interest in this.

Objectives:
*) Leave the Digital Miner similar to its current speed when used to harvest in general.
*) Increase the cost of the Digital Miner when used to harvest something rare

Proposed conceptual changes:
*) Add an efficiency multiplier that decreases based on the number of blocks that are not mined
*) Depending on the multiplier, decrease the speed and leave the power usage constant (increasing the total power needed)
*) Try to tweak the numbers to leave the power usable and speed the same when used for "normal" ore mining

Proposed code changes:

  1. Count the non-air blocks in ThreadMinerSearch.run as well as the blocks to mine
  2. Add an option to the config to configure how many non-mined are equal (in time and power) to one mined block. Probably in MekanismConfig.general
  3. Come up with an inefficiency using total count and count as a float (for display)
  4. Modify TileEntityDigitalMiner.onUpdate to pause and consume power while scanning
  5. Show the (in)efficiency to the user as a percentage from GuiDigitalMiner

Possible efficiency algorithm pesudo-code:

const int numFreeScansPerOperation = 250;//Example
int blocksToMine;//Inited from ThreadMinerSearch.class
int blocksInScanArea;//Inited from ThreadMinerSearch.class
const int skipsPerOre = blocksInScanArea/blocksToMine;
unsigned int workCount = 0;

workCount += numFreeScansPerOperation;

//Unconditionally deduct energy here
if( workCount > skipsPerOre )
{
    workCount -= skipsPerOre;
    //Mine block
}
else
{
    //Skip mining, but still charge the energy cost
}
commented

Digital Miner improvements are being considered and already discussed in another thread. A scan time is a very good suggestion, I'll look into it :)

commented

I think it count air blocks now. I use it, and there are long times when counter of blocks decrease and nothing is mined. I have eject off.