Author Topic: How do Mining Lasers work?  (Read 983 times)

p0ki

  • Full Member
  • ***
  • Posts: 113
    • View Profile
How do Mining Lasers work?
« on: August 12, 2015, 12:56:56 am »
The parameters of the industrial mining device are looking like this:
Code: [Select]
<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:
Code: [Select]
<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.
Code: [Select]
<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:
Code: [Select]
<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
Code: [Select]
<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.
Playing on:
[EU][kG]kunix.org

Lurler

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1021
    • View Profile
Re: How do Mining Lasers work?
« Reply #1 on: August 12, 2015, 11:08:39 pm »
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

  • Full Member
  • ***
  • Posts: 113
    • View Profile
Re: How do Mining Lasers work?
« Reply #2 on: August 14, 2015, 02:08:32 am »
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:
Code: [Select]
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.


Is that correct?
Playing on:
[EU][kG]kunix.org

Lurler

  • AtomicTorch Founder
  • Hero Member
  • *****
  • Posts: 1021
    • View Profile
Re: How do Mining Lasers work?
« Reply #3 on: August 16, 2015, 09:26:31 pm »
Well, I can say for sure that the basic idea is correct, although I haven't checked the numbers you provided :)