# Smoothing a shot power curve

I'm making a game with shot powers (user presses and holds and launches an object)

Distance from the cursor was working for testing but obviously a distance of 1 and 2 pixels is double. I scaled this by 4 to make the difference itself less drastic but they're double of each other.

Is there a common way to smooth the strength of a shot so it's not so great per jump?

I would suggest trying a logarithmic scale. This is probably best as a power factor. As they drag further away, the power will increase at a slower rate.

For example:

var maxPower = 300;
var scale = 4;
var distance = (the number of pixels they dragged...);

var power = maxPower * log( distance / scale ); Easy answer: start from say 10, so your power function goes like 10, 11, 12 ...

Advanced answer: linear functions aren't so great for things like powers, where you're interested in the relative difference between powers. For example, power 100 should be noticeably different to power 99, even though the linear difference is just 1%, barely noticeable. Instead you should start with something like a geometric series, which means a function where every step is a constant factor up or down. You see this crop up in a lot of places, such as exp required for next level up, the amplitude from volume knobs, chance-to-hit formulas etc.