Blood-Asp / GT5-Unofficial

Decompiled and modified version of GT5.07.07
159 stars 97 forks source link

Oil Drilling Rig: wrong pumping rate? #1238

Open ObKo opened 6 years ago

ObKo commented 6 years ago

This bug possible related to https://github.com/Blood-Asp/GT5-Unofficial/pull/1214

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

How does oil generated

The main generation code: https://github.com/Blood-Asp/GT5-Unofficial/blob/ddf58e6ef45bbffa3c5ecde39114aff0bc4d1efc/src/main/java/gregtech/api/objects/GT_UO_Fluid.java#L55-L60

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

How does pump rate calculated

Amount

https://github.com/Blood-Asp/GT5-Unofficial/blob/221f98bbcdc9019f4dd743cde0c2d9ebf3fe5089/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java#L98-L113

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

https://github.com/Blood-Asp/GT5-Unofficial/blob/221f98bbcdc9019f4dd743cde0c2d9ebf3fe5089/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java#L142-L153

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

https://github.com/Blood-Asp/GT5-Unofficial/blob/73662e531f353013f67ec5de71db77475f33b3a2/src/main/java/gregtech/common/GT_UndergroundOil.java#L85

(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

https://github.com/Blood-Asp/GT5-Unofficial/blob/221f98bbcdc9019f4dd743cde0c2d9ebf3fe5089/src/main/java/gregtech/common/tileentities/machines/multi/GT_MetaTileEntity_OilDrillBase.java#L78-L95

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

Conсlusion

Since https://github.com/Blood-Asp/GT5-Unofficial/pull/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.

JohannesGaessler commented 6 years ago

Your calculations seem to be correct from what I can tell. I don't know if the change in pump rate for the Oil Drill is intentional, but I assume it's not.

For the probability density function I got f(x) = 0.4 (100 x)^(-0.8), with a weighted average of ~104L per cycle. I neglected the effects of rounding in my calculations.

Antifluxfield commented 6 years ago

Rebalanced in #1230

MauveCloud commented 6 years ago

@Antifluxfield how exactly does that PR rebalance this? If Blood Asp's assessment of the new EU costs and timing for the oil drilling rig is correct, the total EU per cycle of the simplest oil drilling rig will still be 15360 (since it still requires an MV energy hatch as minimum), which as ObKo pointed out, requires about 80 L/cycle of oil just to break even.

GusSmedstad commented 6 years ago

I just tested a Drilling Rig 1 with a 400,000 EU battery. While the pumping rate is still 0.5x the base rate, each cycle is now 4 seconds, not 8, at 50 EU/tick, not 96, for a total cost of 4,000 EU per cycle. This is 1/4 the cost of the 16k EU mentioned in the original post. The break even point for crude oil and light fuel is now about 17 L / cycle from a base rate of 34 L / cycle.

Presumably this is the difference made by the pull request.