Adding a "scan time" to the Digital Miner
kc7zzv opened this issue ยท 2 comments
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:
- Count the non-air blocks in ThreadMinerSearch.run as well as the blocks to mine
- 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
- Come up with an inefficiency using total count and count as a float (for display)
- Modify TileEntityDigitalMiner.onUpdate to pause and consume power while scanning
- 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
}
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 :)