BahamutoD / BDArmory

Gun turrets and other weapon systems for KSP
38 stars 113 forks source link

Fixed short range laser damage scaling. #7

Closed Yskinator closed 9 years ago

Yskinator commented 9 years ago

Previous calculations assumed the laser originated from a single spot, resulting in the amount of damage dealt by them on short ranges scaling wildly out of control. This is now fixed.

A flashlight on the wall is a good analogue for what the formula is doing - the further away you move, the wider the cone of light gets, and the less brightly lit any spot hit by that cone of light gets. Previously that area lit by the cone could go all the way down to zero if you moved the laser close enough, which completely broke the formula, so I simply made it so that the area is always at least one square meter and scales up from there.

The lasers might need some re-balancing with the changes, so to recap, you can adjust the laser's point blank damage with laserDamage, and the rate at which it scales down with tanAngle. Both are read from the part's config file.

BahamutoD commented 9 years ago

Merged manually in pre-0.9.6-1

Yskinator commented 9 years ago

Yes, go ahead and change it.

That was quite possibly the first line of C# I ever wrote, so I was thinking in Java when I wrote that. There is no Mathf in Java.

BahamutoD commented 9 years ago

Gotcha. Mathf is actually a Unity thing.

On Sun, Aug 16, 2015 at 3:15 PM, Yskinator notifications@github.com wrote:

Yes, go ahead and change it.

That was quite possibly the first line of C# I ever wrote, so I was thinkin in Java when I wrote that. There is no Mathf in Java.

— Reply to this email directly or view it on GitHub https://github.com/BahamutoD/BDArmory/pull/7#issuecomment-131607126.