Windfall Oil

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Windfall Oil

Post by Frightning »

So I got curious about the math behind how pumpjacks and oil field yield work. Decided to math it out, based on the information on the wiki.

Information:
-Oil Fields have a yield value given as a percentage (e.g. 162% yield).
-Pumpjacks supply oil equal to that percentage in decimal form once each cycle, which unmodified by modules or less than full power, is 1 cycle/second. (e.g. the 162% oil field would supply 1.62 oil each cycle, which would be 1.62 oil/sec by default)
-Yield decreases by 1% every 75 cycles, but can never go below 10%, no matter how much oil has been produced from a given oil field, this works out to a minimum of 0.1 oil/cycle, which is 0.1 oil/sec at default rate.

That last bit is important, essentially, we can think of each oil field as supplying a fixed constant rate, at all times there is a pumpjack on it, which I will call the depleted rate. The depleted rate can be modified by modules or lack of full power. When first build on an oil field with greater yield, the pumpjack will be supplying additional oil until it has dropped the yield to the 10% minimum. The additional oil generated before depletion of the oil field is what I am calling windfall oil (it's a 'one time' boon from that oil field). One thing to note is that the amount of windfall oil is not affected by speed modules or lack of power because those change the rate by modifying the cycle time, hence the actual windfall oil production versus yield depletion ratio is unchanged. The question I got interested in is: What is the relationship between yield and windfall oil?

Assumptions:
For simplicity, we will assume that the decrease happens only once every 75 cycles, and not each cycle by a 1/75th a percent (this would change the numbers only slightly, but significantly complicate the math; and I am not sure how the game actually handles that internally).

Notation:
Let y denote the yield in percent form.
Let w denote the total windfall oil available.

How do we find w from knowing y? Consider as an example, an oil field with 11% yield (y=11). Then for the first 75 cycles, it will produce 0.11 oil/cycle, after which it will hit the minimum rate of 0.1/cycle. Subtracting the depleted rate from the total during those 75 cycles givens a windfall oil per cycle of 0.01 oil, which occurred 75 times (75 cycles), hence the windfall oil for an oil field with a yield of 11% is 0.75 oil.

What about a 12% yield oil field?
Here the first 75 cycles we are getting 0.02/cycle windfall oil, after that, another 75 cycles of 0.01/cycle windfall oil. Writing this as an equation, and simplifying, we obtain:
75*0.01+75*0.02=0.75*1+0.75*2=0.75*(1+2)
This hints at the general pattern.

Now consider an oil field of 15% yield. Here the equation looks like:
75*0.01+75*0.02+75*0.03+75*0.04+75*0.05=0.75*1+0.75*2+0.75*3+0.75*4+0.75*5=0.75*(1+2+3+4+5)
Now the pattern should be becoming clear: the factor of 0.75 is a constant, the part that changes is the the sum, which is the sum of the first y-10 natural numbers (15-10=5). Using the formula for the sum of the first n integers:
sum(1 to n)=n(n+1)/2
..and rewriting by substituting y-10 for n gives
sum=(y-10)((y-9)+1)/2=(y-9)(y-10)/2
Putting that in place of the sum part, and simplifying gives the formula for windfall oil:

Formula:
w=0.375(y-9)(y-10)=0.375y^2-7.125y+33.75

I recommend for simplicity, using the factored form, 0.375(y-9)(y-10)

Observations:
The first thing I found interesting about this formula is that windfall oil scales quadratically with yield value, this means that doubling the yield quadruples the amount of windfall oil available (technically it's doubling the yield minus 10 that does that, but close enough for practical purposes). Similarly quadrupling the yield increases the windfall oil by a factor of 16 (!) Also the time it takes to mine the windfall oil scales only linearly with yield value, so you get that quadruple windfall in only twice the time etc. The other interesting thing to do is actually calculate the windfall oil values for some benchmark yield values:

Some example yield to windfall oil conversions:
50% yield=615 windfall oil
100% yield=3071.25 windfall oil
150% yield=7402.5 winfall oil
200% yield=13,608.75 windfall oil
250% yield=21,690 windfall oil
300% yield=31,646.25 windfall oil
400% yield=57,183.75 windfall oil
500% yield=90,221.25 windfall oil
600% yield=130,758.75 windfall oil
700% yield=178,796.25 windfall oil
800% yield=234,333.75 windfall oil
900% yield=297,371.25 windfall oil
999% yield=367,166.25 windfall oil

Addendum:
In light of XKnight's comment pointing out that the decrease is per cycle afterall, here is the exact formula, where yield needs to be the exact value (not just the rounded value shown by the in-game tooltip; would probably need to use the console to get this more accurate value).

w=(75y-750)(75y-749)/15000

This gives exact windfall oil values (assuming the yield % stated is exactly accurate) of:
50% yield=600.2 windfall oil
75% yield=1584.7 windfall oil
100% yield=3037.95 windfall oil
125% yield=4959.95 windfall oil
150% yield=7350.7 windfall oil
175% yield=10210.2 windfall oil
200% yield=13538.45 windfall oil
250% yield=21,601.2 winfall oil
300% yield=31,538.95 windfall oil
350% yield=43,351.7 windfall oil
400% yield=57,039.45 windfall oil
450% yield=72,602.2 windfall oil
500% yield=90,039.95 windfall oil
600% yield=130,540.45 windfall oil
700% yield=178,540.95 windfall oil
800% yield=234,041.45 windfall oil
900% yield=297,041.95 windfall oil
999% yield=366,800.32 windfall oil
(1000% yield=367,542.45 windfall oil)

For values beyond 1000% yield, the pumpjack's oil generation is capped at 10 oil/cycle, hence the formula changes.

If y>1000, then

w=750(y-1000)+367,542.45

Which is linear growth in w as well as time to extract.
Last edited by Frightning on Mon Jul 18, 2016 9:21 pm, edited 2 times in total.

StarFox31
Inserter
Inserter
Posts: 28
Joined: Wed Apr 20, 2016 11:02 am
Contact:

Re: Windfall Oil

Post by StarFox31 »

Now that is an interesting piece. Thank you for the insight. I especially liked how you were able to note that it scales quadratically.
Image

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Windfall Oil

Post by Frightning »

StarFox31 wrote:Now that is an interesting piece. Thank you for the insight. I especially liked how you were able to note that it scales quadratically.
Yea I got intrigued and noticed that there didn't seem to be anything on this concept around. Also, considering I have a Bachelor's of Science in Mathematics, I had better be able to notice that it scales quadratically. :P

XKnight
Filter Inserter
Filter Inserter
Posts: 329
Joined: Thu May 28, 2015 10:40 pm
Contact:

Re: Windfall Oil

Post by XKnight »

Frightning wrote: Assumptions:
For simplicity, we will assume that the decrease happens only once every 75 cycles, and not each cycle by a 1/75th a percent (this would change the numbers only slightly, but significantly complicate the math; and I am not sure how the game actually handles that internally).
Yield decrease happens each cycle and your assumption introduce some error to calculations.
Corrected values:
50% yield=900.2 windfall oil
100% yield=3712.95 windfall oil
150% yield=8400.7 winfall oil
200% yield=14963.5 windfall oil
250% yield=23401.2 windfall oil
300% yield=33714. windfall oil
400% yield=59964.5 windfall oil
500% yield=93715. windfall oil
600% yield=134965. windfall oil
700% yield=183716. windfall oil
800% yield=239966. windfall oil
900% yield=303717. windfall oil
999% yield=374218. windfall oil

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Windfall Oil

Post by Frightning »

XKnight wrote:
Frightning wrote: Assumptions:
For simplicity, we will assume that the decrease happens only once every 75 cycles, and not each cycle by a 1/75th a percent (this would change the numbers only slightly, but significantly complicate the math; and I am not sure how the game actually handles that internally).
Yield decrease happens each cycle and your assumption introduce some error to calculations.
Corrected values:
50% yield=900.2 windfall oil
100% yield=3712.95 windfall oil
150% yield=8400.7 winfall oil
200% yield=14963.5 windfall oil
250% yield=23401.2 windfall oil
300% yield=33714. windfall oil
400% yield=59964.5 windfall oil
500% yield=93715. windfall oil
600% yield=134965. windfall oil
700% yield=183716. windfall oil
800% yield=239966. windfall oil
900% yield=303717. windfall oil
999% yield=374218. windfall oil
Those numbers can't be right because I overestimated the total by not accounting for the decrease happening each cycle (did you forget to adjust the %'s to account for the fact that it never falls below 10% correctly?), either way though, note that error is pretty small as I predicted it would be in that case.

Edit: I figured out what you did differently, you didn't subtract out the 0.1 oil/cycle during the period of windfall production (I subtract that out because that production would be there regardless of the current yield value of the given oil field). So windfall oil is the amount beyond that 0.1 oil/cycle. for the 50% case that's -300 from the number you have, which gives 600.2 which is close to the value of 615 that I got by approximating.

sckuzzle
Long Handed Inserter
Long Handed Inserter
Posts: 51
Joined: Thu Mar 31, 2016 8:51 am
Contact:

Re: Windfall Oil

Post by sckuzzle »

Frightning wrote:-Yield decreases by 1% every 75 cycles
If I understood the rest of your post correctly, I think what you mean is that the yield decreases by 1 percentage point every 75 cycles, not 1 percent. Is that correct?

Thanks for figuring out the math. I noticed that higher yields seemed to give significantly more oil, but I didn't know how much until now!

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Windfall Oil

Post by Frightning »

sckuzzle wrote:
Frightning wrote:-Yield decreases by 1% every 75 cycles
If I understood the rest of your post correctly, I think what you mean is that the yield decreases by 1 percentage point every 75 cycles, not 1 percent. Is that correct?

Thanks for figuring out the math. I noticed that higher yields seemed to give significantly more oil, but I didn't know how much until now!
I can see what's causing you confusion with that, I do mean 1% as in yield value, not % of total yield. Moreover, as I found out from another poster, it actually decreases by 1/75th of a % yield per cycle rather than 1% yield every 75 cycles (which changes the numbers slightly).

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Windfall Oil

Post by Frightning »

In light of the changes to Oil in 0.13, I thought I'd run the numbers again now that it's 150 cycles to lose 1% yield instead of 75 cycles.

The formula has now changed to:

w=(150y-1500)(150y-1549)/30000

Also, in my observations, at least near starting areas, oil yields are far less variable, rarely exceeding 100% (I imagine they get a good bit higher farther away?), I will put down more of the lower numbers of a fewer large values, at the end will be the new formula for yields over 1000%

Windfall Oil in 0.13:
15% yield=18.775 windfall oil
20% yield=75.05 windfall oil
25% yield=168.825 windfall oil
30% yield=300.1 windfall oil
40% yield=675.15 windfall oil
50% yield=1,200.2 windfall oil
60% yield=1,875.25 windfall oil
75% yield=3,169.075 windfall oil
100% yield=6,075.45 windfall oil
125% yield=9,919.325 windfall oil
150% yield=14,700.7 windfall oil
200% yield=27,075.95 windfall oil
250% yield=43,201.2 windfall oil
300% yield=63,076.45 windfall oil
500% yield=180,077.45 windfall oil
750% yield=410,703.7 windfall oil
1000% yield=735,079.95 windfall oil

For values beyond 1000% the formula changes because Pumpjacks never provide more than 10 oil/cycle, hence the formula becomes:

w=1500*(y-1000)+735,079.95

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Windfall Oil

Post by Deadly-Bagel »

That is really cool. It's good to know roughly how much oil I'll be getting from each deposit.

I noticed the yields in 0.13 were drastically lower. I remember my first game I had oil fields of around 450%, now putting the settings on high I've not even seen above 100%?

On my current game I had very high richness, very high size and very low frequency. One oil field spawned about 200 tiles away from my base, and another three about 1,000 tiles away. Vaguely from memory I don't think there was more than 10% difference. You might see better rates going further but currently there isn't any fast way of travelling through the massive biter nests that spawn this late in the game.
Money might be the root of all evil, but ignorance is the heart.

Frightning
Filter Inserter
Filter Inserter
Posts: 807
Joined: Fri Apr 29, 2016 5:27 pm
Contact:

Re: Windfall Oil

Post by Frightning »

Deadly-Bagel wrote:That is really cool. It's good to know roughly how much oil I'll be getting from each deposit.

I noticed the yields in 0.13 were drastically lower. I remember my first game I had oil fields of around 450%, now putting the settings on high I've not even seen above 100%?

On my current game I had very high richness, very high size and very low frequency. One oil field spawned about 200 tiles away from my base, and another three about 1,000 tiles away. Vaguely from memory I don't think there was more than 10% difference. You might see better rates going further but currently there isn't any fast way of travelling through the massive biter nests that spawn this late in the game.
I noticed that as well, very high in 0.12.35 pretty much meant 500%+ yield, rarely over 1000%, Now it seems to be ~80% rarely over 100%. But I did notice that the fields were even larger, so you get more depleted rate, just way less windfall (let's face it: 100k+ windfall oil/deposit is crazy high)

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Windfall Oil

Post by Deadly-Bagel »

Yeah... my first game I had two pumpjacks and I never ran out. Granted I didn't finish the game because my factory setup was appalling (as with most players' first game I imagine).

Still, you can start with huge and rich ore deposits and you'll pretty much never need to go hunt for more, oil not so much. Even with highest setting richness and "size" the average player will probably need at least two fields to casually finish the game.
Money might be the root of all evil, but ignorance is the heart.

Post Reply

Return to “Gameplay Help”