Author Topic: Dissipation of Lasers (etc.) over distance  (Read 1553 times)

0 Members and 1 Guest are viewing this topic.

Offline Yonder (OP)

  • Registered
  • Lt. Commander
  • ********
  • Y
  • Posts: 278
Dissipation of Lasers (etc.) over distance
« on: January 08, 2012, 11:47:43 PM »
How exactly is the damage dissipation of lasers and other beam weapons calculated? I had thought that the beams lost one point of damage after every "range modifier" distance, giving a linear decrease, but that doesn't seem to be right. I just hit an enemy at 300k km with a 25cm laser (16 base damage) and a range modifier of 5, but instead of doing 10 damage like I expected I did two.

I expected this damage break down:

10k km, 16 damage
20k km, 16 damage
30k km, 16 damage
40k km, 16 damage
50k km, 16 damage
60k km, 15 damage
70k km, 15 damage
80k km, 15 damage
90k km, 15 damage
100k km, 15 damage
120k km, 14 damage
140k km, 14 damage
160k km, 13 damage
180k km, 13 damage
200k km, 13 damage
210k km, 12 damage
240k km, 12 damage
270k km, 11 damage
300k km, 10 damage
350k km, 10 damage

but got this one:


10k km, 16 damage
20k km, 16 damage
30k km, 16 damage
40k km, 16 damage
50k km, 16 damage
60k km, 13 damage
70k km, 11 damage
80k km, 10 damage
90k km, 8 damage
100k km, 8 damage
120k km, 6 damage
140k km, 5 damage
160k km, 5 damage
180k km, 4 damage
200k km, 4 damage
210k km, 3 damage
240k km, 3 damage
270k km, 2 damage
300k km, 2 damage
350k km, 0 damage

which ends up being an exponential decrease.

It's also odd because while in the class summary view it states that my laser has a range of 320k km, which seems to be correct, in the "Create Research Project" Window it claims that it will be the 800k km laser I would expect. When you turn on the weapon range circle for the map it also displays an 800k km circle.
 

Offline Hawkeye

  • Silver Supporter
  • Vice Admiral
  • *****
  • Posts: 1059
  • Thanked: 5 times
  • Silver Supporter Silver Supporter : Support the forums with a Silver subscription
    2021 Supporter 2021 Supporter : Donate for 2021
    2022 Supporter 2022 Supporter : Donate for 2022
    2023 Supporter 2023 Supporter : Donate for 2023
Re: Dissipation of Lasers (etc.) over distance
« Reply #1 on: January 09, 2012, 09:46:00 AM »
Hm. There might be a bug there.

Your designed and build laser seems to have a range of 800k, but the FC probably has a max range of 350k which is why the class summary lists it with a max-range of 350. And looking at the numbers it seems Aurora is using the range of the FC to calculate damage, where it should use the actual range of the laser.
Ralph Hoenig, Germany
 

Offline Yonder (OP)

  • Registered
  • Lt. Commander
  • ********
  • Y
  • Posts: 278
Re: Dissipation of Lasers (etc.) over distance
« Reply #2 on: January 09, 2012, 11:11:36 PM »
So the lasers definitely decay in a nearly exponential manner to zero either the Fire Control Range or the Laser Range, whichever is smaller. Plasma Carronades decay in a similar manner.

I believe that I have reverse engineered the formula for the damage, it matches the results I've seen in the game except for a single damage number at one range interval of one weapon, which may just be from numerical noise:

FLOOR(MAX(BaseDamage, MIN(1, BaseDamage * Range Modifier / distance)))
Where the distance is in units of tens of thousands of km.

So basically, you multiply the damage by the range modifier, then divide it by the range. Cap that damage at the BaseDamage (the max point blank damage) and make it at least 1 if you are still inside the maximum range. It's all integer math, so strip off any decimals afterwards.
 

Offline Yonder (OP)

  • Registered
  • Lt. Commander
  • ********
  • Y
  • Posts: 278
Re: Dissipation of Lasers (etc.) over distance
« Reply #3 on: January 10, 2012, 10:49:03 AM »
On further inspection, the listed range of 800k km in the display and laser design screen aren't even bugs. That is actually when the formula 16*5/80 hits 1, and in integer math everything else will be zero. It is also when a damage formula going 16, 16, 16, 16, 16, 15, 15, 15, 15, 15... would hit zero, purely by coincidence, which accounts for the confusion.