Creating steering behaviors on top of Farseer

Topics: User Forum
Jan 24, 2011 at 5: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: http://www.shiffman.net/teaching/nature/steering/ 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 5:42 AM

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

Coordinator
Jan 26, 2011 at 11:10 AM

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

Developer
Jan 26, 2011 at 11:45 AM

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.