# Acceleration Curve

I have been busy building all sorts of vehicles and have moved to using simple E2 function to control hydraulic steering and applytorque for thrust.

I cannot seem to get a good balance between speed on flat ground and power climbing hills. Either it spazzes out on the flat ground with too much speed or it cannot climb a decent hill.

I tried just setting a different thrust amount with shift to compensate but it is quite clunky.

That is when I had the inspiration of using a function to apply an acceleration curve, so the bottom end has lots of power and the top end is scaled back on a curve.

At first I tried a parabolic curve but that did not respond so well, so I figured a logarithmic curve would be better. I ended up with this:

LForce = Di*(20000/(0.02ln(Speedo)))((APC[“Shift”,number]*0.5)+1)
L1:applyTorque(vec(0,0,LForce))

Di= input from the Advanced pod controller 1 for W -1 for S
Speedo= Speedometer+1 so that it will move even when at a dead stop.
L1= entity, the drive wheel, ball socketed to the back wheels.