This project has moved and is read-only. For the latest updates, please go here.

Creating steering behaviors on top of Farseer

Topics: User Forum
Jan 24, 2011 at 6:53 PM

Hi, over the weekend I was trying to implement some basic steering behaviors using Farseer. I believe I got "Seek" working fine, but I was having some trouble with "Arrive" and wanted to see if anyone could help me. When I implement arrival the body overshoots the target. The equation I'm working with can be found here: My sense is that this implementation expects the acceleration to be reset at the start of each loop which isn't happening.

Anyway, I am curious if anyone has implemented this behavior on top of Farseer and if so how did this accomplish it?

Thanks, Alex

Jan 26, 2011 at 6:42 AM

Any chance anyone has an idea about how to approach this problem?

Jan 26, 2011 at 12:10 PM

You could always try asking on the AppHub forum or the Box2D forum.

Jan 26, 2011 at 12:45 PM

From what I know about flocking algorithms you control the movement by manipulating velocities of boids only.  I'd try using kinematic bodies. You can control them by setting the linear velocities directly and don't have to worry about acceleration. If you want to use body.ApplyForce() just take the current linear velocity of a body and calculate the difference to the desired velocity/direction and apply that instead of applying the desired velocity directly. That should work fine.