Skip to content

Oil Drilling Rig: wrong pumping rate? #1238

@ObKo

Description

@ObKo

This bug possible related to #1214

tl;dr: Oil pumping rates are insane for now.

How does oil generated

The main generation code:

public int getRandomAmount(Random aRandom){//generates some random ass number that correlates to extraction speeds
int div = (int)Math.floor(Math.pow((MaxAmount-MinAmount)*100.d*DIVIDER, 0.2d));
int min = (int)Math.floor(Math.pow(MinAmount*100.d*DIVIDER, 0.2d));
double amount = min+aRandom.nextInt(div)+aRandom.nextDouble();
return (int) (Math.pow(amount, 5) / 100);//reverses the computation above
}

  • minAmount/maxAmount comes from config and it's 0/625 by default.
  • DIVIDER=5000
  • So, amount distributed in [0..50]
  • That means, that getRandomAmount() will return value in [0..3125000] (with some kind of inverted Pareto Distribution

AFAIK, that code comes from very first version of undeground oil.

How does pump rate calculated

Amount

protected boolean workingDownward(ItemStack aStack, int xDrill, int yDrill, int zDrill, int xPipe, int zPipe, int yHead, int oldYHead){
if (!tryLowerPipe()){
if (waitForPipes()) return false;
if (tryFillChunkList()) {
float speed = .5F+(GT_Utility.getTier(getMaxInputVoltage()) - getMinTier()) *.25F;
FluidStack tFluid = pumpOil(speed);
if (tFluid != null && tFluid.amount > getTotalConfigValue()){
this.mOutputFluids = new FluidStack[]{tFluid};
return true;
}
}
isPickingPipes = true;
return true;
}
return true;
}

That code is quite clear - pump oil with speed = 0.5 + 0.25 * ((tier from energy hatches) - (base machine tier)). Note that in normal condition (no overclock) speed = 0.5

private FluidStack pumpOil(float speed){
if (mOilId <= 0) return null;
FluidStack tFluid, tOil;
tOil = new FluidStack(FluidRegistry.getFluid(mOilId), 0);
for (Chunk tChunk : mOilFieldChunks) {
tFluid = undergroundOil(getBaseMetaTileEntity(),speed);
if (tFluid == null) mOilFieldChunks.remove(tChunk);
if (tOil.isFluidEqual(tFluid)) tOil.amount += tFluid.amount;
}
return tOil.amount == 0 ? null : tOil;
}
}

That code gets some oil from chunk. I'll show only single line of undegroundOil():

int fluidExtracted=(int)Math.floor(fluidInChunk.amount * (double) readOrDrainCoefficient / DIVIDER);

(Amount Of Pumped Oil) = speed * (Oil In Chunk) / 5000.

So, at best case, with no overclock (speed = 0.5) pumpOil will return [0..312]

Time, Energy

protected void setElectricityStats() {
this.mEfficiency = getCurrentEfficiency(null);
this.mEfficiencyIncrease = 10000;
//T1 = 24; T2 = 96; T3 = 384
this.mEUt = 6 * (1 << (getMinTier() << 1));
//160 per chunk in MV
this.mMaxProgresstime = (isPickingPipes ? 80 : 640 * getRangeInChunks() * getRangeInChunks()) / (1 << getMinTier());
long voltage = getMaxInputVoltage();
long overclockEu = V[Math.max(1, GT_Utility.getTier(voltage)) - 1];
while (this.mEUt <= overclockEu) {
this.mEUt *= 4;
this.mMaxProgresstime /= 2;
}
this.mEUt = -this.mEUt;
this.mMaxProgresstime = Math.max(1, this.mMaxProgresstime);
}

Code is simple: for basic oil drill (minTier = 2) is 160 ticks and 96EU/t minimum

Conсlusion

Since #1214 oil rig is MV+ machine (minTier = 2). But oil pumping rate is the same as was for previous LV rig = 312L/8s max, so oil is 4x expensive. Using oil generating math, I can say that 50% of oil chunks can give only <10L, 80%: <100L 92%: <200L per 8 seconds with MV oil rig (96 EU/t) = ~16k EU. That basically means that oil is pretty useless for energy generation, because 16k of EU = 80mB of oil = only 24% of oil sources will give any (very small) amount energy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions