How do Mining Lasers work?

Started by p0ki, August 12, 2015, 12:56:56 AM

p0ki

The parameters of the industrial mining device are looking like this:
<custom_parameters>
<speed>150</speed>
<amount>250</amount>
<energy>50</energy>
</custom_parameters>

With this you get about 50 glepsite on a glepsite-rich asteroid.

I would like to make a laser that takes triple amount of time and mine triple the value, so I made this:
<custom_parameters>
<speed>50</speed>
<amount>750</amount>
<energy>50</energy>
</custom_parameters>

It should mine triple right? Wrong! It mines 50 glepsite on a glepsite-rich asteroid as well. (But takes 3 times longer.)
At first I thought it has to do with the speed, so I left the speed at 50 and tripled the amount again.
<custom_parameters>
<speed>50</speed>
<amount>1500</amount>
<energy>50</energy>
</custom_parameters>

Now I mined 100 glepsite on a frech asteroid, but I want more like 150.
Adjusting to the curve I doubled the value again:
<custom_parameters>
<speed>50</speed>
<amount>3000</amount>
<energy>50</energy>
</custom_parameters>

Same setup, fresh glepsite-rich asteroid and I mined 123 Glepsite. WHAT?!
Time to take out the big guns... 10x amount
<custom_parameters>
<speed>50</speed>
<amount>30000</amount>
<energy>50</energy>
</custom_parameters>

The amount of glepsite in one cycle was around 250. HOW DO THESE VALUES WORK?!
Any help with this is appreciated. :)

/edit: I might have the starting value on the industrial wrong, can't check that right now.

Lurler

You can open the mining script and you can see the logic behind mining there :)

If you still have more questions after going through the script feel free to post them here.

p0ki

I've looked through the script, and here is what I understand:

  • Get the Ship
  • Get the Asteroid
  • Draw a fancy line in between
  • Play some sounds
  • Duration = Difficulty of the Asteroid divided by speed of device
  • Cooldown of Device = Duration
  • Loop: Calculating the Energy (frame by frame)
So far so good, this was expected.
Now to the more interesting part for me, the mining formula:
total_amount = Math.max(0, Math.floor(Math.pow(Math.max(amount - 50, 0), 0.25) * cont[i].extraction) - 2);


x = Mining Amount - 50 (Where x is at least 0)
x = squareroot of (squareroot of x)
x = x * extraction value of ressource.y (let's say glepsite which is 5-12 depending on type)
Remove everything behind the . from x (so 1.2=1 and 2.9=2)
x = x - 2 (Where the result is at least 0)


When the result is 0 we are done mining ressource.y (glepsite), go to the next ressource.

Okay so going from there I calculated this:
If Mining is 250 (Industrial) and Ressouce is 10 (Glepsite) I get 35.
If Mining is 750 (Industrial) and Ressouce is 10 (Glepsite) I get 49. (Almost my 50)
Reversing the Formula to get 70 Glepsite I need around 2707 mining amount.
(http://www.picfront.org/d/9jr1)

Is that correct?

Lurler

Well, I can say for sure that the basic idea is correct, although I haven't checked the numbers you provided :)