# How to apply steering to a physics body correctly when using a physics engine?

I have a top down 2d game that uses a physics engine (Farseer).

I'm using the standard steering behaviors to make the AI move around but I'm not sure the correct way to take the so called "steering force" calculated by the steering behavior and apply it to the physics bodies.

For example:

The steering behavior SEEK returns

return desiredVelocity - currentVelocity;


So it is returning a difference of two velocities (in meters per second).

I need to convert this into the force (in Newtons) that I need to apply to my physics body, taking into account its mass and acceleration etc.

I know it should be simply but I'm getting confused! :)

Your bodies have a current 2d velocity : vcx, vcy. You desire a new velocity: vnx, vny. Correct? Now force translates into acceleration/mass (and velocity indirectly).
vnx - vcx = fx/m * t;

Do the same with axis y.
• I don't think they use it as F. They probably use it to calculate a, it is very possible you'd want to keep the a bound in order to make changes in velocity appear smooth. If you use any a or simply replace the current velocity with the desired velocity, the movement will appear very rigid at times. – AturSams Mar 21 '14 at 10:34